Commit 89d4db5e by Victor Shnayder

Merge pull request #711 from MITx/kimth/onreset-type

onreset rerandomize option
parents 29bc9210 5efd19dd
...@@ -179,6 +179,8 @@ class CapaModule(XModule): ...@@ -179,6 +179,8 @@ class CapaModule(XModule):
return "per_student" return "per_student"
elif rerandomize == "never": elif rerandomize == "never":
return "never" return "never"
elif rerandomize == "onreset":
return "onreset"
else: else:
raise Exception("Invalid rerandomize attribute " + rerandomize) raise Exception("Invalid rerandomize attribute " + rerandomize)
...@@ -307,7 +309,7 @@ class CapaModule(XModule): ...@@ -307,7 +309,7 @@ class CapaModule(XModule):
save_button = False save_button = False
# Only show the reset button if pressing it will show different values # Only show the reset button if pressing it will show different values
if self.rerandomize != 'always': if self.rerandomize not in ["always", "onreset"]:
reset_button = False reset_button = False
# User hasn't submitted an answer yet -- we don't want resets # User hasn't submitted an answer yet -- we don't want resets
...@@ -617,7 +619,7 @@ class CapaModule(XModule): ...@@ -617,7 +619,7 @@ class CapaModule(XModule):
return "Refresh the page and make an attempt before resetting." return "Refresh the page and make an attempt before resetting."
self.lcp.do_reset() self.lcp.do_reset()
if self.rerandomize == "always": if self.rerandomize in ["always", "onreset"]:
# reset random number generator seed (note the self.lcp.get_state() # reset random number generator seed (note the self.lcp.get_state()
# in next line) # in next line)
self.lcp.seed = None self.lcp.seed = None
......
...@@ -281,6 +281,7 @@ __Inherited:__ ...@@ -281,6 +281,7 @@ __Inherited:__
* `showanswer` - When to show answer. For 'attempted', will show answer after first attempt. Values: never, attempted, answered, closed. Default: closed. Optional. * `showanswer` - When to show answer. For 'attempted', will show answer after first attempt. Values: never, attempted, answered, closed. Default: closed. Optional.
* `graded` - Whether this section will count towards the students grade. "true" or "false". Defaults to "false". * `graded` - Whether this section will count towards the students grade. "true" or "false". Defaults to "false".
* `rerandomise` - Randomize question on each attempt. Values: 'always' (students see a different version of the problem after each attempt to solve it) * `rerandomise` - Randomize question on each attempt. Values: 'always' (students see a different version of the problem after each attempt to solve it)
'onreset' (students see a different version of the problem when they reset, but are not forced to reset after each check)
'never' (all students see the same version of the problem) 'never' (all students see the same version of the problem)
'per_student' (individual students see the same version of the problem each time the look at it, but that version is different from what other students see) 'per_student' (individual students see the same version of the problem each time the look at it, but that version is different from what other students see)
Default: 'always'. Optional. Default: 'always'. Optional.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment