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
cc9f9a9d
Commit
cc9f9a9d
authored
Jul 18, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
queuekey generated from LoncapaProblem seed + system time
parent
84eb3efa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
common/lib/capa/capa/responsetypes.py
+8
-2
No files found.
common/lib/capa/capa/responsetypes.py
View file @
cc9f9a9d
...
...
@@ -8,6 +8,7 @@ Used by capa_problem.py
'''
# standard library imports
import
hashlib
import
inspect
import
json
import
logging
...
...
@@ -16,6 +17,7 @@ import numpy
import
random
import
re
import
requests
import
time
import
traceback
import
abc
...
...
@@ -808,8 +810,12 @@ class CodeResponse(LoncapaResponse):
xmlstr
=
etree
.
tostring
(
self
.
xml
,
pretty_print
=
True
)
header
=
{
'return_url'
:
self
.
system
.
xqueue_callback_url
}
queuekey
=
random
.
randint
(
0
,
2
**
32
-
1
)
header
.
update
({
'queuekey'
:
queuekey
})
h
=
hashlib
.
md5
()
if
self
.
system
is
not
None
:
h
.
update
(
str
(
self
.
system
.
get
(
'seed'
)))
h
.
update
(
str
(
time
.
time
()))
queuekey
=
int
(
h
.
hexdigest
(),
16
)
header
.
update
({
'queuekey'
:
queuekey
})
payload
=
{
'xqueue_header'
:
json
.
dumps
(
header
),
# TODO: 'xqueue_header' should eventually be derived from a config file
'xml'
:
xmlstr
,
...
...
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