Commit 813079fd by Chris Rossi

Support degenerate case for human readable answer.

parent 38b35cce
...@@ -81,8 +81,10 @@ class JSMEResponse(responsetypes.LoncapaResponse): ...@@ -81,8 +81,10 @@ class JSMEResponse(responsetypes.LoncapaResponse):
def get_answers(self): def get_answers(self):
elements = self.xml.xpath("./answer") elements = self.xml.xpath("./answer")
if elements: if elements and elements[0].text:
answer = elements[0].text.strip() answer = elements[0].text.strip()
else:
answer = ''
return {self.answer_id: answer} return {self.answer_id: answer}
def get_score(self, student_answers): def get_score(self, student_answers):
......
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