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
4322b838
Commit
4322b838
authored
Apr 01, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added additional comments
parent
f90e29ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
common/lib/xmodule/xmodule/tests/test_capa_module.py
+10
-3
No files found.
common/lib/xmodule/xmodule/tests/test_capa_module.py
View file @
4322b838
...
...
@@ -862,9 +862,9 @@ class CapaModuleTest(unittest.TestCase):
def
test_random_seed_no_change
(
self
):
rerandomize_options
=
[
'never'
,
'per_student'
,
'always'
,
'onreset'
]
for
rerandomize
in
rerandomize_options
:
# Run the test for each possible rerandomize value
for
rerandomize
in
[
'never'
,
'per_student'
,
'always'
,
'onreset'
]:
module
=
CapaFactory
.
create
(
rerandomize
=
rerandomize
)
# Get the seed
...
...
@@ -873,6 +873,8 @@ class CapaModuleTest(unittest.TestCase):
seed
=
module
.
lcp
.
seed
self
.
assertTrue
(
seed
is
not
None
)
# If we're not rerandomizing, the seed is always set
# to the same value (1)
if
rerandomize
==
'never'
:
self
.
assertEqual
(
seed
,
1
)
...
...
@@ -897,12 +899,15 @@ class CapaModuleTest(unittest.TestCase):
'''
# Simulate submitting an attempt
# We need to do this, or reset_problem() will
# fail with a complaint that we haven't submitted
# the problem yet.
module
.
done
=
True
# Reset the problem
module
.
reset_problem
({})
#
Get r
eturn the seed
#
R
eturn the seed
return
module
.
seed
def
_retry_and_check
(
num_tries
,
test_func
):
...
...
@@ -925,6 +930,8 @@ class CapaModuleTest(unittest.TestCase):
module
=
CapaFactory
.
create
(
rerandomize
=
rerandomize
)
# Get the seed
# module.seed isn't set until we check/save/reset the problem,
# so we access the capa problem seed directly
seed
=
module
.
lcp
.
seed
# We do NOT want the seed to reset if rerandomize
...
...
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