-
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: api function to delete learner's course grades #34410
Conversation
43f826b
to
36f3895
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.
Some suggestions
course_id: The id of the course associated with the desired grade | ||
user_id: The user associated with the desired grade | ||
""" | ||
try: |
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.
nice
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.
Functionally it's good, just a couple comments on the tests and error handling
lms/djangoapps/grades/models.py
Outdated
@classmethod | ||
def delete_subsection_grades_for_learner(cls, user_id, course_key): | ||
""" | ||
Clears Subsection grade override for a learner in a course |
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.
Clears Subsection grade override for a learner in a course | |
Clears Subsection grades and overrides for a learner in a course |
@@ -187,51 +187,56 @@ def test_clear_user_course_grades(self): | |||
self.subsection.location | |||
) | |||
|
|||
def test_clear_wrong_user_course_grades(self): | |||
wrong_user = UserFactory() | |||
def _create_and_get_user_grades(self, user_id): |
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.
Nice refactor
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 creates a function to delete learner's course grades as a part of reset. See https://2u-internal.atlassian.net/browse/AU-1912
Supporting information
openedx/platform-roadmap#331