From beef00c13a4c30c04a0335b09935f0ea8b2121ae Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 3 Jan 2013 18:31:19 -0500 Subject: [PATCH] Json instance state fix --- common/lib/xmodule/xmodule/combined_open_ended_module.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_module.py b/common/lib/xmodule/xmodule/combined_open_ended_module.py index c75de86b02..14e04d399e 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_module.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_module.py @@ -111,9 +111,10 @@ class CombinedOpenEndedModule(XModule): self.task_states.append(self.current_task.get_instance_state()) self.state=self.ASSESSING elif current_task_state is None and self.current_task_number>0: - last_response=self.get_last_response(self.current_task_number-1) - current_task_state = ("{'state': 'assessing', 'version': 1, 'max_score': {" + str(self._max_score) + "}, " + - "'attempts': 0, 'history': [{'answer': '{" + str(last_response) + "}'}]}") + last_response, last_score=self.get_last_response(self.current_task_number-1) + current_task_state = ('{"state": "assessing", "version": 1, "max_score": ' + str(self._max_score) + ', ' + + '"attempts": 0, "history": [{"answer": "' + str(last_response) + '"}]}') + {"state": "done", "version": 1, "max_score": 1, "attempts": 1, "history": [{"answer": "gdgddg", "score": 0, "hint": "dfdfdf"}]} self.current_task=self_assessment_module.SelfAssessmentModule(self.system, self.location, self.current_task_parsed_xml, self.current_task_descriptor, instance_state=current_task_state) self.task_states.append(self.current_task.get_instance_state()) self.state=self.ASSESSING