feat: add instructor task for async batch enrollment#37216
Conversation
|
Thanks for the pull request, @BryanttV! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
c8afbaf to
be63ae3
Compare
ab47689 to
b9f4211
Compare
|
We can use something like this to create the users: |
|
hi @BryanttV! Bumping this for you. |
b9f4211 to
d2fb230
Compare
|
Thanks for your review @efortish! I will be working on implementing the unit tests. |
192e8c5 to
3e4728a
Compare
|
@BryanttV @mariajgrimaldi hi there! is this still in progress? |
Final ping on this one, @BryanttV! |
|
@mphilbrick211, in my understanding, @BryanttV would continue with this PR. @BryanttV, could you update the PR so it can receive a proper review? ✨ |
279fbb5 to
8851b1e
Compare
|
Hi @MaferMazu, thanks for the review! I've addressed your comments. Could you take another look? |
|
@BryanttV thanks for addressing my comments. |
337d3dd to
479ff5c
Compare
|
Hi @MaferMazu! The checks passed 💯 Can we proceed with the merge? |
Description
This PR introduces asynchronous support for Batch Enrollment/Unenrollment in the Instructor Dashboard. The goal is to address scalability limitations of the current synchronous process, which is prone to timeouts when handling large groups of learners.
Motivation
Currently, batch enrollment/unenrollment is only available in synchronous mode. For large enroll/unenroll lists, this process may time out, causing failures and reliability issues. With this change, instructors can optionally select an async mode, which processes enrolls/unenrolls in the background, avoids timeouts, and provides better progress tracking and notifications.
Implementation Details
Added a new checkbox "Process asynchronously" in the Batch Enrollment UI (unchecked by default).
If async mode is selected:
If async mode is not selected, the current synchronous behavior remains unchanged.
Screenshots
Tooltip
Informative user message
Body email
CSV report
CSV content
Testing instructions
Using a Tutor environment:
Mount
edx-platformwith the changes from this PR. I recommend usingtutor local.Build the openedx image with
tutor images build openedx.Create a course.
Create some users (recommended: +100).
Navigate to Instructor Dashboard > Membership > Batch Enrollment.
Add the usernames or emails in the text area.
Check the Process asynchronously checkbox.
You should see an info message in the interface indicating that the process has started.
When the process finishes:
Deadline
None
Other Information
I found a bug introduced in this PR. The user used in the
create_manual_enrollment_auditmethod should be therequest.user, not theidentified_user.https://github.com/openedx/edx-platform/blob/405282c17efcdb19f578ed553f728c9218a271a4/lms/djangoapps/instructor/views/api.py#L896-L898
I also fixed that bug in the current PR.