Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-submissions
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-submissions
Commits
049a92de
Commit
049a92de
authored
Feb 08, 2016
by
Eric Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
less obtuse mangling
parent
1838ec92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
submissions/api.py
+10
-5
No files found.
submissions/api.py
View file @
049a92de
...
...
@@ -686,13 +686,18 @@ def reset_score(student_id, course_id, item_id, clear_state=False):
)
if
clear_state
:
# sever the link between this student item and any submissions it may current have
# sever the link between this student item and any submissions it may current
ly
have
for
sub
in
student_item
.
submission_set
.
all
():
# By mangling the item_id, the course and student information remains intact for analytics
# But the submission will no longer be accessible
mangled_item
=
copy
.
deepcopy
(
sub
.
student_item
)
mangled_item
.
item_id
=
mangled_item
.
item_id
[::
-
1
]
# Reverse the identifier
mangled_item
.
save
()
# But the submission will no longer be accessible. The actual mangling will be done by appending
# "+orphaned" to the item_id (original value will be truncated to fit if needed)
orphaned_str
=
"+orphaned"
mangled_item
,
_
=
StudentItem
.
objects
.
get_or_create
(
course_id
=
student_item
.
course_id
,
student_id
=
student_item
.
student_id
,
item_id
=
student_item
.
item_id
[:
255
-
len
(
orphaned_str
)]
+
orphaned_str
,
item_type
=
student_item
.
item_type
)
sub
.
student_item
=
mangled_item
sub
.
save
(
update_fields
=
[
'student_item'
])
...
...
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