Commit 067a241a by Xavier Antoviaque

Strip answers of leading/ending whitespaces

parent fbd1095a
...@@ -65,7 +65,7 @@ class AnswerBlock(XBlock): ...@@ -65,7 +65,7 @@ class AnswerBlock(XBlock):
def submit(self, submission): def submit(self, submission):
if not self.read_only: if not self.read_only:
self.student_input = submission[0]['value'] self.student_input = submission[0]['value'].strip()
log.info(u'Answer submitted for`{}`: "{}"'.format(self.name, self.student_input)) log.info(u'Answer submitted for`{}`: "{}"'.format(self.name, self.student_input))
return { return {
'student_input': self.student_input, 'student_input': self.student_input,
......
<textarea cols="100" rows="10" maxlength="{{ max_length }}" name="input"> <textarea cols="100" rows="10" maxlength="{{ max_length }}" name="input">{{ self.student_input }}</textarea>
{{ self.student_input }}
</textarea>
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