From ea032c58ca5b35f149542b146d02b91c92fb687e Mon Sep 17 00:00:00 2001 From: Usman Khalid <2200617@gmail.com> Date: Fri, 19 Sep 2014 15:58:29 +0500 Subject: [PATCH] If matlab grader sent unparsable response, show error message instead of trying to render the response. TNL-388 --- common/lib/capa/capa/inputtypes.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py index 0185b5fd7d..2f30f634dd 100644 --- a/common/lib/capa/capa/inputtypes.py +++ b/common/lib/capa/capa/inputtypes.py @@ -808,6 +808,7 @@ class MatlabInput(CodeInput): Handle matlab-specific parsing """ _ = self.capa_system.i18n.ugettext + submitted_msg = _("Submitted. As soon as a response is returned, " "this message will be replaced by that feedback.") self.submitted_msg = submitted_msg @@ -889,9 +890,23 @@ class MatlabInput(CodeInput): def _extra_context(self): """ Set up additional context variables""" + + _ = self.capa_system.i18n.ugettext + + queue_msg = self.queue_msg + if len(self.queue_msg) > 0: # An empty string cannot be parsed as XML but is okay to include in the template. + try: + etree.XML(u'