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/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py index 0d812eda76..2cf8226662 100644 --- a/common/lib/xmodule/xmodule/capa_module.py +++ b/common/lib/xmodule/xmodule/capa_module.py @@ -155,8 +155,8 @@ class CapaModule(XModule): msg = '

%s

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

%s

' % traceback.format_exc().replace('<', '<') # create a dummy problem with error message instead of failing - problem_text = ('' - 'Problem %s has an error:%s' % + problem_text = ('' + 'Problem %s has an error:%s' % (self.location.url(), msg)) self.lcp = LoncapaProblem( problem_text, self.location.html_id(), diff --git a/common/lib/xmodule/xmodule/css/capa/display.scss b/common/lib/xmodule/xmodule/css/capa/display.scss index 7a9e7532e1..bdd14916e9 100644 --- a/common/lib/xmodule/xmodule/css/capa/display.scss +++ b/common/lib/xmodule/xmodule/css/capa/display.scss @@ -16,6 +16,9 @@ h2 { } } +.inline-error { + color: darken($error-red, 10%); +} section.problem { @media print { diff --git a/lms/djangoapps/lms_migration/migrate.py b/lms/djangoapps/lms_migration/migrate.py index 0997682215..a3a1c595be 100644 --- a/lms/djangoapps/lms_migration/migrate.py +++ b/lms/djangoapps/lms_migration/migrate.py @@ -70,9 +70,9 @@ def manage_modulestores(request,reload_dir=None): if reload_dir is not None: if reload_dir not in def_ms.courses: - html += "

Error: '%s' is not a valid course directory

" % reload_dir + html += '

Error: "%s" is not a valid course directory

' % reload_dir else: - html += "

Reloaded course directory '%s'

" % reload_dir + html += '

Reloaded course directory "%s"

' % reload_dir def_ms.try_load_course(reload_dir) #---------------------------------------- @@ -179,9 +179,9 @@ def gitreload(request, reload_dir=None): if reload_dir is not None: def_ms = modulestore() if reload_dir not in def_ms.courses: - html += "

Error: '%s' is not a valid course directory

" % reload_dir + html += '

Error: "%s" is not a valid course directory

' % reload_dir else: - html += "

Reloaded course directory '%s'

" % reload_dir + html += "

Reloaded course directory '%s'

" % reload_dir def_ms.try_load_course(reload_dir) track.views.server_track(request, 'reloaded %s' % reload_dir, {}, page='migrate') diff --git a/lms/templates/portal/course_about.html b/lms/templates/portal/course_about.html index 5fabab7db5..ac7b9090d0 100644 --- a/lms/templates/portal/course_about.html +++ b/lms/templates/portal/course_about.html @@ -21,7 +21,7 @@ if(json.success) { location.href="${reverse('dashboard')}"; }else{ - $('#register_message').html("

" + json.error + "

"); + $('#register_message').html('

' + json.error + "

"); } }); })(this)