Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 57 additions & 58 deletions xmodule/capa/templates/annotationinput.html
Original file line number Diff line number Diff line change
@@ -1,62 +1,61 @@
{% load static %}
<div class="annotation-input">
<div class="script_placeholder" data-src="{% static 'js/capa/annotationinput.js' %}"/>

<div class="annotation-header">
{{ title|safe }}

{% if return_to_annotation %}
<a class="annotation-return" href="javascript:void(0)">Return to Annotation</a><br/>
{% endif %}
</div>
<div class="annotation-body">

<div class="block block-highlight">{{ text|safe }}</div>
<div class="block block-comment">{{ comment|safe }}</div>

<div class="block">{{ comment_prompt|safe }}</div>
<textarea class="comment" id="input_{{ id }}_comment" name="input_{{ id }}_comment" aria-describedby="answer_{{ id }}">{{ comment_value|safe }}</textarea>

<div class="block" id="label_{{ id }}">{{ tag_prompt|safe }}</div>
<ul class="tags">
{% for option in options %}
<li>
{% if has_options_value %}
{% if option.choice == status.classname and status == status.classname %}
<span class="tag-status {{ status.classname }}" aria-describedby="input_{{ id }}_comment">
{% include "status_span.html" with status=status %}
</span>
{% endif %}
{% endif %}

<span class="tag
{% if option.id in options_value %}
selected
{% endif %}
" data-id="{{ option.id }}">
{{ option.description|safe }}
</span>
</li>
{% endfor %}
</ul>

{% if debug %}
<div class="debug-value">
Rendered with value:<br/>
<pre>{{ value|safe }}</pre>
Current input value:<br/>
<input type="text" class="value" name="input_{{ id }}" id="input_{{ id }}" value="{{ value }}" />
<div class="script_placeholder"
data-src="{% static 'js/capa/annotationinput.js' %}" />
<div class="annotation-header">
{{ title|safe }}
{% if return_to_annotation %}
<a class="annotation-return" href="javascript:void(0)">Return to Annotation</a>
<br />
{% endif %}
</div>
<div class="annotation-body">
<div class="block block-highlight">{{ text|safe }}</div>
<div class="block block-comment">{{ comment|safe }}</div>
<div class="block">{{ comment_prompt|safe }}</div>
<textarea class="comment"
id="input_{{ id }}_comment"
name="input_{{ id }}_comment"
aria-describedby="answer_{{ id }}">{{ comment_value|safe }}</textarea>
<div class="block" id="label_{{ id }}">{{ tag_prompt|safe }}</div>
<ul class="tags">
{% for option in options %}
<li>
{% if has_options_value %}
{% if option.choice == status.classname and status == status.classname %}
<span class="tag-status {{ status.classname }}"
aria-describedby="input_{{ id }}_comment">
{% include "status_span.html" with status=status %}
</span>
{% endif %}
{% endif %}
<span class="tag {% if option.id in options_value %}selected{% endif %} "
data-id="{{ option.id }}">{{ option.description|safe }}</span>
</li>
{% endfor %}
</ul>
{% if debug %}
<div class="debug-value">
Rendered with value:
<br />
<pre>{{ value|safe }}</pre>
Current input value:
<br />
<input type="text"
class="value"
name="input_{{ id }}"
id="input_{{ id }}"
value="{{ value }}" />
</div>
{% else %}
<input type="hidden"
class="value"
name="input_{{ id }}"
id="input_{{ id }}"
value="{{ value }}" />
{% endif %}
{% include "status_span.html" with status=status status_id=id %}
<p id="answer_{{ id }}" class="answer answer-annotation"></p>
</div>
{% else %}
<input type="hidden" class="value" name="input_{{ id }}" id="input_{{ id }}" value="{{ value }}" />
{% endif %}

{% include "status_span.html" with status=status status_id=id %}

<p id="answer_{{ id }}" class="answer answer-annotation"></p>
</div>
</div>

{% if msg %}
<span class="message" aria-describedby="label_{{ id }}" tabindex="-1">{{ msg|safe }}</span>
{% endif %}
{% if msg %}<span class="message" aria-describedby="label_{{ id }}" tabindex="-1">{{ msg|safe }}</span>{% endif %}
34 changes: 16 additions & 18 deletions xmodule/capa/templates/chemicalequationinput.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<div id="chemicalequationinput_{{ id }}" class="chemicalequationinput">
<div class="script_placeholder" data-src="{{ previewer }}"/>

<div class="script_placeholder" data-src="{{ previewer }}" />
<div class="{{ status.classname }}">

<input type="text" name="input_{{ id }}" id="input_{{ id }}" aria-label="{{ response_data.label|striptags }}"
aria-describedby="answer_{{ id }}" data-input-id="{{ id }}" value="{{ value }}"
{% if size %}
size="{{ size }}"
{% endif %}
/>

<p class="indicator-container">
{{ value }}
{% include "status_span.html" with status=status status_id=id %}
</p>

