[Feature:InstructorUI] Grading Due Date Constraints#12841
Merged
Conversation
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 Report❌ Patch coverage is Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This previously used Gradeable::date_validated_properties which has now been removed.
These phpstan errors have now been fixed, they are not necessary anymore.
bmcutler
approved these changes
Jun 8, 2026
bmcutler
left a comment
Member
There was a problem hiding this comment.
Changes look good (but I did not test manually)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:

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:

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.