1
0
Files
medical-notes/quiz/templates/partials/question.html
Johan Dahlin 2ec904d899
All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 2m30s
vault backup: 2025-12-21 20:21:58
2025-12-21 20:21:58 +01:00

15 lines
679 B
HTML

<div class="question">
<h2>{{ question.text }}</h2>
<form hx-post="{% url 'submit_answer' %}" hx-target="#quiz-container">
{% csrf_token %}
<input type="hidden" name="question_id" value="{{ question.id }}">
{% for option in question.options.all %}
<div class="option" onclick="this.querySelector('input').checked = true; this.closest('form').requestSubmit();">
<input type="radio" name="answer" value="{{ option.letter }}" id="opt_{{ option.letter }}" style="display:none;">
<label for="opt_{{ option.letter }}">{{ option.letter }}. {{ option.text }}</label>
</div>
{% endfor %}
</form>
</div>