Commit beef00c1 by Vik Paruchuri

Json instance state fix

parent b8d49511
...@@ -111,9 +111,10 @@ class CombinedOpenEndedModule(XModule): ...@@ -111,9 +111,10 @@ class CombinedOpenEndedModule(XModule):
self.task_states.append(self.current_task.get_instance_state()) self.task_states.append(self.current_task.get_instance_state())
self.state=self.ASSESSING self.state=self.ASSESSING
elif current_task_state is None and self.current_task_number>0: elif current_task_state is None and self.current_task_number>0:
last_response=self.get_last_response(self.current_task_number-1) 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) + "}, " + current_task_state = ('{"state": "assessing", "version": 1, "max_score": ' + str(self._max_score) + ', ' +
"'attempts': 0, 'history': [{'answer': '{" + str(last_response) + "}'}]}") '"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.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.task_states.append(self.current_task.get_instance_state())
self.state=self.ASSESSING self.state=self.ASSESSING
......
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