<div id="input_{{ id }}_preview" class="equation"></div>
<p id="answer_{{ id }}" class="answer"></p>
</div>
<input type="text"
name="input_{{ id }}"
id="input_{{ id }}"
aria-label="{{ response_data.label|striptags }}"
aria-describedby="answer_{{ id }}"
data-input-id="{{ id }}"
value="{{ value }}"
{% if size %}size="{{ size }}"{% endif %} />
<p class="indicator-container">
{{ value }}
{% include "status_span.html" with status=status status_id=id %}
</p>
<div id="input_{{ id }}_preview" class="equation"></div>
<p id="answer_{{ id }}" class="answer"></p>
</div>
</div>
77 changes: 36 additions & 41 deletions xmodule/capa/templates/choicegroup.html
Original file line number Diff line number Diff line change
@@ -1,46 +1,41 @@
<div class="choicegroup capa_inputtype" id="inputtype_{{ id }}">
<fieldset {{ describedby_html }}>
{% if response_data.label %}
<legend id="{{ id }}-legend" class="response-fieldset-legend field-group-hd">{{ response_data.label }}</legend>
{% endif %}
{% for description_id, description_text in response_data.descriptions.items %}
<p class="question-description" id="{{ description_id }}">{{ description_text|safe }}</p>
{% endfor %}
{% if response_data.label %}
<legend id="{{ id }}-legend" class="response-fieldset-legend field-group-hd">{{ response_data.label }}</legend>
{% endif %}
{% for description_id, description_text in response_data.descriptions.items %}
<p class="question-description" id="{{ description_id }}">{{ description_text|safe }}</p>
{% endfor %}
{% for choice_id, choice_label in choices %}
<div class="field">
<input type="{{ input_type }}" name="input_{{ id }}{{ name_array_suffix }}" id="input_{{ id }}_{{ choice_id }}"
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 }}"
{# If the student selected this choice... #}
{% if input_type == 'radio' and choice_id == value or input_type != 'radio' and choice_id in value %}
checked="true"
{% elif input_type != 'radio' and choice_id in value %}
checked="true"
{% endif %}
/><label id="{{ id }}-{{ choice_id }}-label" for="input_{{ id }}_{{ choice_id }}"
class="response-label field-label label-inline{% if choice_id in value and status.classname and show_correctness != 'never' %} choicegroup_{{ status.classname }}{% endif %}"
{{ describedby_html }}
>
<div>
{{ choice_label|safe }}
<div class="field">
<input type="{{ input_type }}" name="input_{{ id }}{{ name_array_suffix }}" id="input_{{ id }}_{{ choice_id }}"
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 }}"
{# If the student selected this choice... #}
{% if input_type == 'radio' and choice_id == value or input_type != 'radio' and choice_id in value %}
checked="true"
{% elif input_type != 'radio' and choice_id in value %}
checked="true"
{% endif %}
/>
<label id="{{ id }}-{{ choice_id }}-label"
for="input_{{ id }}_{{ choice_id }}"
class="response-label field-label label-inline{% if choice_id in value and status.classname and show_correctness != 'never' %} choicegroup_{{ status.classname }}{% endif %}"
{{ describedby_html }}>
<div>{{ choice_label|safe }}</div>
</label>
</div>
</label>
</div>
{% endfor %}
<span id="answer_{{ id }}"></span>
</fieldset>
<div class="indicator-container">
{% if show_correctness != 'never' %}
{% include "status_span.html" with status=status status_id=id %}
{% else %}
{% include "status_span.html" with status=status status_id=id hide_correctness=True %}
{% endfor %}
<span id="answer_{{ id }}"></span>
</fieldset>
<div class="indicator-container">
{% if show_correctness != 'never' %}
{% include "status_span.html" with status=status status_id=id %}
{% else %}
{% include "status_span.html" with status=status status_id=id hide_correctness=True %}
{% endif %}
</div>
{% if show_correctness == "never" %}
{% if value or status != "unsubmitted" %}<div class="capa_alert">{{ submitted_message|safe }}</div>{% endif %}
{% endif %}
</div>
{% if show_correctness == "never" %}
{% if value or status != "unsubmitted" %}
<div class="capa_alert">{{ submitted_message|safe }}</div>
{% endif %}
{% endif %}
{% if msg %}
<span class="message" aria-describedby="{{ id }}-legend" tabindex="-1">{{ msg|safe }}</span>
{% endif %}
</div>
{% if msg %}<span class="message" aria-describedby="{{ id }}-legend" tabindex="-1">{{ msg|safe }}</span>{% endif %}
</div>
121 changes: 55 additions & 66 deletions xmodule/capa/templates/choicetext.html
Original file line number Diff line number Diff line change
@@ -1,72 +1,61 @@
{% load i18n %}
{% load static %}

{% with element_checked=False %}
{% for choice_id, _ in choices %}
{% if choice_id in value %}
{% with element_checked=True %}
{% endwith %}
{% endif %}
{% endfor %}
<section id="choicetextinput_{{ id }}" class="choicetextinput">
<div class="choicetextgroup capa_inputtype" id="inputtype_{{ id }}">
<div class="script_placeholder" data-src="{% static 'js/capa/choicetextinput.js' %}"/>

<fieldset aria-label="{{ response_data.label|striptags }}">
{% for choice_id, choice_description in choices %}
<section id="forinput{{ choice_id }}"
{% if input_type == 'radio' and choice_id in value %}
{% if status.classname %}
class="choicetextgroup_{{ status.classname }}"
{% for choice_id, _ in choices %}
{% if choice_id in value %}
{% with element_checked=True %}{% endwith %}
{% endif %}
{% endfor %}
<section id="choicetextinput_{{ id }}" class="choicetextinput">
<div class="choicetextgroup capa_inputtype" id="inputtype_{{ id }}">
<div class="script_placeholder"
data-src="{% static 'js/capa/choicetextinput.js' %}" />
<fieldset aria-label="{{ response_data.label|striptags }}">
{% for choice_id, choice_description in choices %}
<section id="forinput{{ choice_id }}"
{% if input_type == 'radio' and choice_id in value %} {% if status.classname %}class="choicetextgroup_{{ status.classname }}"{% endif %}
{% endif %}>
<input class="ctinput"
type="{{ input_type }}"
name="choiceinput_{{ id }}"
id="{{ choice_id }}"
value="{{ choice_id }}"
{% if choice_id in value %}checked="true"{% endif %} />
{% for content_node in choice_description %}
{% if content_node.type == 'text' %}
<span class="mock_label">{{ content_node.contents }}</span>
{% else %}
{% with my_id=content_node.contents|default:'' %}
{% with my_val=value.my_id|default:'' %}
<input class="ctinput"
type="text"
name="{{ content_node.contents }}"
id="{{ content_node.contents }}"
value="{{ my_val }}" />
{% endwith %}
{% endwith %}
{% endif %}
<span class="mock_label">{{ content_node.tail_text }}</span>
{% endfor %}
<p id="answer_{{ choice_id }}" class="answer"></p>
</section>
{% endfor %}
<span id="answer_{{ id }}"></span>
</fieldset>
<input class="choicetextvalue"
type="hidden"
name="input_{{ id }}{}"
id="input_{{ id }}"
value="{{ value }}" />
<div class="indicator-container">
{% if input_type == 'checkbox' or not value or status.classname == 'incomplete' or status.classname == 'unsubmitted' or status.classname == 'unanswered' %}
{% include "status_span.html" with status=status status_id=id %}
{% endif %}
</div>
{% if show_correctness == "never" %}
{% if value or status != "unsubmitted" %}<div class="capa_alert">{{ submitted_message }}</div>{% endif %}
{% endif %}
>
<input class="ctinput" type="{{ input_type }}" name="choiceinput_{{ id }}" id="{{ choice_id }}" value="{{ choice_id }}"

{% if choice_id in value %}
checked="true"
{% endif %}
/>

{% for content_node in choice_description %}
{% if content_node.type == 'text' %}
<span class="mock_label">
{{ content_node.contents }}
</span>
{% else %}
{% with my_id=content_node.contents|default:'' %}
{% with my_val=value.my_id|default:'' %}
<input class="ctinput" type="text" name="{{ content_node.contents }}" id="{{ content_node.contents }}" value="{{ my_val }}"/>
{% endwith %}
{% endwith %}
{% endif %}
<span class="mock_label">
{{ content_node.tail_text }}
</span>

{% endfor %}
<p id="answer_{{ choice_id }}" class="answer"></p>
</section>

{% endfor %}
<span id="answer_{{ id }}"></span>
</fieldset>
<input class= "choicetextvalue" type="hidden" name="input_{{ id }}{}" id="input_{{ id }}" value="{{ value }}" />

<div class="indicator-container">
{% if input_type == 'checkbox' or not value or status.classname == 'incomplete' or status.classname == 'unsubmitted' or status.classname == 'unanswered' %}
{% include "status_span.html" with status=status status_id=id %}
{% endif %}
</div>

{% if show_correctness == "never" %}
{% if value or status != "unsubmitted" %}
<div class="capa_alert">{{ submitted_message }}</div>
{% endif %}
{% endif %}
{% if msg %}
<span class="message" tabindex="-1">{{ msg|safe }}</span>
{% endif %}
</div>
</section>
{% if msg %}<span class="message" tabindex="-1">{{ msg|safe }}</span>{% endif %}
</div>
</section>
{% endwith %}
11 changes: 8 additions & 3 deletions xmodule/capa/templates/clarification.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<span class="clarification" tabindex="0" role="note" aria-label="Clarification">
<span data-tooltip="{{ clarification }}" data-tooltip-show-on-click="true"
class="fa fa-info-circle" aria-hidden="true"></span>
<span class="clarification"
tabindex="0"
role="note"
aria-label="Clarification">
<span data-tooltip="{{ clarification }}"
data-tooltip-show-on-click="true"
class="fa fa-info-circle"
aria-hidden="true"></span>
<span class="sr">({{ clarification }})</span>
</span>
Loading
Loading