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
1dcaf21f
Commit
1dcaf21f
authored
Aug 25, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send idhash
parent
9734347c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
common/lib/capa/capa/responsetypes.py
+9
-1
common/lib/capa/capa/xqueue_interface.py
+2
-5
lms/djangoapps/courseware/module_render.py
+3
-1
No files found.
common/lib/capa/capa/responsetypes.py
View file @
1dcaf21f
...
...
@@ -16,6 +16,7 @@ import numpy
import
random
import
re
import
requests
import
time
import
traceback
import
hashlib
import
abc
...
...
@@ -1124,7 +1125,9 @@ class CodeResponse(LoncapaResponse):
qinterface
=
self
.
system
.
xqueue
[
'interface'
]
# Generate header
queuekey
=
xqueue_interface
.
make_hashkey
(
str
(
self
.
system
.
seed
)
+
self
.
answer_id
)
queuekey
=
xqueue_interface
.
make_hashkey
(
str
(
self
.
system
.
seed
)
+
str
(
time
.
time
())
+
str
(
self
.
system
.
xqueue
[
'student_identifier'
])
+
self
.
answer_id
)
xheader
=
xqueue_interface
.
make_xheader
(
lms_callback_url
=
self
.
system
.
xqueue
[
'callback_url'
],
lms_key
=
queuekey
,
queue_name
=
self
.
queue_name
)
...
...
@@ -1137,6 +1140,11 @@ class CodeResponse(LoncapaResponse):
contents
=
self
.
payload
.
copy
()
# Anonymized student identifier to the external grader
student_identifier_hash
=
xqueue_interface
.
make_hashkey
(
self
.
system
.
xqueue
[
'student_identifier'
])
student_info
=
{
'student_identifier_hash'
:
student_identifier_hash
}
contents
.
update
({
'student_info'
:
json
.
dumps
(
student_info
)})
# Submit request. When successful, 'msg' is the prior length of the queue
if
is_list_of_files
(
submission
):
contents
.
update
({
'student_response'
:
''
})
# TODO: Is there any information we want to send here?
...
...
common/lib/capa/capa/xqueue_interface.py
View file @
1dcaf21f
...
...
@@ -5,20 +5,17 @@ import hashlib
import
json
import
logging
import
requests
import
time
log
=
logging
.
getLogger
(
'mitx.'
+
__name__
)
def
make_hashkey
(
seed
=
None
):
def
make_hashkey
(
seed
):
'''
Generate a string key by hashing
'''
h
=
hashlib
.
md5
()
if
seed
is
not
None
:
h
.
update
(
str
(
seed
))
h
.
update
(
str
(
time
.
time
()))
h
.
update
(
str
(
seed
))
return
h
.
hexdigest
()
...
...
lms/djangoapps/courseware/module_render.py
View file @
1dcaf21f
...
...
@@ -217,7 +217,9 @@ def _get_module(user, request, location, student_module_cache, course_id, positi
xqueue
=
{
'interface'
:
xqueue_interface
,
'callback_url'
:
xqueue_callback_url
,
'default_queuename'
:
xqueue_default_queuename
.
replace
(
' '
,
'_'
)}
'default_queuename'
:
xqueue_default_queuename
.
replace
(
' '
,
'_'
),
'student_identifier'
:
user
.
id
,
}
def
inner_get_module
(
location
):
"""
...
...
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