[MBL-19889][Teacher] Fix SpeedGrader grading status showing Graded when grade is null#3618
Merged
kristofnemere merged 2 commits intomasterfrom Apr 7, 2026
Merged
[MBL-19889][Teacher] Fix SpeedGrader grading status showing Graded when grade is null#3618kristofnemere merged 2 commits intomasterfrom
kristofnemere merged 2 commits intomasterfrom
Conversation
…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]>
There was a problem hiding this comment.
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
gradeis minimal and targeted. - The logic change correctly threads
gradethrough to the state label decision, and addingSubmissionState.gradedto theSubmittedfallback set cleanly handles the null-grade case. - Both the updated existing test and the new null-grade test cover the core scenarios.
- The
GradeChangedevent 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 usesSubmitted 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 thatSubmissionState.gradedis in theSubmittedfallback set, the interaction withlate/missingstatus tags whengrade == nullis implicit rather than tested. A test forgraded + grade=null + statusTag=late → Latewould make the intended priority order explicit.
Contributor
🧪 Unit Test Results✅ 📱 Student App
✅ 📱 Teacher App
✅ 🌅 Horizon
✅ 📦 Submodules
📊 Summary
Last updated: Thu, 02 Apr 2026 10:56:10 GMT |
Contributor
📊 Code Coverage Report✅ Student
✅ Teacher
✅ Pandautils
📈 Overall Average
|
Contributor
Contributor
tamaskozmer
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test plan:
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.