<%
label_class = 'response-label field-label label-inline'
%>
@@ -60,7 +60,7 @@
% if input_type == 'checkbox' or not value:
-
+
${status.display_tooltip}
% endif
@@ -69,6 +69,6 @@
${submitted_message}
%endif
% if msg:
- ${HTML(msg)}
+ ${HTML(msg)}
% endif
diff --git a/common/lib/capa/capa/templates/choicetext.html b/common/lib/capa/capa/templates/choicetext.html
index 0199a2f8d0..88422e6c1e 100644
--- a/common/lib/capa/capa/templates/choicetext.html
+++ b/common/lib/capa/capa/templates/choicetext.html
@@ -1,5 +1,8 @@
-<%! from capa.util import remove_markup %>
-<%! from django.utils.translation import ugettext as _ %>
+<%! from capa.util import remove_markup
+from django.utils.translation import ugettext as _
+from openedx.core.djangolib.markup import HTML
+%>
+
<% element_checked = False %>
% for choice_id, _ in choices:
<% choice_id = choice_id %>
@@ -63,7 +66,9 @@
% if input_type == 'checkbox' or not element_checked:
-
+
+ ${status.display_name}
+
% endif
@@ -71,7 +76,7 @@
${_(submitted_message)}
%endif
% if msg:
- ${msg|n}
+ ${HTML(msg)}
% endif
diff --git a/common/lib/capa/capa/templates/codeinput.html b/common/lib/capa/capa/templates/codeinput.html
index dda2d6b97b..57d4d82807 100644
--- a/common/lib/capa/capa/templates/codeinput.html
+++ b/common/lib/capa/capa/templates/codeinput.html
@@ -1,9 +1,16 @@
-<%! from django.utils.translation import ugettext as _ %>
-
-
+<%!
+from django.utils.translation import ugettext as _
+from openedx.core.djangolib.markup import HTML
+%>
+
+ % if response_data['label']:
+
+ % endif
+
+ >${value}
+
+ ${code_mirror_exit_message}
+
-
- ${msg|n}
+
+ ${HTML(msg)}
-
+
diff --git a/common/lib/capa/capa/templates/crystallography.html b/common/lib/capa/capa/templates/crystallography.html
index 0442fb0fa6..3229f75c10 100644
--- a/common/lib/capa/capa/templates/crystallography.html
+++ b/common/lib/capa/capa/templates/crystallography.html
@@ -1,3 +1,4 @@
+<%! from openedx.core.djangolib.markup import HTML %>
-
${HTML(msg)}
+
${HTML(msg)}
diff --git a/common/lib/capa/capa/templates/formulaequationinput.html b/common/lib/capa/capa/templates/formulaequationinput.html
index 8a857b58a0..32839565d8 100644
--- a/common/lib/capa/capa/templates/formulaequationinput.html
+++ b/common/lib/capa/capa/templates/formulaequationinput.html
@@ -4,7 +4,7 @@
% endif
-% if msg:
-
${HTML(msg)}
-% endif
+ % if msg:
+
${HTML(msg)}
+ % endif
diff --git a/common/lib/capa/capa/templates/vsepr_input.html b/common/lib/capa/capa/templates/vsepr_input.html
index c3af6222ae..5306e3dd88 100644
--- a/common/lib/capa/capa/templates/vsepr_input.html
+++ b/common/lib/capa/capa/templates/vsepr_input.html
@@ -20,14 +20,14 @@
style="display:none;"
/>
-
- ${status.display_name}
+
+ ${status.display_name}
% if msg:
- ${HTML(msg)}
+ ${HTML(msg)}
% endif
% if status in ['unsubmitted', 'correct', 'incorrect', 'partially-correct', 'incomplete']:
diff --git a/common/lib/capa/capa/tests/helpers.py b/common/lib/capa/capa/tests/helpers.py
index 7ae7a3020d..8947a93552 100644
--- a/common/lib/capa/capa/tests/helpers.py
+++ b/common/lib/capa/capa/tests/helpers.py
@@ -90,10 +90,10 @@ def mock_capa_module():
return capa_module
-def new_loncapa_problem(xml, capa_system=None, seed=723, use_capa_render_template=False):
+def new_loncapa_problem(xml, problem_id='1', capa_system=None, seed=723, use_capa_render_template=False):
"""Construct a `LoncapaProblem` suitable for unit tests."""
render_template = capa_render_template if use_capa_render_template else None
- return LoncapaProblem(xml, id='1', seed=seed, capa_system=capa_system or test_capa_system(render_template),
+ return LoncapaProblem(xml, id=problem_id, seed=seed, capa_system=capa_system or test_capa_system(render_template),
capa_module=mock_capa_module())
diff --git a/common/lib/capa/capa/tests/response_xml_factory.py b/common/lib/capa/capa/tests/response_xml_factory.py
index b01dbf4fc8..0d35ea1021 100644
--- a/common/lib/capa/capa/tests/response_xml_factory.py
+++ b/common/lib/capa/capa/tests/response_xml_factory.py
@@ -37,7 +37,7 @@ class ResponseXMLFactory(object):
For all response types, **kwargs can contain:
*question_text*: The text of the question to display,
- wrapped in
tags.
+ wrapped in