diff --git a/cms/templates/js/due-date-editor.underscore b/cms/templates/js/due-date-editor.underscore index 38cf3dac5094..68bab6618b3e 100644 --- a/cms/templates/js/due-date-editor.underscore +++ b/cms/templates/js/due-date-editor.underscore @@ -1,12 +1,12 @@
','
').replace('
','') - msg = 'Error %s in parsing OUR expected answer "%s"
' % (err, expect) + msg += HTML('Error {err} in parsing OUR expected answer "{expect}"
').format(err=err, expect=expect) return {'ok': False, 'msg': make_error_message(msg)} ###### Sympy input ####### @@ -226,18 +237,19 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None if is_within_tolerance(fexpect, fans, threshold): return {'ok': True, 'msg': msg} else: - msg += 'You entered: %s
' % to_latex(fans) + msg += HTML('You entered: {fans}
').format(fans=to_latex(fans)) return {'ok': False, 'msg': msg} if do_numerical: # numerical answer expected - force numerical comparison if is_within_tolerance(fexpect, fans, threshold): return {'ok': True, 'msg': msg} else: - msg += 'You entered: %s (note that a numerical answer is expected)
' % to_latex(fans) + msg += HTML('You entered: {fans} (note that a numerical answer is expected)
').\ + format(fans=to_latex(fans)) return {'ok': False, 'msg': msg} if fexpect == fans: - msg += 'You entered: %s
' % to_latex(fans) + msg += HTML('You entered: {fans}
').format(fans=to_latex(fans)) return {'ok': True, 'msg': msg} ###### PMathML input ###### @@ -255,20 +267,18 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None # if DEBUG: msg += ' mmlans=%s' % repr(mmlans).replace('<','<') try: fsym = f.sympy - msg += 'You entered: %s
' % to_latex(f.sympy) + msg += HTML('You entered: {sympy}
').format(sympy=to_latex(f.sympy)) except Exception as err: log.exception("Error evaluating expression '%s' as a valid equation", ans) - msg += "Error in evaluating your expression '%s' as a valid equation
" % (ans) + msg += HTML("Error in evaluating your expression '{ans}' as a valid equation
").format(ans=ans) if "Illegal math" in str(err): - msg += "Illegal math expression
" + msg += HTML("Illegal math expression
") if DEBUG: - msg += 'Error: %s' % str(err).replace('<', '<') - msg += 'DEBUG messages:
' - msg += "%s" % traceback.format_exc() - msg += '
cmathml=
%s' % f.cmathml.replace('<', '<') - msg += '
pmathml=
%s' % mmlans.replace('<', '<') - msg += '
DEBUG messages:
{format_exc}' + '
cmathml=
{cmathml}
pmathml=
{pmathml}
Expecting a numerical answer!
" - msg += "given = %s
" % repr(ans) - msg += "fsym = %s
" % repr(fsym) + msg += HTML("Expecting a numerical answer!
given = {ans}
fsym = {fsym}
").format( + ans=repr(ans), fsym=repr(fsym) + ) # msg += "cmathml =
%s" % str(f.cmathml).replace('<','<') return {'ok': False, 'msg': make_error_message(msg)} @@ -297,12 +307,12 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None if abs(dm.vec().norm().evalf()) < threshold: return {'ok': True, 'msg': msg} except sympy.ShapeError: - msg += "
Error - your input vector or matrix has the wrong dimensions" + msg += HTML("
Error - your input vector or matrix has the wrong dimensions") return {'ok': False, 'msg': make_error_message(msg)} except Exception as err: - msg += "
Error %s in comparing expected (a list) and your answer
" % str(err).replace('<', '<') + msg += HTML("Error %s in comparing expected (a list) and your answer
").format(escape(str(err))) if DEBUG: - msg += "%s" % traceback.format_exc() + msg += HTML("
{format_exc}").format(format_exc=traceback.format_exc()) return {'ok': False, 'msg': make_error_message(msg)} #diff = (fexpect-fsym).simplify() @@ -314,15 +324,13 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None diff = None if DEBUG: - msg += '
DEBUG messages:
' - msg += "Got: %s
" % repr(fsym) + msg += HTML('DEBUG messages:
Got: {fsym}
Expecting: {fexpect}
')\ + .format(fsym=repr(fsym), fexpect=repr(fexpect).replace('**', '^').replace('hat(I)', 'hat(i)')) # msg += "Got: %s" % str([type(x) for x in fsym.atoms()]).replace('<','<') - msg += "Expecting: %s
" % repr(fexpect).replace('**', '^').replace('hat(I)', 'hat(i)') # msg += "Expecting: %s" % str([type(x) for x in fexpect.atoms()]).replace('<','<') if diff: - msg += "Difference: %s
" % to_latex(diff) - msg += 'Difference: {diff}
").format(diff=to_latex(diff)) + msg += HTML('${_("We are always seeking feedback to improve our courses. If you are an enrolled student and have any questions, feedback, suggestions, or any other issues specific to a particular class, please post on the discussion forums of that class.")}
${_('If you have a general question about {platform_name} please email {email}. To see if your question has already been answered, visit our {faq_link_start}FAQ page{faq_link_end}. You can also join the discussion on our {fb_link_start}facebook page{fb_link_end}. Though we may not have a chance to respond to every email, we take all feedback into consideration.').format( +
${Text(_('If you have a general question about {platform_name} please email {email}. To see if your question has already been answered, visit our {faq_link_start}FAQ page{faq_link_end}. You can also join the discussion on our {fb_link_start}facebook page{fb_link_end}. Though we may not have a chance to respond to every email, we take all feedback into consideration.')).format( platform_name=settings.PLATFORM_NAME, - email='{contact_email}'.format(contact_email=settings.CONTACT_EMAIL), - faq_link_start=''.format(url=reverse('faq_edx')), - faq_link_end='', - fb_link_start='', - fb_link_end='' + email=HTML('{contact_email}').format(contact_email=settings.CONTACT_EMAIL), + faq_link_start=HTML('').format(url=reverse('faq_edx')), + faq_link_end=HTML(''), + fb_link_start=HTML(''), + fb_link_end=HTML('') )}
${_('If you have suggestions/feedback about the overall {platform_name} platform, or are facing general technical issues with the platform (e.g., issues with email addresses and passwords), you can reach us at {tech_email}. For technical questions, please make sure you are using a current version of Firefox or Chrome, and include browser and version in your e-mail, as well as screenshots or other pertinent details. If you find a bug or other issues, you can reach us at the following: {bug_email}.').format( +
${Text(_('If you have suggestions/feedback about the overall {platform_name} platform, or are facing general technical issues with the platform (e.g., issues with email addresses and passwords), you can reach us at {tech_email}. For technical questions, please make sure you are using a current version of Firefox or Chrome, and include browser and version in your e-mail, as well as screenshots or other pertinent details. If you find a bug or other issues, you can reach us at the following: {bug_email}.')).format( platform_name=settings.PLATFORM_NAME, - tech_email='{tech_support_email}'.format(tech_support_email=settings.TECH_SUPPORT_EMAIL), - bug_email='{bugs_email}'.format(bugs_email=settings.BUGS_EMAIL) + tech_email=HTML('{tech_support_email}').format(tech_support_email=settings.TECH_SUPPORT_EMAIL), + bug_email=HTML('{bugs_email}').format(bugs_email=settings.BUGS_EMAIL) )}
${_('Please visit our {link_start}media/press page{link_end} for more information. For any media or press inquiries, please email {email}.').format( - link_start=''.format(url=reverse('faq_edx')), - link_end='', - email='{email}'.format(email="press@edx.org"), +
${Text(_('Please visit our {link_start}media/press page{link_end} for more information. For any media or press inquiries, please email {email}.')).format( + link_start=HTML('').format(url=reverse('faq_edx')), + link_end=HTML(''), + email=HTML('{email}').format(email="press@edx.org"), )}
${_('If you are a university wishing to collaborate or you have questions about {platform_name}, please email {email}.'.format( +
${Text(_('If you are a university wishing to collaborate or you have questions about {platform_name}, please email {email}.')).format( platform_name="edX", - email='{email}'.format( + email=HTML('{email}').format( email="university@edx.org" ) - ))}
+ )}${_('{platform_name} strives to create an innovative online-learning platform that promotes accessibility for everyone, including students with disabilities. We are dedicated to improving the accessibility of the platform and welcome your comments or questions at {email}.'.format(platform_name="EdX", email='{email}'.format(email="accessibility@edx.org")))}
+${Text(_('{platform_name} strives to create an innovative online-learning platform that promotes accessibility for everyone, including students with disabilities. We are dedicated to improving the accessibility of the platform and welcome your comments or questions at {email}.')).format( + platform_name="EdX", email=HTML('{email}').format(email="accessibility@edx.org"))}