diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py index da8b5b4f96..0e6d81bdeb 100644 --- a/common/lib/xmodule/xmodule/capa_module.py +++ b/common/lib/xmodule/xmodule/capa_module.py @@ -171,7 +171,9 @@ class CapaModule(CapaFields, XModule): # add extra info and raise raise Exception(msg), None, sys.exc_info()[2] - self.set_state_from_lcp() + # Ensure that the module state matches the state of the + # capa problem + self.set_state_from_lcp() def new_lcp(self, state, text=None): if text is None: diff --git a/common/lib/xmodule/xmodule/tests/test_capa_module.py b/common/lib/xmodule/xmodule/tests/test_capa_module.py index 08565e97ad..fa6d7ce724 100644 --- a/common/lib/xmodule/xmodule/tests/test_capa_module.py +++ b/common/lib/xmodule/xmodule/tests/test_capa_module.py @@ -868,9 +868,7 @@ class CapaModuleTest(unittest.TestCase): module = CapaFactory.create(rerandomize=rerandomize) # Get the seed - # module.seed isn't set until the problem is checked/saved, - # so we access the capa problem seed directly - seed = module.lcp.seed + seed = module.seed self.assertTrue(seed is not None) # If we're not rerandomizing, the seed is always set @@ -930,9 +928,7 @@ 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 + seed = module.seed # We do NOT want the seed to reset if rerandomize # is set to 'never' -- it should still be 1