Quiz form validation and minor UI fixes

This commit is contained in:
Adil Mohak 2024-09-29 09:55:26 +03:00
parent 633e1387ea
commit 28024874d6
2 changed files with 19 additions and 5 deletions

View File

@ -14,9 +14,18 @@
</ol>
</nav>
<div class="title-1">Add questions [{{ quiz_obj|truncatechars:15 }}]</div>
<br><br>
{{ formset.non_form_errors }}
<div class="title-1 mb-3">Add questions [{{ quiz_obj|truncatechars:15 }}]</div>
{% if formset.non_form_errors %}
<div class="alert alert-danger">
<ul class="mb-0">
{% for e in formset.non_form_errors %}
<li>{{ e }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
<div class="container">
<div class="info-text bg-orange mb-3">{{ quizQuestions }} question added</div>
@ -40,11 +49,11 @@
<label for="username">{{ fs.label }}</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">{{ fs.correct }} <small class="ml-1">Correct</small></span>
<span class="input-group-text">{{ fs.correct }} <small class="ms-1">Correct</small></span>
</div>
{{ fs.choice }}
<div class="input-group-prepend">
<span class="input-group-text">{{ fs.DELETE }} <small class="ml-1">Delete</small></span>
<span class="input-group-text">{{ fs.DELETE }} <small class="ms-1">Delete</small></span>
</div>
</div>
{% endfor %}

View File

@ -72,6 +72,11 @@
</div>
</div>
</div>
{% empty %}
<h4 class="text-center mt-5 py-5 text-muted">
<i class="fa-regular fa-folder-open me-2"></i> Course quizzes will appear here.
</h4>
{% endfor %}
</div>