Skip to content

[Feature:InstructorUI] Grading Due Date Constraints#12841

Merged
bmcutler merged 11 commits into
mainfrom
grading-due-date-constraints
Jun 15, 2026
Merged

[Feature:InstructorUI] Grading Due Date Constraints#12841
bmcutler merged 11 commits into
mainfrom
grading-due-date-constraints

Conversation

@Christian2147

Copy link
Copy Markdown
Contributor

CAUTION: Since this PR removes a date constraint, if it is installed on a production system and then needs to be reverted after a moderate period of time where gradeables might have been created/edited and taking advantage of the more flexible date settings, rolling back / reverting the change might fail.

Why is this Change Important & Necessary?

Fixes #12349
Fixes #12204
Fixes #10872

This PR specifically removes all constraints for the Grading Due date for gradeables. This is important and necessary because instructors felt that the current UI for setting dates on gradeables was confusing, and they want to have more freedom over what dates they set for gradeables, even if they are invalid, since a lot of those dates may not matter for the specific class or assignment.

Since this is the last date constraint to remove, this PR also fixes and closes any previous issues relating to date constraints.

What is the New Behavior?

Now, the Grading Due date has no constraints, it can be set to whatever date regardless of other dates. When one of the lower dates is set to before the present day and the Grading Due date is set to the future, the lower date wins when assigning a gradeable status on the gradeables page.

Previously, the manual grading due date had a constraint. It could not be set after the manual grades released date, otherwise its box would turn red and changes would fail to save. The photo below shows a previous example of this constraint:
{CE0553BC-AD54-4D4C-A77C-EAD069751FDB}

Now, when the Manual Grading Due date is ahead of one of the dates below it, such as the grades released date, or if any other dates are conflicting with each other, it will display messages/warnings like the ones shown here:
{3AB5C21F-2C0D-4559-89F2-AAC4E6122DDF}

Additionally, when the Grading Due date is in the future, and the grades released date is in the past, the grades released date wins and the assignment shows under grades available. This is also true for all dates below the grading due date.

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

Log in as instructor. Go to the sample course, try editing all gradeables and try changing their grading due date in all different combinations. Make sure that not only can the date be changed to any valid date, but also that the listing of the gradeable on the gradeables page is valid. For example, if grades released date is in the past, and grading due date in the future, then the assignment should show under GRADED, not under FUTURE, not under BETA, not under OPEN, not under CLOSED, and not under GRADING.

Secondly, On the gradeable page, make sure all the buttons are visible and function properly. For example, if the assignment shows as OPEN, CLOSED (past due), GRADING (Grading in progress), or GRADED (Grades available), all appropriate buttons should be visible and should function like normal.

Finally, go to a gradeable labeled FUTURE and a gradeable labeled BETA and try to copy the link. Then log out and log in as a student and try to paste the link. You should NOT be able to access the gradeable. If you can, please report it immediately.

Note: At this point, there should be NO dates with constraints on them. You should be able to freely changes all dates to any valid date regardless of other dates. If there are still constraints, report it.

Automated Testing & Documentation

This feature is sufficiently tested by unit tests and cypress tests. Cypress tests have been added to ensure that the gradables are visible to the proper users when the Grading Due date is changed along with the other dates, especially in ways that would previously violate a constraint. I have also added proper tests for lab gradeables along with regular electronic gradeables.

Other information

This is not a breakage change.
This PR does include a migration that removes a date constraint from the database, which may not be reversable.
Link hijacking might be a security concern with this PR and should be tested. Ensure that ONLY instructors have access to FUTURE gradeables and instructors and TAs/Mentors have access to BETA gradeables.

Added warning message when grades are released before grading is due.
If grades released is before grading due, warning shows
Made sure grade release date is checked before showing warning
DB migration applied to remove Db constraint for grade due date having to be before grade release date.
Removed PHP constraint for grade due date and got rid of all unnecessary constraint code
Made sure that gradeables are being properly viewed based on their dates.
Added more cypress tests for gradeable dates, specifically to test the grades released date.
@codecov

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.49%. Comparing base (b9135e9) to head (919ecec).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #12841      +/-   ##
============================================
- Coverage     21.64%   21.49%   -0.15%     
+ Complexity     9861     9837      -24     
============================================
  Files           268      268              
  Lines         36920    36838      -82     
  Branches        495      495              
============================================
- Hits           7990     7919      -71     
+ Misses        28439    28428      -11     
  Partials        491      491              
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.01% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.53% <0.00%> (-0.18%) ⬇️
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.

This previously used Gradeable::date_validated_properties which has now been removed.
These phpstan errors have now been fixed, they are not necessary anymore.
@github-actions github-actions Bot added the Abandoned PR - Needs New Owner No activity on PR for more than 2 weeks -- seeking new owner to complete label May 20, 2026

@bmcutler bmcutler left a comment

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.

Changes look good (but I did not test manually)

@github-project-automation github-project-automation Bot moved this from In Review to Awaiting Maintainer Review in Submitty Development Jun 8, 2026
@github-actions github-actions Bot removed the Abandoned PR - Needs New Owner No activity on PR for more than 2 weeks -- seeking new owner to complete label Jun 9, 2026
@bmcutler
bmcutler merged commit d0682c2 into main Jun 15, 2026
24 of 26 checks passed
@bmcutler
bmcutler deleted the grading-due-date-constraints branch June 15, 2026 05:46
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.

Gradeable Date Constriants Gradeable Dates Bug Crash on Date Inequality bug

2 participants