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
c9bbc542
Commit
c9bbc542
authored
Feb 22, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rerandomize per_student/always/never tested and working
--HG-- branch : pmitros-rerandomize
parent
c202d550
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
courseware/capa/capa_problem.py
+6
-2
courseware/modules/capa_module.py
+1
-1
No files found.
courseware/capa/capa_problem.py
View file @
c9bbc542
...
...
@@ -61,6 +61,9 @@ class LoncapaProblem(object):
self
.
done
=
False
self
.
filename
=
filename
if
seed
!=
None
:
self
.
seed
=
seed
if
id
:
self
.
problem_id
=
id
else
:
...
...
@@ -78,13 +81,14 @@ class LoncapaProblem(object):
if
'done'
in
state
:
self
.
done
=
state
[
'done'
]
if
seed
!=
None
:
self
.
seed
=
seed
# print self.seed
# TODO: Does this deplete the Linux entropy pool? Is this fast enough?
if
not
self
.
seed
:
self
.
seed
=
struct
.
unpack
(
'i'
,
os
.
urandom
(
4
))[
0
]
# print filename, self.seed, seed
## Parse XML file
#log.debug(u"LoncapaProblem() opening file {0}".format(filename))
file_text
=
open
(
filename
)
.
read
()
...
...
courseware/modules/capa_module.py
View file @
c9bbc542
...
...
@@ -181,7 +181,7 @@ class Module(XModule):
self
.
filename
=
content_parser
.
item
(
dom2
.
xpath
(
'/problem/@filename'
))
filename
=
settings
.
DATA_DIR
+
"/problems/"
+
self
.
filename
+
".xml"
self
.
name
=
content_parser
.
item
(
dom2
.
xpath
(
'/problem/@name'
))
if
self
.
rerandomize
==
'
N
ever'
:
if
self
.
rerandomize
==
'
n
ever'
:
seed
=
1
else
:
seed
=
None
...
...
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