[Bugfix:Submission] Fix red button for all-hidden test cases#12648
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12648 +/- ##
=========================================
Coverage 21.64% 21.64%
Complexity 9654 9654
=========================================
Files 268 268
Lines 36244 36244
Branches 487 487
=========================================
Hits 7845 7845
Misses 27916 27916
Partials 483 483
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
…trict comparison.
|
Updated the condition to use strict comparisons ( |
Christian2147
left a comment
There was a problem hiding this comment.
I tested this on my end and it looks good! The button is now gray when resubmit is allowed, all test cases are hidden, and the assignment is past due. The only issue is your CI tests are failing. (Do not worry about CSS Lint, that is failing on main), but the rest you should be able to fix. Once those are fixed, I can approve your PR.
|
Thanks for testing and the feedback! I’ve fixed the remaining PHP lint issues, so the checks should now pass. Please let me know if there’s anything else I should update. |
|
Hi, all checks should be fixed now. It looks like the remaining workflows are waiting for approval. Please let me know if anything else is needed. Thanks! |
|
Thank you for looking at them, I will take a close look as to what the issue is after I finish re rerunning them. This might be an issue with main, and sometimes the tests need to be rerun. |
|
Thanks! That makes sense, I’ll wait for the rerun results. Let me know if anything on my side needs to be adjusted. |
Christian2147
left a comment
There was a problem hiding this comment.
It seems like these are either one time issues or existing CI test issues on main. I tested the PR again and it looks good, as a result, I will approve it. Good job!
|
Thanks a lot, appreciate it! |

Description
Fixes an issue where the "Late Resubmit" button appears red when all test cases are hidden.
Right now, the button only turns gray if there are no autograding points, or if there are visible test cases and the score is at least 50%. When all test cases are hidden, the total visible points is 0, so neither condition applies and the button stays red.
This change treats the "all test cases hidden" case the same as having no visible grading information, and sets the button to gray.
Changes
Used a new local variable
$total_non_hiddento store the number of non-hidden, non-extra-credit pointsUpdated the condition to explicitly handle the case where
$total_non_hidden == 0Replaced the original check with a clearer structure:
Testing
Tested locally with:
Fixes #12637