Skip to content

[Bugfix:Submission] Fix red button for all-hidden test cases#12648

Merged
bmcutler merged 6 commits into
Submitty:mainfrom
Jyz922:fix/hidden-testcase-button-color
Apr 7, 2026
Merged

[Bugfix:Submission] Fix red button for all-hidden test cases#12648
bmcutler merged 6 commits into
Submitty:mainfrom
Jyz922:fix/hidden-testcase-button-color

Conversation

@Jyz922

@Jyz922 Jyz922 commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

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_hidden to store the number of non-hidden, non-extra-credit points
Updated the condition to explicitly handle the case where $total_non_hidden == 0

Replaced the original check with a clearer structure:

  • if no visible points → treat as gray
  • otherwise → fall back to the existing ≥ 50% logic

Testing

Tested locally with:

  • all test cases hidden → button is gray
  • visible test cases, score ≥ 50% → button is gray
  • visible test cases, score < 50% → button is red
  • no autograding points → button is gray

Fixes #12637

@codecov

codecov Bot commented Mar 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 21.64%. Comparing base (d7b82e3) to head (ceeae9a).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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           
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.04% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.66% <ø> (ø)
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

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.

@Jyz922

Jyz922 commented Mar 27, 2026

Copy link
Copy Markdown
Contributor Author

Updated the condition to use strict comparisons (=== / !==) instead of loose comparisons to satisfy PHP lint requirements.
CI should now pass without the equality check errors.

@Christian2147 Christian2147 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@Jyz922

Jyz922 commented Mar 28, 2026

Copy link
Copy Markdown
Contributor Author

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.

@Jyz922

Jyz922 commented Mar 28, 2026

Copy link
Copy Markdown
Contributor Author

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!

@Jyz922

Jyz922 commented Mar 28, 2026

Copy link
Copy Markdown
Contributor Author

I looked into the remaining Cypress failures and they appear to be unrelated to this PR. The current failures are in leaderboard_gradeable.spec.js and docker_ui.spec.js, but my fix only updates the late resubmit button logic in NavigationView.php. I’ve also updated the branch with the latest main in case the failures were due to the branch being out of date.
Screenshot 2026-03-28 at 4 11 23 PM

@Christian2147

Copy link
Copy Markdown
Contributor

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.

@Jyz922

Jyz922 commented Mar 29, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! That makes sense, I’ll wait for the rerun results. Let me know if anything on my side needs to be adjusted.

@Christian2147 Christian2147 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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!

@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Awaiting Maintainer Review in Submitty Development Mar 31, 2026
@Jyz922

Jyz922 commented Mar 31, 2026

Copy link
Copy Markdown
Contributor Author

Thanks a lot, appreciate it!

@bmcutler bmcutler moved this from Awaiting Maintainer Review to Ready to Merge in Submitty Development Apr 3, 2026
@bmcutler bmcutler moved this from Ready to Merge to Awaiting Maintainer Review in Submitty Development Apr 3, 2026
@Christian2147
Christian2147 requested a review from bmcutler April 4, 2026 14:13
@automateprojectmangement automateprojectmangement Bot moved this from Awaiting Maintainer Review to In Review in Submitty Development Apr 4, 2026
@bmcutler
bmcutler merged commit b2db10a into Submitty:main Apr 7, 2026
48 of 49 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in Submitty Development Apr 7, 2026
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.

Late resubmit button is red when all test cases are hidden

3 participants