Merge pull request #711 from MITx/kimth/onreset-type
onreset rerandomize option
This commit is contained in:
@@ -179,6 +179,8 @@ class CapaModule(XModule):
|
||||
return "per_student"
|
||||
elif rerandomize == "never":
|
||||
return "never"
|
||||
elif rerandomize == "onreset":
|
||||
return "onreset"
|
||||
else:
|
||||
raise Exception("Invalid rerandomize attribute " + rerandomize)
|
||||
|
||||
@@ -307,7 +309,7 @@ class CapaModule(XModule):
|
||||
save_button = False
|
||||
|
||||
# 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
|
||||
|
||||
# User hasn't submitted an answer yet -- we don't want resets
|
||||
@@ -617,7 +619,7 @@ class CapaModule(XModule):
|
||||
return "Refresh the page and make an attempt before resetting."
|
||||
|
||||
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()
|
||||
# in next line)
|
||||
self.lcp.seed = None
|
||||
|
||||
@@ -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.
|
||||
* `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)
|
||||
'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)
|
||||
'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.
|
||||
|
||||
Reference in New Issue
Block a user