Skip to content

[Bugfix:TAGrading] Prevent Credit Stealing#12228

Merged
bmcutler merged 2 commits intomainfrom
credit-stealing-fix
Dec 1, 2025
Merged

[Bugfix:TAGrading] Prevent Credit Stealing#12228
bmcutler merged 2 commits intomainfrom
credit-stealing-fix

Conversation

@JManion32
Copy link
Contributor

@JManion32 JManion32 commented Nov 29, 2025

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 score and comment values in the getGradedComponentFromDOM() 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 to parseFloat(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 score always resolves to 0.0 and comment always resolves to an empty string.

The above issue was causing gradedComponentsEqual() to return false since it was checking the expected 0.0 and '' 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

image

After

image

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.js in a future PR.

Other information

This is not a breaking change

@codecov
Copy link

codecov bot commented Nov 29, 2025

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.68%. Comparing base (b14e9eb) to head (40a2f5a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
autograder 21.39% <ø> (ø)
js 2.07% <0.00%> (-0.01%) ⬇️
migrator 100.00% <ø> (ø)
php 20.68% <ø> (ø)
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 90.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@Rkoester47 Rkoester47 left a comment

Choose a reason for hiding this comment

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

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!

@github-project-automation github-project-automation bot moved this from Seeking Reviewer to Awaiting Maintainer Review in Submitty Development Nov 29, 2025
@bmcutler bmcutler merged commit 9ce63f0 into main Dec 1, 2025
26 checks passed
@bmcutler bmcutler deleted the credit-stealing-fix branch December 1, 2025 06:00
@github-project-automation github-project-automation bot moved this from Awaiting Maintainer Review to Done in Submitty Development Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Visiting an already graded component results in "stealing credit" from the original grader.

3 participants