Files
edx-platform/xmodule/capa/templates/choicegroup.html
Irtaza Akram 99c6e901d9 Convert Problem Block Mako Templates to Django Templates (#37570)
* fix: convert mako to django templates for problem block

* fix: pylint issues
2025-12-09 19:29:06 +05:00

47 lines
2.4 KiB
HTML

<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 %}
{% 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>
</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 %}
{% 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>