Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
67b128df
Commit
67b128df
authored
Feb 23, 2016
by
Eric Fischer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11625 from edx/efischer/revert_ora_release
Revert "Inform openassessment to clear submission"
parents
bf5d2034
5e380305
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
19 deletions
+6
-19
lms/djangoapps/instructor/enrollment.py
+6
-19
No files found.
lms/djangoapps/instructor/enrollment.py
View file @
67b128df
...
...
@@ -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
(),
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment