vault backup: 2025-12-21 20:21:58
All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 2m30s
All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 2m30s
This commit is contained in:
6
quiz/templates/partials/complete.html
Normal file
6
quiz/templates/partials/complete.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="question">
|
||||
<h2>Quiz Completed!</h2>
|
||||
<p>Du har besvarat alla frågor.</p>
|
||||
<a href="{% url 'stats' %}">Se dina resultat</a>
|
||||
</div>
|
||||
|
||||
14
quiz/templates/partials/question.html
Normal file
14
quiz/templates/partials/question.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user