Commit ed1f4bdd by Victor Shnayder

Check for none.

parent c5c4305f
...@@ -1852,6 +1852,10 @@ class OpenEndedResponse(LoncapaResponse): ...@@ -1852,6 +1852,10 @@ class OpenEndedResponse(LoncapaResponse):
oeparam = self.xml.find('openendedparam') oeparam = self.xml.find('openendedparam')
prompt = self.xml.find('prompt') prompt = self.xml.find('prompt')
rubric = self.xml.find('openendedrubric') rubric = self.xml.find('openendedrubric')
if not oeparam or not prompt or not rubric:
raise ValueError("openendedresponse missing required parameters.")
self._parse(oeparam, prompt, rubric) self._parse(oeparam, prompt, rubric)
@staticmethod @staticmethod
...@@ -1861,7 +1865,7 @@ class OpenEndedResponse(LoncapaResponse): ...@@ -1861,7 +1865,7 @@ class OpenEndedResponse(LoncapaResponse):
in order to avoid capa depending on xmodule (seems to be avoided in in order to avoid capa depending on xmodule (seems to be avoided in
code) code)
""" """
parts=[node.text] parts=[node.text if node.text is not None else '']
for p in node.getchildren(): for p in node.getchildren():
parts.append(etree.tostring(p, with_tail=True, encoding='unicode')) parts.append(etree.tostring(p, with_tail=True, encoding='unicode'))
......
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