Save answer based on history
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -4,11 +4,7 @@
|
||||
<div class="prompt">
|
||||
${prompt|n}
|
||||
</prompt>
|
||||
<textarea rows="${rows}" cols="${cols}" name="answer" class="answer short-form-response" id="input_${id}"
|
||||
% if hidden:
|
||||
style="display:none;"
|
||||
% endif
|
||||
>${previous_answer|h}</textarea>
|
||||
<textarea rows="${rows}" cols="${cols}" name="answer" class="answer short-form-response" id="input_${id}">${previous_answer|h}</textarea>
|
||||
|
||||
<div class="message-wrapper">
|
||||
% if state == 'initial':
|
||||
|
||||
Reference in New Issue
Block a user