Skip to content

[MBL-19889][Teacher] Fix SpeedGrader grading status showing Graded when grade is null#3618

Merged
kristofnemere merged 2 commits intomasterfrom
MBL-19889
Apr 7, 2026
Merged

[MBL-19889][Teacher] Fix SpeedGrader grading status showing Graded when grade is null#3618
kristofnemere merged 2 commits intomasterfrom
MBL-19889

Conversation

@kristofnemere
Copy link
Copy Markdown
Contributor

@kristofnemere kristofnemere commented Apr 2, 2026

Test plan:

  1. Open Teacher app and navigate to an assignment
  2. Find a student submission where the teacher has left a comment but has NOT assigned a grade
  3. Open SpeedGrader for that submission
  4. Verify the status label shows Submitted (not Graded) in the student header
  5. Also verify that a submission with an actual grade still correctly shows Graded

refs: MBL-19889
affects: Teacher
release note: Fixed an issue where SpeedGrader incorrectly displayed a submission as "Graded" when the teacher had only left a comment without assigning an actual grade.

  • 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

…en grade is null

Canvas sets workflow_state to "graded" even when only a comment is left
with no actual grade. The GraphQL-based SpeedGrader was using state ==
graded to determine the label, while the REST-based submission list
correctly checks grade != null. Added grade field to the GraphQL fragment
and gated SubmissionStateLabel.Graded on grade != null.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copy link
Copy Markdown

@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 fixes a bug where a submission with workflow_state == graded but no actual grade value (e.g. the grade was cleared without changing the workflow state) was incorrectly showing as Graded instead of Submitted. The fix is correct and well-scoped.

What's good

  • The GraphQL fragment addition of grade is minimal and targeted.
  • The logic change correctly threads grade through to the state label decision, and adding SubmissionState.graded to the Submitted fallback set cleanly handles the null-grade case.
  • Both the updated existing test and the new null-grade test cover the core scenarios.
  • The GradeChanged event test is correctly updated to supply a grade mock.

Issues found

  • Test name inconsistency (SpeedGraderContentViewModelTest.kt, new test at line 366): The new test name uses Submitted state (title-case) while existing tests follow an uppercase convention (GRADED state, NOT_SUBMITTED state). Minor, but worth aligning for consistency.
  • Missing edge-case test (SpeedGraderContentViewModel.kt, line 233–237): Now that SubmissionState.graded is in the Submitted fallback set, the interaction with late/missing status tags when grade == null is implicit rather than tested. A test for graded + grade=null + statusTag=late → Late would make the intended priority order explicit.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

🧪 Unit Test Results

✅ 📱 Student App

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

✅ 📱 Teacher App

  • Tests: 373 total, 0 failed, 0 skipped
  • Duration: 30.995s
  • Success Rate: 100%

✅ 🌅 Horizon

  • Tests: 790 total, 0 failed, 0 skipped
  • Duration: 38.013s
  • Success Rate: 100%

✅ 📦 Submodules

  • Tests: 3348 total, 0 failed, 0 skipped
  • Duration: 56.923s
  • Success Rate: 100%

📊 Summary

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

Last updated: Thu, 02 Apr 2026 10:56:10 GMT

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

📊 Code Coverage Report

✅ Student

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

✅ Teacher

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

✅ Pandautils

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

📈 Overall Average

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

Student Install Page

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

Teacher Install Page

Copy link
Copy Markdown
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 👍

@kristofnemere kristofnemere merged commit cae2bba into master Apr 7, 2026
28 checks passed
@kristofnemere kristofnemere deleted the MBL-19889 branch April 7, 2026 09:10
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.

3 participants