Skip to content

Commit 1acdd62

Browse files
committed
fix: autformat problem block html files
1 parent 610e2ab commit 1acdd62

39 files changed

+1430
-1314
lines changed
Lines changed: 57 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,61 @@
11
{% load static %}
22
<div class="annotation-input">
3-
<div class="script_placeholder" data-src="{% static 'js/capa/annotationinput.js' %}"/>
4-
5-
<div class="annotation-header">
6-
{{ title|safe }}
7-
8-
{% if return_to_annotation %}
9-
<a class="annotation-return" href="javascript:void(0)">Return to Annotation</a><br/>
10-
{% endif %}
11-
</div>
12-
<div class="annotation-body">
13-
14-
<div class="block block-highlight">{{ text|safe }}</div>
15-
<div class="block block-comment">{{ comment|safe }}</div>
16-
17-
<div class="block">{{ comment_prompt|safe }}</div>
18-
<textarea class="comment" id="input_{{ id }}_comment" name="input_{{ id }}_comment" aria-describedby="answer_{{ id }}">{{ comment_value|safe }}</textarea>
19-
20-
<div class="block" id="label_{{ id }}">{{ tag_prompt|safe }}</div>
21-
<ul class="tags">
22-
{% for option in options %}
23-
<li>
24-
{% if has_options_value %}
25-
{% if option.choice == status.classname and status == status.classname %}
26-
<span class="tag-status {{ status.classname }}" aria-describedby="input_{{ id }}_comment">
27-
{% include "status_span.html" with status=status %}
28-
</span>
29-
{% endif %}
30-
{% endif %}
31-
32-
<span class="tag
33-
{% if option.id in options_value %}
34-
selected
35-
{% endif %}
36-
" data-id="{{ option.id }}">
37-
{{ option.description|safe }}
38-
</span>
39-
</li>
40-
{% endfor %}
41-
</ul>
42-
43-
{% if debug %}
44-
<div class="debug-value">
45-
Rendered with value:<br/>
46-
<pre>{{ value|safe }}</pre>
47-
Current input value:<br/>
48-
<input type="text" class="value" name="input_{{ id }}" id="input_{{ id }}" value="{{ value }}" />
3+
<div class="script_placeholder"
4+
data-src="{% static 'js/capa/annotationinput.js' %}" />
5+
<div class="annotation-header">
6+
{{ title|safe }}
7+
{% if return_to_annotation %}
8+
<a class="annotation-return" href="javascript:void(0)">Return to Annotation</a>
9+
<br />
10+
{% endif %}
11+
</div>
12+
<div class="annotation-body">
13+
<div class="block block-highlight">{{ text|safe }}</div>
14+
<div class="block block-comment">{{ comment|safe }}</div>
15+
<div class="block">{{ comment_prompt|safe }}</div>
16+
<textarea class="comment"
17+
id="input_{{ id }}_comment"
18+
name="input_{{ id }}_comment"
19+
aria-describedby="answer_{{ id }}">{{ comment_value|safe }}</textarea>
20+
<div class="block" id="label_{{ id }}">{{ tag_prompt|safe }}</div>
21+
<ul class="tags">
22+
{% for option in options %}
23+
<li>
24+
{% if has_options_value %}
25+
{% if option.choice == status.classname and status == status.classname %}
26+
<span class="tag-status {{ status.classname }}"
27+
aria-describedby="input_{{ id }}_comment">
28+
{% include "status_span.html" with status=status %}
29+
</span>
30+
{% endif %}
31+
{% endif %}
32+
<span class="tag {% if option.id in options_value %}selected{% endif %} "
33+
data-id="{{ option.id }}">{{ option.description|safe }}</span>
34+
</li>
35+
{% endfor %}
36+
</ul>
37+
{% if debug %}
38+
<div class="debug-value">
39+
Rendered with value:
40+
<br />
41+
<pre>{{ value|safe }}</pre>
42+
Current input value:
43+
<br />
44+
<input type="text"
45+
class="value"
46+
name="input_{{ id }}"
47+
id="input_{{ id }}"
48+
value="{{ value }}" />
49+
</div>
50+
{% else %}
51+
<input type="hidden"
52+
class="value"
53+
name="input_{{ id }}"
54+
id="input_{{ id }}"
55+
value="{{ value }}" />
56+
{% endif %}
57+
{% include "status_span.html" with status=status status_id=id %}
58+
<p id="answer_{{ id }}" class="answer answer-annotation"></p>
4959
</div>
50-
{% else %}
51-
<input type="hidden" class="value" name="input_{{ id }}" id="input_{{ id }}" value="{{ value }}" />
52-
{% endif %}
53-
54-
{% include "status_span.html" with status=status status_id=id %}
55-
56-
<p id="answer_{{ id }}" class="answer answer-annotation"></p>
57-
</div>
5860
</div>
59-
60-
{% if msg %}
61-
<span class="message" aria-describedby="label_{{ id }}" tabindex="-1">{{ msg|safe }}</span>
62-
{% endif %}
61+
{% if msg %}<span class="message" aria-describedby="label_{{ id }}" tabindex="-1">{{ msg|safe }}</span>{% endif %}
Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
<div id="chemicalequationinput_{{ id }}" class="chemicalequationinput">
2-
<div class="script_placeholder" data-src="{{ previewer }}"/>
3-
2+
<div class="script_placeholder" data-src="{{ previewer }}" />
43
<div class="{{ status.classname }}">
5-
6-
<input type="text" name="input_{{ id }}" id="input_{{ id }}" aria-label="{{ response_data.label|striptags }}"
7-
aria-describedby="answer_{{ id }}" data-input-id="{{ id }}" value="{{ value }}"
8-
{% if size %}
9-
size="{{ size }}"
10-
{% endif %}
11-
/>
12-
13-
<p class="indicator-container">
14-
{{ value }}
15-
{% include "status_span.html" with status=status status_id=id %}
16-
</p>
17-
18-
<div id="input_{{ id }}_preview" class="equation"></div>
19-
<p id="answer_{{ id }}" class="answer"></p>
20-
</div>
4+
<input type="text"
5+
name="input_{{ id }}"
6+
id="input_{{ id }}"
7+
aria-label="{{ response_data.label|striptags }}"
8+
aria-describedby="answer_{{ id }}"
9+
data-input-id="{{ id }}"
10+
value="{{ value }}"
11+
{% if size %}size="{{ size }}"{% endif %} />
12+
<p class="indicator-container">
13+
{{ value }}
14+
{% include "status_span.html" with status=status status_id=id %}
15+
</p>
16+
<div id="input_{{ id }}_preview" class="equation"></div>
17+
<p id="answer_{{ id }}" class="answer"></p>
18+
</div>
2119
</div>
Lines changed: 36 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,41 @@
11
<div class="choicegroup capa_inputtype" id="inputtype_{{ id }}">
22
<fieldset {{ describedby_html }}>
3-
{% if response_data.label %}
4-
<legend id="{{ id }}-legend" class="response-fieldset-legend field-group-hd">{{ response_data.label }}</legend>
5-
{% endif %}
6-
{% for description_id, description_text in response_data.descriptions.items %}
7-
<p class="question-description" id="{{ description_id }}">{{ description_text|safe }}</p>
8-
{% endfor %}
3+
{% if response_data.label %}
4+
<legend id="{{ id }}-legend" class="response-fieldset-legend field-group-hd">{{ response_data.label }}</legend>
5+
{% endif %}
6+
{% for description_id, description_text in response_data.descriptions.items %}
7+
<p class="question-description" id="{{ description_id }}">{{ description_text|safe }}</p>
8+
{% endfor %}
99
{% for choice_id, choice_label in choices %}
10-
<div class="field">
11-
<input type="{{ input_type }}" name="input_{{ id }}{{ name_array_suffix }}" id="input_{{ id }}_{{ choice_id }}"
12-
class="field-input input-{{ input_type }}{% if input_type == 'radio' and choice_id == value or input_type != 'radio' and choice_id in value %} submitted{% endif %}" value="{{ choice_id }}"
13-
{# If the student selected this choice... #}
14-
{% if input_type == 'radio' and choice_id == value or input_type != 'radio' and choice_id in value %}
15-
checked="true"
16-
{% elif input_type != 'radio' and choice_id in value %}
17-
checked="true"
18-
{% endif %}
19-
/><label id="{{ id }}-{{ choice_id }}-label" for="input_{{ id }}_{{ choice_id }}"
20-
class="response-label field-label label-inline{% if choice_id in value and status.classname and show_correctness != 'never' %} choicegroup_{{ status.classname }}{% endif %}"
21-
{{ describedby_html }}
22-
>
23-
<div>
24-
{{ choice_label|safe }}
10+
<div class="field">
11+
<input type="{{ input_type }}" name="input_{{ id }}{{ name_array_suffix }}" id="input_{{ id }}_{{ choice_id }}"
12+
class="field-input input-{{ input_type }}{% if input_type == 'radio' and choice_id == value or input_type != 'radio' and choice_id in value %} submitted{% endif %}" value="{{ choice_id }}"
13+
{# If the student selected this choice... #}
14+
{% if input_type == 'radio' and choice_id == value or input_type != 'radio' and choice_id in value %}
15+
checked="true"
16+
{% elif input_type != 'radio' and choice_id in value %}
17+
checked="true"
18+
{% endif %}
19+
/>
20+
<label id="{{ id }}-{{ choice_id }}-label"
21+
for="input_{{ id }}_{{ choice_id }}"
22+
class="response-label field-label label-inline{% if choice_id in value and status.classname and show_correctness != 'never' %} choicegroup_{{ status.classname }}{% endif %}"
23+
{{ describedby_html }}>
24+
<div>{{ choice_label|safe }}</div>
25+
</label>
2526
</div>
26-
</label>
27-
</div>
28-
{% endfor %}
29-
<span id="answer_{{ id }}"></span>
30-
</fieldset>
31-
<div class="indicator-container">
32-
{% if show_correctness != 'never' %}
33-
{% include "status_span.html" with status=status status_id=id %}
34-
{% else %}
35-
{% include "status_span.html" with status=status status_id=id hide_correctness=True %}
27+
{% endfor %}
28+
<span id="answer_{{ id }}"></span>
29+
</fieldset>
30+
<div class="indicator-container">
31+
{% if show_correctness != 'never' %}
32+
{% include "status_span.html" with status=status status_id=id %}
33+
{% else %}
34+
{% include "status_span.html" with status=status status_id=id hide_correctness=True %}
35+
{% endif %}
36+
</div>
37+
{% if show_correctness == "never" %}
38+
{% if value or status != "unsubmitted" %}<div class="capa_alert">{{ submitted_message|safe }}</div>{% endif %}
3639
{% endif %}
37-
</div>
38-
{% if show_correctness == "never" %}
39-
{% if value or status != "unsubmitted" %}
40-
<div class="capa_alert">{{ submitted_message|safe }}</div>
41-
{% endif %}
42-
{% endif %}
43-
{% if msg %}
44-
<span class="message" aria-describedby="{{ id }}-legend" tabindex="-1">{{ msg|safe }}</span>
45-
{% endif %}
46-
</div>
40+
{% if msg %}<span class="message" aria-describedby="{{ id }}-legend" tabindex="-1">{{ msg|safe }}</span>{% endif %}
41+
</div>
Lines changed: 55 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,61 @@
11
{% load i18n %}
22
{% load static %}
3-
43
{% 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 %}
2153
{% endif %}
54+
</div>
55+
{% if show_correctness == "never" %}
56+
{% if value or status != "unsubmitted" %}<div class="capa_alert">{{ submitted_message }}</div>{% endif %}
2257
{% 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>
7261
{% endwith %}
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
<span class="clarification" tabindex="0" role="note" aria-label="Clarification">
2-
<span data-tooltip="{{ clarification }}" data-tooltip-show-on-click="true"
3-
class="fa fa-info-circle" aria-hidden="true"></span>
1+
<span class="clarification"
2+
tabindex="0"
3+
role="note"
4+
aria-label="Clarification">
5+
<span data-tooltip="{{ clarification }}"
6+
data-tooltip-show-on-click="true"
7+
class="fa fa-info-circle"
8+
aria-hidden="true"></span>
49
<span class="sr">({{ clarification }})</span>
510
</span>

0 commit comments

Comments
 (0)