diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py index a323a5dbfe..d9b864c5bc 100644 --- a/common/lib/capa/capa/inputtypes.py +++ b/common/lib/capa/capa/inputtypes.py @@ -470,9 +470,9 @@ def math(element, value, status, render_template, msg=''): xhtml = etree.XML(html) except Exception as err: if False: # TODO needs to be self.system.DEBUG - but can't access system - msg = "

Error %s

" % str(err).replace('<', '<') + msg = '

Error %s

' % str(err).replace('<', '<') msg += '

Failed to construct math expression from

%s

' % html.replace('<', '<') - msg += "
" + msg += "
" log.error(msg) return etree.XML(msg) else: diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py index 0cf0473348..b803452b8c 100644 --- a/common/lib/capa/capa/responsetypes.py +++ b/common/lib/capa/capa/responsetypes.py @@ -886,7 +886,7 @@ def sympy_check2(): if len(idset) == 1 and not submission[0]: # default to no error message on empty answer (to be consistent with other responsetypes) # but allow author to still have the old behavior by setting empty_answer_err attribute - msg = 'No answer entered!' if self.xml.get('empty_answer_err') else '' + msg = 'No answer entered!' if self.xml.get('empty_answer_err') else '' return CorrectMap(idset[0], 'incorrect', msg=msg) # NOTE: correct = 'unknown' could be dangerous. Inputtypes such as textline are not expecting 'unknown's @@ -1223,7 +1223,7 @@ class CodeResponse(LoncapaResponse): return oldcmap def get_answers(self): - anshtml = '
%s

' % self.answer + anshtml = '
%s
' % self.answer return {self.answer_id: anshtml} def get_initial_display(self): @@ -1400,7 +1400,7 @@ main() log.error('Error %s' % err) if self.system.DEBUG: cmap.set_dict(dict(zip(sorted(self.answer_ids), ['incorrect'] * len(idset)))) - cmap.set_property(self.answer_ids[0], 'msg', '%s' % str(err).replace('<', '<')) + cmap.set_property(self.answer_ids[0], 'msg', '%s' % str(err).replace('<', '<')) return cmap ad = rxml.find('awarddetail').text @@ -1429,7 +1429,7 @@ main() except Exception as err: log.error('Error %s' % err) if self.system.DEBUG: - msg = '%s' % str(err).replace('<', '<') + msg = '%s' % str(err).replace('<', '<') exans = [''] * len(self.answer_ids) exans[0] = msg diff --git a/common/lib/capa/capa/templates/optioninput.html b/common/lib/capa/capa/templates/optioninput.html index 0a1562c38d..06c7ed1257 100644 --- a/common/lib/capa/capa/templates/optioninput.html +++ b/common/lib/capa/capa/templates/optioninput.html @@ -1,5 +1,4 @@
-