From 73fa3190cdd9cbad0abda3f4d5f902b68c02186c Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Mon, 22 Feb 2016 17:32:44 -0500 Subject: [PATCH 1/2] Revert "Inform openassessment to clear submission" This reverts commit 920cc3d22275b3fabf08e5b268c5d591b9097394. --- lms/djangoapps/instructor/enrollment.py | 25 ++++++------------------- requirements/edx/github.txt | 4 ++-- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/lms/djangoapps/instructor/enrollment.py b/lms/djangoapps/instructor/enrollment.py index 2471397322..775809c350 100644 --- a/lms/djangoapps/instructor/enrollment.py +++ b/lms/djangoapps/instructor/enrollment.py @@ -219,8 +219,6 @@ def reset_student_attempts(course_id, student, module_state_key, delete_module=F submissions.SubmissionError: unexpected error occurred while resetting the score in the submissions API. """ - user_id = anonymous_id_for_user(student, course_id) - submission_cleared = False try: # A block may have children. Clear state on children first. block = modulestore().get_item(module_state_key) @@ -231,27 +229,16 @@ def reset_student_attempts(course_id, student, module_state_key, delete_module=F except StudentModule.DoesNotExist: # If a particular child doesn't have any state, no big deal, as long as the parent does. pass - if delete_module: - # Some blocks (openassessment) use StudentModule data as a key for internal submission data. - # Inform these blocks of the reset and allow them to handle their data. - clear_student_state = getattr(block, "clear_student_state", None) - if callable(clear_student_state): - clear_student_state( - user_id=user_id, - course_id=unicode(course_id), - item_id=unicode(module_state_key) - ) - submission_cleared = True except ItemNotFoundError: log.warning("Could not find %s in modulestore when attempting to reset attempts.", module_state_key) - # Reset the student's score in the submissions API, if xblock.clear_student_state has not done so already. - # TODO: Remove this once we've finalized and communicated how xblocks should handle clear_student_state - # and made sure that other xblocks relying on the submission api understand this is going away. - # We need to do this before retrieving the `StudentModule` model, because a score may exist with no student module. - if delete_module and not submission_cleared: + # Reset the student's score in the submissions API + # Currently this is used only by open assessment (ORA 2) + # We need to do this *before* retrieving the `StudentModule` model, + # because it's possible for a score to exist even if no student module exists. + if delete_module: sub_api.reset_score( - user_id, + anonymous_id_for_user(student, course_id), course_id.to_deprecated_string(), module_state_key.to_deprecated_string(), ) diff --git a/requirements/edx/github.txt b/requirements/edx/github.txt index 653a04917b..66adb12255 100644 --- a/requirements/edx/github.txt +++ b/requirements/edx/github.txt @@ -77,8 +77,8 @@ git+https://github.com/edx/XBlock.git@xblock-0.4.4#egg=XBlock==0.4.4 -e git+https://github.com/edx/event-tracking.git@0.2.1#egg=event-tracking==0.2.1 -e git+https://github.com/edx/django-splash.git@v0.2#egg=django-splash==0.2 -e git+https://github.com/edx/acid-block.git@e46f9cda8a03e121a00c7e347084d142d22ebfb7#egg=acid-xblock --e git+https://github.com/edx/edx-ora2.git@0.2.8#egg=ora2==0.2.8 --e git+https://github.com/edx/edx-submissions.git@0.1.4#egg=edx-submissions==0.1.4 +-e git+https://github.com/edx/edx-ora2.git@0.2.7#egg=ora2==0.2.7 +-e git+https://github.com/edx/edx-submissions.git@0.1.3#egg=edx-submissions==0.1.3 git+https://github.com/edx/ease.git@release-2015-07-14#egg=ease==0.1.3 git+https://github.com/edx/i18n-tools.git@v0.2#egg=i18n-tools==v0.2 git+https://github.com/edx/edx-val.git@0.0.9#egg=edxval==0.0.9 From 5e380305efaaa25a10b2332620d08bb91803dd3e Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Tue, 23 Feb 2016 10:06:13 -0500 Subject: [PATCH 2/2] keep version bumps --- requirements/edx/github.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/edx/github.txt b/requirements/edx/github.txt index 66adb12255..653a04917b 100644 --- a/requirements/edx/github.txt +++ b/requirements/edx/github.txt @@ -77,8 +77,8 @@ git+https://github.com/edx/XBlock.git@xblock-0.4.4#egg=XBlock==0.4.4 -e git+https://github.com/edx/event-tracking.git@0.2.1#egg=event-tracking==0.2.1 -e git+https://github.com/edx/django-splash.git@v0.2#egg=django-splash==0.2 -e git+https://github.com/edx/acid-block.git@e46f9cda8a03e121a00c7e347084d142d22ebfb7#egg=acid-xblock --e git+https://github.com/edx/edx-ora2.git@0.2.7#egg=ora2==0.2.7 --e git+https://github.com/edx/edx-submissions.git@0.1.3#egg=edx-submissions==0.1.3 +-e git+https://github.com/edx/edx-ora2.git@0.2.8#egg=ora2==0.2.8 +-e git+https://github.com/edx/edx-submissions.git@0.1.4#egg=edx-submissions==0.1.4 git+https://github.com/edx/ease.git@release-2015-07-14#egg=ease==0.1.3 git+https://github.com/edx/i18n-tools.git@v0.2#egg=i18n-tools==v0.2 git+https://github.com/edx/edx-val.git@0.0.9#egg=edxval==0.0.9