Skip to content

Conversation

@tamaskozmer
Copy link
Contributor

@tamaskozmer tamaskozmer commented Jan 6, 2026

Test plan:

  1. Navigate to a quiz assignment that has multiple submission attempts
  2. Open the Assignment Details screen
  3. Verify that the attempt dropdown shows attempts in correct order (Attempt 1, Attempt 2, Attempt 3, etc.) with the highest attempt number being the most recent
  4. Select different attempts and verify the correct submission is displayed
  5. Compare with a non-quiz assignment with multiple attempts to ensure the fix doesn't break existing functionality

refs: MBL-19605
affects: Student
release note: Fixed quiz submission attempts displaying in reverse order

Checklist

  • Follow-up e2e test ticket created or not needed
  • Tested in dark mode
  • Tested in light mode
  • Test in landscape mode and/or tablet
  • A11y checked
  • Approve from product

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

🧪 Unit Test Results

✅ 📱 Student App

  • Tests: 1241 total, 0 failed, 0 skipped
  • Duration: 0.000s
  • Success Rate: 100%

✅ 🌅 Horizon

  • Tests: 449 total, 0 failed, 0 skipped
  • Duration: 30.671s
  • Success Rate: 100%

✅ 📦 Submodules

  • Tests: 2515 total, 0 failed, 0 skipped
  • Duration: 50.753s
  • Success Rate: 100%

📊 Summary

  • Total Tests: 4205
  • Failed: 0
  • Skipped: 0
  • Status: ✅ All tests passed!

Last updated: Mon, 12 Jan 2026 11:22:12 GMT

Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This PR improves how submission attempts are numbered by using the actual attempt field from submission objects instead of calculating from array indices. This is a good change that should make attempt numbering more reliable and accurate.

Positive Feedback

  • ✅ Good fix to use actual attempt numbers instead of index-based calculation
  • ✅ Consistent implementation across both SubmissionDetailsView and AssignmentDetailsViewModel
  • ✅ Test coverage updated to include attempt numbers in test data
  • ✅ The sortedByDescending ensures proper ordering by attempt number

Issues Found

  • Type clarity concern in SubmissionDetailsView.kt:236 - The Pair<Long, String> structure makes it unclear what .first represents. Consider using a named data class for better code readability.
  • Null safety consideration in AssignmentDetailsViewModel.kt:450 - The submission.attempt field should be validated to handle potential null or zero values that could cause display issues.

Additional Observations

Code Quality: The change is straightforward and follows Kotlin idioms. The shift from mapIndexed to map and from reversed() to sortedByDescending are both appropriate for this use case.

Test Coverage: Good that test data was updated to include attempt numbers. Consider adding an edge case test for submissions with null or zero attempt numbers.

Performance: The sorting operation is minimal impact given typical submission history sizes.

Security: No security concerns identified.

Overall, this is a solid improvement with minor suggestions for enhancement around type safety and null handling.

@tamaskozmer tamaskozmer changed the title [MBL-19610][Student] Fix quiz submission attempt display order [MBL-19605][Student] Fix quiz submission attempt display order Jan 6, 2026
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

📊 Code Coverage Report

⚠️ Student

  • PR Coverage: 43.51%
  • Master Coverage: 43.56%
  • Delta: -0.05%

✅ Teacher

  • PR Coverage: 25.61%
  • Master Coverage: 25.61%
  • Delta: +0.00%

✅ Pandautils

  • PR Coverage: 22.91%
  • Master Coverage: 22.88%
  • Delta: +0.03%

📈 Overall Average

  • PR Coverage: 30.68%
  • Master Coverage: 30.68%
  • Delta: -0.01%

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Student Install Page

Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review - Attempt Numbering Fix

This PR fixes the submission attempt numbering by using actual attempt values from the API instead of calculating from array indices. The changes look good overall.

Summary of Changes:

  • ✅ Fixed submission attempt display to use actual attempt numbers
  • ✅ Updated mock canvas to generate sequential attempt numbers
  • ✅ Consistent changes across ViewModel and View layers
  • ✅ Added IPv4 preference to GitHub workflows (unrelated but good)
  • ✅ Updated tests with explicit attempt numbers

Minor Suggestions:

I've left inline comments on potential edge cases around null handling and robustness improvements, but these are optional enhancements. The core logic is sound.

Testing:

The test updates look good and verify the new behavior correctly.

Copy link
Contributor

@kdeakinstructure kdeakinstructure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Please consider a solution to new quizzes as well since it will be 'Attempt 0' for every attempts. (Classic quiz is working well).

Copy link
Contributor

@kdeakinstructure kdeakinstructure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA 👍

@tamaskozmer tamaskozmer merged commit 9fa562c into master Jan 12, 2026
27 checks passed
@tamaskozmer tamaskozmer deleted the MBL-19605-quiz-attempts-are-in-reversed-order branch January 12, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants