[Feature:InstructorUI] Grading Open Date Constraints#12783
Conversation
If grade start date after grade due date, display warning message
If the start date is after the due date, it will show the warning
Removed constraints for the grading open date.
Fixed open to grading now button and made sure the gradable is listed under the right category
Added cypress tests for both lab gradeables and electronic gradeables.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12783 +/- ##
============================================
- Coverage 21.66% 21.51% -0.16%
- Complexity 9754 9803 +49
============================================
Files 268 268
Lines 36456 37338 +882
Branches 487 490 +3
============================================
+ Hits 7899 8033 +134
- Misses 28074 28819 +745
- Partials 483 486 +3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
QuackHonk
left a comment
There was a problem hiding this comment.
The code itself looks good. One bug I noticed was that when I changed a date to be out of bounds and tried to change it back, the warning and the red highlight stays even if its consistent. I'm not sure if this issue relates to your commits or to the new merges because I was receiving a similar issue when I tested on the main.
In the example below I changed the grading due date to be in the year 2226, then I changed the inquiry dates to the year 9999, then I switched the grading due date back to 2026. Strange

OS: Windows
Browser: Chrome
Farhanxikram
left a comment
There was a problem hiding this comment.
I did a functionality review and didn't find any issues, and as far as I could tell, prior functionality remained intact, and changes are as specified in the pr
Os: Windows
Browser:: Google
Rkoester47
left a comment
There was a problem hiding this comment.
I checked over the code and functionality for this PR and it all looks good to me. The changes all behaved as described and no functionality seems to have been impacted. I was able to change the Grading Open date, and the warning appeared when appropriate. The gradeable moved to the appropriate category, and I was still not able to access future/beta gradeables via a link with a student account.
Made sure that gradeables can be viewed by the proper access levels when grading due date is in the past and all other dates are in the future.

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?
Partially addresses #12349
This PR specifically removes all constraints for the Grading Open 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.
What is the New Behavior?
Now, the Grading Open 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 Open date is set to the future, the lower date wins when assigning a gradeable status on the gradeables page.
Previously, the manual grading open date had a constraint. It could not be set after the manual grading due 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 Open date is ahead of one of the dates below it, such as the grading due 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 Open date is in the future, and the grading due date is in the past, the grading due date wins and the assignment shows as grading in progress with a red grade box signaling that it is past due. This is also true for all dates below the grading start 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 start 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 grading due date is in the past, and grading start date in the future, then the assignment should show under GRADING, not under FUTURE, not under BETA, not under OPEN, and not under CLOSED. The grade box may also show up as red if it is an electronic gradeable and there are ungraded assignments.
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), or GRADING (Grading in progress), 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: While testing, the only dates that should have full free access to be changed without causing any constraint issues currently are the grade inquiry dates, the ta view date, the open submission date, the due date, and the grading start date. The rest of the dates still have constraints on them.
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 Start 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 remove 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.