From 3a22dbafbec9158afd39e9b5691afeb7ba6a1b2f Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Tue, 12 Mar 2013 13:04:40 -0400 Subject: [PATCH] Change task states --- common/lib/xmodule/xmodule/combined_open_ended_module.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_module.py b/common/lib/xmodule/xmodule/combined_open_ended_module.py index ee1f42e585..5dfe9e4a64 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_module.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_module.py @@ -6,7 +6,7 @@ from pkg_resources import resource_string from xmodule.raw_module import RawDescriptor from .x_module import XModule -from xblock.core import Integer, Scope, BlockScope, ModelType, String, Boolean, Object, Float +from xblock.core import Integer, Scope, BlockScope, ModelType, String, Boolean, Object, Float, List from xmodule.open_ended_grading_classes.combined_open_ended_modulev1 import CombinedOpenEndedV1Module, CombinedOpenEndedV1Descriptor log = logging.getLogger("mitx.courseware") @@ -62,7 +62,7 @@ class CombinedOpenEndedModule(XModule): display_name = String(help="Display name for this module", default="Open Ended Grading", scope=Scope.settings) current_task_number = Integer(help="Current task that the student is on.", default=0, scope=Scope.student_state) - task_states = Object(help="State dictionaries of each task within this module.", default=[], scope=Scope.student_state) + task_states = List(help="List of state dictionaries of each task within this module.", scope=Scope.student_state) state = String(help="Which step within the current task that the student is on.", default="initial", scope=Scope.student_state) student_attempts = Integer(help="Number of attempts taken by the student on this problem", default=0, scope=Scope.student_state) ready_to_reset = Boolean(help="If the problem is ready to be reset or not.", default=False, scope=Scope.student_state) @@ -125,6 +125,9 @@ class CombinedOpenEndedModule(XModule): self.system = system self.system.set('location', location) + if self.task_states is None: + self.task_states = [] + versions = [i[0] for i in VERSION_TUPLES] descriptors = [i[1] for i in VERSION_TUPLES] modules = [i[2] for i in VERSION_TUPLES]