[Bugfix:TAGrading] Prevent Credit Stealing#12228
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12228 +/- ##
============================================
- Coverage 21.69% 21.68% -0.01%
Complexity 9617 9617
============================================
Files 268 268
Lines 36105 36109 +4
Branches 475 478 +3
============================================
Hits 7832 7832
- Misses 27802 27803 +1
- Partials 471 474 +3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Rkoester47
approved these changes
Nov 29, 2025
Contributor
Rkoester47
left a comment
There was a problem hiding this comment.
I tested the changes and can can no longer steal credit from another grader by opening and closing a graded component, nor by switching between student submissions. I tried several times on multiple different gradeables and was unable to steal credit. This seems like a solid fix for this issue, great work!
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.
Why is this Change Important & Necessary?
Fixes #12223
TAs who have not made any modifications to a grading component are receiving credit for the question just for navigating past it. This is skewing the TA grading statistics, making it difficult for instructors to keep of track of the progress of individual graders.
What is the New Behavior?
The issue was caused by the
scoreandcommentvalues in thegetGradedComponentFromDOM()function. Although the function initialized them to default values (0.0 and ''), those defaults were never reapplied when the DOM lookup failed. When the inputs were missing or empty,scoreInput.val()returned undefined, which led toparseFloat(undefined)producing NaN, and the textarea lookup returning null for comment.The fix was to explicitly reset these values to their defaults whenever the DOM returned NaN, undefined, or null, ensuring
scorealways resolves to 0.0 andcommentalways resolves to an empty string.The above issue was causing
gradedComponentsEqual()to returnfalsesince it was checking the expected0.0and''against NAN and NULL, in turn allowing graders who were on the page component but not making any changes to receive/"steal" credit.Below are the results of
gradedComponentsEqual()from before and after the fix when the user opens and closes a rubric component 2x.Before
After
What steps should a reviewer take to reproduce or test the bug or new feature?
Replicate #12223 on main. You should be able to steal credit from opening and closing the component 2x, as well as by leaving the component open, and navigating to the next student.
Automated Testing & Documentation
I don't believe we have tests for crediting graders, perhaps this should be added to
rubric_grading.spec.jsin a future PR.Other information
This is not a breaking change