diff --git a/common/lib/xmodule/xmodule/combined_open_ended_module.py b/common/lib/xmodule/xmodule/combined_open_ended_module.py index f5014af948..cb05074b34 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_module.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_module.py @@ -131,7 +131,7 @@ class CombinedOpenEndedModule(XModule): self.state=self.ASSESSING elif current_task_state is None and self.current_task_number>0: 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": "initial", "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=open_ended_module.OpenEndedModule(self.system, self.location, self.current_task_parsed_xml, self.current_task_descriptor, instance_state=current_task_state) diff --git a/common/lib/xmodule/xmodule/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_module.py index 96cc87da3a..2cc436a808 100644 --- a/common/lib/xmodule/xmodule/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_module.py @@ -576,20 +576,20 @@ class OpenEndedModule(): def latest_answer(self): """None if not available""" if not self.history: - return None - return self.history[-1].get('answer') + return "" + return self.history[-1].get('answer', "") def latest_score(self): """None if not available""" if not self.history: - return None - return self.history[-1].get('score') + return "" + return self.history[-1].get('score', "") def latest_feedback(self): """None if not available""" if not self.history: - return None - return self.history[-1].get('feedback') + return "" + return self.history[-1].get('feedback', "") def new_history_entry(self, answer): self.history.append({'answer': answer})