feat: warn when relative dates are past due and can't be shifted
Description
When the course_experience.relative_dates_disable_reset flag is set to true in self paced courses, warnings that otherwise allowed learners to shift deadlines don't appear. This PRs shows warnings in this case, with the sole difference of not allowing to shift dates.
Useful information to include:
- Which edX user roles will this change impact?: Learner
Testing instructions
-
Add the following Waffle Flags (with
Everyone: Yes):studio.custom_relative_datescourse_experience.relative_datescourse_experience.relative_dates_disable_reset
-
Go to Course_Date_Signals -> Self paced relative dates configs and add a config with
Enabled: Yes. -
Create a new course in Studio.
-
Go to
Settings -> Schedule & Detailsand set the pacing toSelf-Paced. Click "Save Changes". -
Set a past
Course Start Date. Click "Save Changes". -
Create a new subsection in the course. Mark it as graded as "Homework" and set "Due in" to 1 week.
-
Create a Problem Block (e.g., Checkboxes) in the subsection and publish it.
-
Log in as an
audituser and enroll yourself in a course. -
As an admin, go to Schedules -> Schedules and find the schedule for the
audituser in this new course. Change theStart dateto a year ago andSave. -
As an
audituser, visit the Problem and check that there's a warning about not being able to shift the relative dates (see screenshot bellow), that theSubmitbutton can no longer be enabled, and that should be a "Past due" pill near the due date above this Problem. -
You should also see these deadlines on the Course Outline page.
-
Set the
course_experience.relative_dates_disable_resettoNo -
Revisit the Problem with the
audituser. Check that the warning now lets you shift the relative dates. (second screenshot)
Screenshots
course_experience.relative_dates_disable_reset set to false:
course_experience.relative_dates_disable_reset set to true (old behavior, but still good to check):
Not past due date:
Private-ref: BB-8542
Thanks for the pull request, @DanielVZ96! Please note that it may take us up to several weeks or months to complete a review and merge your PR.
Feel free to add as much of the following information to the ticket as you can:
- supporting documentation
- Open edX discussion forum threads
- timeline information ("this must be merged by XX date", and why that is)
- partner information ("this is a course on edx.org")
- any other information that can help Product understand the context for the PR
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.
Please let us know once your PR is ready for our review and all tests are green.
Tests failed with: Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
@DanielVZ96 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.
2U Release Notice: This PR has been deployed to the edX production environment.