Skip to content

[Bugfix:InstructorUI] Fix Gradeable JSON Boolean Fields#12160

Merged
bmcutler merged 2 commits intomainfrom
gradeable-peer-grading-value
Nov 12, 2025
Merged

[Bugfix:InstructorUI] Fix Gradeable JSON Boolean Fields#12160
bmcutler merged 2 commits intomainfrom
gradeable-peer-grading-value

Conversation

@RyanStyron
Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Fixes #12151.
As described in the issue, uploading a Gradeable JSON currently results in peer grading being enabled regardless of the assignment of the peer_component property. This bug is caused by the Gradeable construction logic not interpretting certain values in the JSON as boolean, which results in a string being parsed instead. This has now been fixed via invocation of the Utils::getBooleanValue method.

What steps should a reviewer take to reproduce or test the bug or new feature?

Download the Gradeable JSON of Bulk Upload Scanned Exam in the Sample course. Edit the JSON so that the id field is different (i.e. add _1 to the existing id) and ensure that for one of the rubric sections, peer_component is set to true and that for another it is set to false. Create a new Gradeable in the Sample course by uploading this JSON. Note how both of the rubric sections are highlighted purple (indicating peer grading).
Checkout this branch, repeat the same steps, and note how the peer grading sections are assigned properly.

@github-project-automation github-project-automation bot moved this to Seeking Reviewer in Submitty Development Oct 28, 2025
@RyanStyron RyanStyron marked this pull request as ready for review October 28, 2025 22:05
@automateprojectmangement automateprojectmangement bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Oct 28, 2025
@automateprojectmangement automateprojectmangement bot moved this from Work in Progress to Seeking Reviewer in Submitty Development Oct 28, 2025
@automateprojectmangement automateprojectmangement bot moved this from Seeking Reviewer to In Review in Submitty Development Oct 28, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 28, 2025

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.73%. Comparing base (fef0849) to head (94b7c48).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #12160   +/-   ##
=========================================
  Coverage     21.73%   21.73%           
  Complexity     9598     9598           
=========================================
  Files           268      268           
  Lines         36006    36006           
  Branches        475      475           
=========================================
  Hits           7827     7827           
  Misses        27708    27708           
  Partials        471      471           
Flag Coverage Δ
autograder 21.39% <ø> (ø)
js 2.07% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.74% <0.00%> (ø)
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
Copy Markdown
Contributor

@JManion32 JManion32 left a comment

Choose a reason for hiding this comment

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

Replicated the issue on main:

broken highlighted

On this branch, it works as expected!

fixed-highlighted

Tested using the same JSON configurations

@github-project-automation github-project-automation bot moved this from In Review to Awaiting Maintainer Review in Submitty Development Oct 29, 2025
Copy link
Copy Markdown
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 followed the steps outlined in the PR to reproduce the issue on main. As expected, all three sections of the rubric were highlighted purple for TA grading even though I had only set the first one to "True".

After repeating steps on this branch, the issue appears to be resolved. I uploaded another copy of the Bulk Exam JSON file, and now only the first section was purple as intended. Based on the description of the issue and expected outcome of this PR, the changes made seemed to have resolved the issue.

$this->setText($details['text']);
$this->setPeerComponent($details['peer_component'] ?? false);
$this->setText(Utils::getBooleanValue($details['text']));
$this->setPeerComponent(Utils::getBooleanValue($details['peer_component'] ?? false));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe that you don't need the ?? false part now, as the getBooleanValue handles null values and returns false for them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch -- will update.

@RyanStyron RyanStyron changed the title [Bugfix:InstructorUI] Properly Assign Gradeable JSON Values When Uploaded [Bugfix:InstructorUI] Fix Gradeable JSON Boolean Fields Oct 31, 2025
@RyanStyron RyanStyron moved this from Awaiting Maintainer Review to Ready to Merge in Submitty Development Nov 11, 2025
@bmcutler bmcutler merged commit a7a9028 into main Nov 12, 2025
46 of 49 checks passed
@bmcutler bmcutler deleted the gradeable-peer-grading-value branch November 12, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Uploading Gradeable JSON defaults to peer grading even when it is set to false

5 participants