-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add celery task to reset course progress for learner #34350
Conversation
c35db91
to
11f2af9
Compare
11f2af9
to
9b6a117
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @hajorg! Do you mind adding some context as to why this is being done? The link you posted is to a private page that people outside 2U cannot access.
Hi @arbrandes, the goal is to allow the ability to reset a learner's progress in a course so that they may re-attempt a course within the same run, without waiting for the next run. |
Thank you! But if this is not a pre-existing feature, I believe it should be going through the Product Review process. I can't make a ruling on whether it should or not, though: but when in doubt, we should ask the Product Working Group. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good but I have a couple suggestions, and I caught a subtle issue with how you're looking up blocks.
Also, a general comment about the tests: What you have is good, but I think you should also add some checks / tests for the downstream effects of the task. At the very minimum you should mock or wrap reset_student_attempts and
- for the success test, assert that it was called for all "leaf" blocks in your course
- for the Not Found test, assert that it was stilled called for each block despite the fact that there were errors
- for the error case, assert that it was not called for any blocks
- I'd add another test where an Exception is raised by a call to reset_student_attempts, and you can assert that no blocks after the error was raised were attempted to be reset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some questions around the product side of this that need to be worked out so hold off on merging, but code-wise I'm approving this
One last comment - just for completeness, I'd love if you would change one of the problem blocks to be a block that has a different "category", even if one was a "video" rather than a problem, just so the tests demonstrate that we are resetting all leaf nodes |
Based on conversation in openedx/platform-roadmap#331
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. |
Description
This PR uses celery task to reset learner's course progress
Supporting information
Roadmap issue: openedx/platform-roadmap#331
Celery task to reset individual learner