edx-platform
edx-platform copied to clipboard
feat: due date reminder
Description
This PR adds a command to send reminder emails for self-paced courses with relative due dates enabled. The command takes in a argument due-in
which allows us to send reminders for subsections due within specified number of days.
Testing instructions
- Setup master devstack
- Enable SelfPacedRelativeDateConfig globally.
- Add waffle flag
studio.custom_relative_dates
to allow adding custom relative dates to graded subsections. - Start LMS and CMS using
make {lms,cms}-up
. - Run
make lms-migrate
to add enqueue and deliver columns for new schedule. - Open Schedules config and add an entry for
localhost:18000
site and enable all flags. - Go to demo course in studio and update start date to some date in past (around 2 months) and change pacing to
self-paced
(for this you might need to update start_date to some date in future and revert back). - Login to LMS using
edx
user and enroll in the demo course. - Go to schedules and update edx user's start_date to some recent date within the past one week.
- Open LMS shell using
make lms-shell
and run below command, play with date and due-in parameter and see the output. It should print email with subsections having due date falling within the days passed viadue-in
parameter.python manage.py lms send_course_due_date_reminders localhost:18000 --due-in 7
- Also, it should only send email if
SelfPacedRelativeDateConfig
is enabled and if course pacing is set toself-paced
. - Re-run the command by updating
Due in
field for a graded subsection:
Example output:
------- EMAIL -------
To: [email protected]
From: Demonstration Course
Subject: Important course due dates coming up
Body:
Hi there! We wanted to remind you of some important due dates coming up for your course, Demonstration Course, that you need to be aware of. The due dates are coming up in the following subsections:
* Lesson 1 - Getting Started (28 Jul 2023)
* Homework - Question Styles (07 Aug 2023)
* Lesson 2 - Let's Get Interactive! (02 Aug 2023)
* Homework - Labs and Demos (02 Aug 2023)
* Homework - Essays (02 Aug 2023)
* Lesson 3 - Be Social (08 Aug 2023)
* Homework - Find Your Study Buddy (08 Aug 2023)
* More Ways to Connect (08 Aug 2023)
Happy learning!
------- END -------
Deadline
"None" if there's no rush, or provide a specific date or event (and reason) if there is one.
Other information
Doubts:
- Why is access_duration limited to max duration of 18 weeks?
- Copied relative week due date logic from course_date_signals handler. It sets minimum of 1 week for each section. Not sure if it is valid.
- Some tests in schedules app are not running due to invalid condition in skip check. Many tests fail as soon as we fix the condition, we probably cannot fix it now but creating a issue might help.
# Currently it is set to. 'openedx.core.djangoapps.schedules.apps.SchedulesConfig' in settings.INSTALLED_APPS # Should be below as it is set this way in common settings. 'openedx.core.djangoapps.schedules' in settings.INSTALLED_APPS
Private-ref: BB-7407
Thanks for the pull request, @navinkarkera! 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.
This is currently a draft pull request. When it is ready for our review and all tests are green, click "Ready for Review", or remove "WIP" from the title, as appropriate.
Sandbox destroy request received.
Hi @navinkarkera and @Agrendalath! Just checking to see if this is still in progress?
@mphilbrick211, this has already been implemented, but we must pass it through the client's QA. This should be resumed around March. It would be great to get your product review in the meantime.
Thanks @Agrendalath . With the info provided here, this seems like a nice addition. I'd like to be able to see the whole workflow in action, from adding the due date in the graded subsection to creating and sending an email that pulls the query. Is it possible to play with it in your sandbox?
@jmakowski1123, thanks for checking. Of course, we will create a sandbox once we move forward with the implementation after the initial QA. We're discussing adding more features, like opting out of these emails for individual courses. However, we had some reprioritizations with the client, so we are still trying to determine when to resume this PR.
Ok, let's keep this on hold then until it becomes a priority, and then can continue reviewing once you have specs for the new features.