fix: submit quiz if user leaves page
This commit is contained in:
@@ -1,23 +1,25 @@
|
||||
{% if attempts_exceeded %}
|
||||
<div class="common-card-style text-center p-5" style="flex-direction: column;">
|
||||
<div id="quiz-title" class="font-weight-bold mb-4" style="font-size: var(--text-lg);">{{ quiz.title }}</div>
|
||||
<div class="font-weight-bold mb-4" style="font-size: var(--text-lg);">{{ quiz.title }}</div>
|
||||
<div> {{ _("You have already exceeded the maximum number of attempts allowed for this quiz.") }} </div>
|
||||
<div> {{ _("You latest score is {0}.").format(last_attempt_score) }} </div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div id="quiz-title" class="hide">{{ quiz.title }}</div>
|
||||
<div id="quiz-title" class="hide" data-max-attempts="{{ quiz.max_attempts }}">{{ quiz.title }}</div>
|
||||
|
||||
<div class="common-card-style question-card">
|
||||
<div id="start-banner" class="text-center">
|
||||
<div class="font-weight-bold mb-2" style="font-size: var(--text-lg);"> {{ quiz.title }} </div>
|
||||
<div class="mb-2">
|
||||
{{ _("This quiz has {0} questions.").format(quiz.questions | length) }}
|
||||
{{ _("There are {0} questions in this quiz.").format(quiz.questions | length) }}
|
||||
|
||||
{% if quiz.max_attempts %}
|
||||
{% set suffix = "times" if quiz.max_attempts > 1 else "time" %}
|
||||
{{ _("You can attempt this quiz {0} {1}.").format(quiz.max_attempts, suffix) }}
|
||||
{{ _("This quiz can only be taken {0} {1}. If you attempt the quiz and leave the page before submitting, the quiz will be automatically submitted.").format(quiz.max_attempts, suffix) }}
|
||||
{% endif %}
|
||||
|
||||
{% if quiz.time %}
|
||||
{{ _("The quiz is time bound. You will have {0} seconds per question.").format(quiz.time) }}
|
||||
{{ _("The quiz has a time limit. Each question will be given {0} seconds.").format(quiz.time) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user