|
1 | 1 | {% load i18n %} |
2 | 2 | {% load static %} |
3 | | - |
4 | 3 | {% with element_checked=False %} |
5 | | -{% for choice_id, _ in choices %} |
6 | | - {% if choice_id in value %} |
7 | | - {% with element_checked=True %} |
8 | | - {% endwith %} |
9 | | - {% endif %} |
10 | | -{% endfor %} |
11 | | -<section id="choicetextinput_{{ id }}" class="choicetextinput"> |
12 | | -<div class="choicetextgroup capa_inputtype" id="inputtype_{{ id }}"> |
13 | | - <div class="script_placeholder" data-src="{% static 'js/capa/choicetextinput.js' %}"/> |
14 | | - |
15 | | - <fieldset aria-label="{{ response_data.label|striptags }}"> |
16 | | - {% for choice_id, choice_description in choices %} |
17 | | - <section id="forinput{{ choice_id }}" |
18 | | - {% if input_type == 'radio' and choice_id in value %} |
19 | | - {% if status.classname %} |
20 | | - class="choicetextgroup_{{ status.classname }}" |
| 4 | + {% for choice_id, _ in choices %} |
| 5 | + {% if choice_id in value %} |
| 6 | + {% with element_checked=True %}{% endwith %} |
| 7 | + {% endif %} |
| 8 | + {% endfor %} |
| 9 | + <section id="choicetextinput_{{ id }}" class="choicetextinput"> |
| 10 | + <div class="choicetextgroup capa_inputtype" id="inputtype_{{ id }}"> |
| 11 | + <div class="script_placeholder" |
| 12 | + data-src="{% static 'js/capa/choicetextinput.js' %}" /> |
| 13 | + <fieldset aria-label="{{ response_data.label|striptags }}"> |
| 14 | + {% for choice_id, choice_description in choices %} |
| 15 | + <section id="forinput{{ choice_id }}" |
| 16 | + {% if input_type == 'radio' and choice_id in value %} {% if status.classname %}class="choicetextgroup_{{ status.classname }}"{% endif %} |
| 17 | + {% endif %}> |
| 18 | + <input class="ctinput" |
| 19 | + type="{{ input_type }}" |
| 20 | + name="choiceinput_{{ id }}" |
| 21 | + id="{{ choice_id }}" |
| 22 | + value="{{ choice_id }}" |
| 23 | + {% if choice_id in value %}checked="true"{% endif %} /> |
| 24 | + {% for content_node in choice_description %} |
| 25 | + {% if content_node.type == 'text' %} |
| 26 | + <span class="mock_label">{{ content_node.contents }}</span> |
| 27 | + {% else %} |
| 28 | + {% with my_id=content_node.contents|default:'' %} |
| 29 | + {% with my_val=value.my_id|default:'' %} |
| 30 | + <input class="ctinput" |
| 31 | + type="text" |
| 32 | + name="{{ content_node.contents }}" |
| 33 | + id="{{ content_node.contents }}" |
| 34 | + value="{{ my_val }}" /> |
| 35 | + {% endwith %} |
| 36 | + {% endwith %} |
| 37 | + {% endif %} |
| 38 | + <span class="mock_label">{{ content_node.tail_text }}</span> |
| 39 | + {% endfor %} |
| 40 | + <p id="answer_{{ choice_id }}" class="answer"></p> |
| 41 | + </section> |
| 42 | + {% endfor %} |
| 43 | + <span id="answer_{{ id }}"></span> |
| 44 | + </fieldset> |
| 45 | + <input class="choicetextvalue" |
| 46 | + type="hidden" |
| 47 | + name="input_{{ id }}{}" |
| 48 | + id="input_{{ id }}" |
| 49 | + value="{{ value }}" /> |
| 50 | + <div class="indicator-container"> |
| 51 | + {% if input_type == 'checkbox' or not value or status.classname == 'incomplete' or status.classname == 'unsubmitted' or status.classname == 'unanswered' %} |
| 52 | + {% include "status_span.html" with status=status status_id=id %} |
21 | 53 | {% endif %} |
| 54 | + </div> |
| 55 | + {% if show_correctness == "never" %} |
| 56 | + {% if value or status != "unsubmitted" %}<div class="capa_alert">{{ submitted_message }}</div>{% endif %} |
22 | 57 | {% endif %} |
23 | | - > |
24 | | - <input class="ctinput" type="{{ input_type }}" name="choiceinput_{{ id }}" id="{{ choice_id }}" value="{{ choice_id }}" |
25 | | - |
26 | | - {% if choice_id in value %} |
27 | | - checked="true" |
28 | | - {% endif %} |
29 | | - /> |
30 | | - |
31 | | - {% for content_node in choice_description %} |
32 | | - {% if content_node.type == 'text' %} |
33 | | - <span class="mock_label"> |
34 | | - {{ content_node.contents }} |
35 | | - </span> |
36 | | - {% else %} |
37 | | - {% with my_id=content_node.contents|default:'' %} |
38 | | - {% with my_val=value.my_id|default:'' %} |
39 | | - <input class="ctinput" type="text" name="{{ content_node.contents }}" id="{{ content_node.contents }}" value="{{ my_val }}"/> |
40 | | - {% endwith %} |
41 | | - {% endwith %} |
42 | | - {% endif %} |
43 | | - <span class="mock_label"> |
44 | | - {{ content_node.tail_text }} |
45 | | - </span> |
46 | | - |
47 | | - {% endfor %} |
48 | | - <p id="answer_{{ choice_id }}" class="answer"></p> |
49 | | - </section> |
50 | | - |
51 | | - {% endfor %} |
52 | | - <span id="answer_{{ id }}"></span> |
53 | | - </fieldset> |
54 | | - <input class= "choicetextvalue" type="hidden" name="input_{{ id }}{}" id="input_{{ id }}" value="{{ value }}" /> |
55 | | - |
56 | | - <div class="indicator-container"> |
57 | | - {% if input_type == 'checkbox' or not value or status.classname == 'incomplete' or status.classname == 'unsubmitted' or status.classname == 'unanswered' %} |
58 | | - {% include "status_span.html" with status=status status_id=id %} |
59 | | - {% endif %} |
60 | | - </div> |
61 | | - |
62 | | - {% if show_correctness == "never" %} |
63 | | - {% if value or status != "unsubmitted" %} |
64 | | - <div class="capa_alert">{{ submitted_message }}</div> |
65 | | - {% endif %} |
66 | | - {% endif %} |
67 | | - {% if msg %} |
68 | | - <span class="message" tabindex="-1">{{ msg|safe }}</span> |
69 | | - {% endif %} |
70 | | -</div> |
71 | | -</section> |
| 58 | + {% if msg %}<span class="message" tabindex="-1">{{ msg|safe }}</span>{% endif %} |
| 59 | + </div> |
| 60 | + </section> |
72 | 61 | {% endwith %} |
0 commit comments