From f3ca5f456fc94bb2a9305374535722cbc84fad7a Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 4 Jan 2013 15:32:56 -0500 Subject: [PATCH] Save answer based on history --- common/lib/xmodule/xmodule/open_ended_module.py | 7 +++++-- lms/templates/open_ended.html | 6 +----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/common/lib/xmodule/xmodule/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_module.py index 7127ef2388..ad338203f1 100644 --- a/common/lib/xmodule/xmodule/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_module.py @@ -532,7 +532,11 @@ class OpenEndedModule(): return self.out_of_sync_error(get) # add new history element with answer and empty score and hint. - self.new_history_entry(get['student_answer']) + if(len(self.history)>0): + if(len(self.history[-1].keys())>1): + self.new_history_entry(get['student_answer']) + else: + get['student_answer']=self.latest_answer() self.get_score(get['student_answer'], system) self.change_state(self.ASSESSING) @@ -632,7 +636,6 @@ class OpenEndedModule(): 'allow_reset': self._allow_reset(), 'rows' : 30, 'cols' : 80, - 'hidden' : '', 'id' : 'open_ended', 'msg' : self.latest_feedback(), 'child_type' : 'openended', diff --git a/lms/templates/open_ended.html b/lms/templates/open_ended.html index fae2b45041..fbf8d74d16 100644 --- a/lms/templates/open_ended.html +++ b/lms/templates/open_ended.html @@ -4,11 +4,7 @@
${prompt|n} - +
% if state == 'initial':