diff --git a/cms/templates/widgets/problem-edit.html b/cms/templates/widgets/problem-edit.html index fbc0184022..6611a04ebf 100644 --- a/cms/templates/widgets/problem-edit.html +++ b/cms/templates/widgets/problem-edit.html @@ -99,6 +99,12 @@ or= mouse
[[wrong, (right)]]
+
+
${_("Label")}
+
+
>>What is the capital of Argentina?<<
+
+
${_("Explanation")}
diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py index 5dfe865103..f425b96fef 100644 --- a/common/lib/capa/capa/inputtypes.py +++ b/common/lib/capa/capa/inputtypes.py @@ -299,7 +299,7 @@ class OptionInput(InputTypeBase): Example: - The location of the sky + The location of the sky # TODO: allow ordering to be randomized """ @@ -335,6 +335,7 @@ class OptionInput(InputTypeBase): Convert options to a convenient format. """ return [Attribute('options', transform=cls.parse_options), + Attribute('label', ''), Attribute('inline', False)] #----------------------------------------------------------------------------- @@ -353,7 +354,7 @@ class ChoiceGroup(InputTypeBase): Example: - + This is foil One. @@ -388,6 +389,7 @@ class ChoiceGroup(InputTypeBase): @classmethod def get_attributes(cls): return [Attribute("show_correctness", "always"), + Attribute('label', ''), Attribute("submitted_message", "Answer received.")] def _extra_context(self): @@ -535,7 +537,7 @@ class TextLine(InputTypeBase): is used e.g. for embedding simulations turned into questions. Example: - + This example will render out a text line with a math preview and the text 'm/s' after the end of the text line. @@ -551,7 +553,7 @@ class TextLine(InputTypeBase): """ return [ Attribute('size', None), - + Attribute('label', ''), Attribute('hidden', False), Attribute('inline', False), @@ -612,6 +614,7 @@ class FileSubmission(InputTypeBase): Convert the list of allowed files to a convenient format. """ return [Attribute('allowed_files', '[]', transform=cls.parse_files), + Attribute('label', ''), Attribute('required_files', '[]', transform=cls.parse_files), ] def setup(self): @@ -898,6 +901,7 @@ class Schematic(InputTypeBase): Attribute('analyses', None), Attribute('initial_value', None), Attribute('submit_analyses', None), + Attribute('label', ''), ] @@ -926,6 +930,7 @@ class ImageInput(InputTypeBase): """ return [Attribute('src'), Attribute('height'), + Attribute('label', ''), Attribute('width'), ] def setup(self): @@ -1016,7 +1021,8 @@ class ChemicalEquationInput(InputTypeBase): """ Can set size of text field. """ - return [Attribute('size', '20'), ] + return [Attribute('size', '20'), + Attribute('label', ''),] def _extra_context(self): """ @@ -1078,7 +1084,7 @@ class FormulaEquationInput(InputTypeBase): Example: - + options: size -- width of the textbox. """ @@ -1094,6 +1100,7 @@ class FormulaEquationInput(InputTypeBase): return [ Attribute('size', '20'), Attribute('inline', False), + Attribute('label', ''), ] def _extra_context(self): @@ -1494,7 +1501,7 @@ class ChoiceTextGroup(InputTypeBase): select the correct choice and fill in numbers to make it accurate. - + The lowest number rolled was: and the highest number rolled was: . @@ -1517,7 +1524,7 @@ class ChoiceTextGroup(InputTypeBase): select the correct choices and fill in numbers to make them accurate. - + The lowest number selected was @@ -1575,7 +1582,8 @@ class ChoiceTextGroup(InputTypeBase): """ return [ Attribute("show_correctness", "always"), - Attribute("submitted_message", "Answer received.") + Attribute("submitted_message", "Answer received."), + Attribute("label", ""), ] def _extra_context(self): diff --git a/common/lib/capa/capa/templates/chemicalequationinput.html b/common/lib/capa/capa/templates/chemicalequationinput.html index 34709c3e5e..07b8ef26f5 100644 --- a/common/lib/capa/capa/templates/chemicalequationinput.html +++ b/common/lib/capa/capa/templates/chemicalequationinput.html @@ -11,7 +11,7 @@
% endif - -
+
% for choice_id, choice_description in choices:
${msg|n}
diff --git a/common/lib/capa/capa/templates/formulaequationinput.html b/common/lib/capa/capa/templates/formulaequationinput.html index c92cfab9f1..9606546b56 100644 --- a/common/lib/capa/capa/templates/formulaequationinput.html +++ b/common/lib/capa/capa/templates/formulaequationinput.html @@ -2,11 +2,12 @@
+ data-input-id="${id}" value="${value|h}" + aria-label="${label}" + % if size: + size="${size}" + % endif + />

${reported_status}

diff --git a/common/lib/capa/capa/templates/optioninput.html b/common/lib/capa/capa/templates/optioninput.html index 0ef3b6cfe4..55b539eca6 100644 --- a/common/lib/capa/capa/templates/optioninput.html +++ b/common/lib/capa/capa/templates/optioninput.html @@ -1,7 +1,7 @@ <% doinline = "inline" if inline else "" %>
- % for option_id, option_description in options: