Finished client result API.

Need to work on adjustment user codes and server email notifications.
This commit is contained in:
2021-11-30 18:06:24 +00:00
parent 4c14c85a47
commit add2001ba3
15 changed files with 710 additions and 54 deletions

View File

@ -8,7 +8,6 @@
{% endblock %}
{% block content %}
<div class="container quiz-panel" id="quiz-settings">
<h1>Adjust Display Settings</h1>
<div class="container quiz-start-text">
@ -141,6 +140,10 @@
<input type="radio" class="form-check-input" id="sample2" name="sample" value="2">
<label for="sample2" class="form-check-label">The <i>Dungeons &amp; Dragons Fifth Edition Monster Manual</i>.</label>
</div>
<div class="form-check">
<input type="radio" class="form-check-input" id="sample3" name="sample" value="3" checked>
<label for="sample3" class="form-check-label">All of the above</i></label>
</div>
</div>
</div>
<div class="row mt-3">
@ -154,24 +157,72 @@
</div>
</div>
<div class="container quiz-panel" style="display: none;" id="quiz-navigator">
<h1>
<h1 class="navigator-text">
Navigator
</h1>
<div id="navigator-container">
<a href="#" class="q-navigator-button btn btn-success">Q666</a>
<a href="#" class="q-navigator-button btn btn-warning">Q666</a>
<a href="#" class="q-navigator-button btn btn-secondary disabled">Q666</a>
<h1 class="review-text" style="display: none;">
Review Your Answers
</h1>
<div class="navigator-text">
This is the exam navigator. It displays the progress you have on the exam so far. Each question is represented by an icon below, and you can click on each icon to skip to that question.
The icons below are colour-coded to represent the status of each question.
</div>
<div class="control-button-container">
<div class="review-text" style="display: none;">
You can use this panel to review your answers before you submit the exam. You will not be able to amend your answers after you submit.
Each question is represented by an icon below, and you can click on each icon to skip to that question. The icons below are colour-coded to represent the status of each question.
</div>
<table class="navigator-help">
<tr>
<td>
<a class="q-navigator-button btn btn-danger progress-bar-striped btn-dummy" title="Question: Incomplete">Q</a>
</td>
<td>
A red and striped icon represents a question that you have skipped, and have not otherwise flagged for revision.
</td>
</tr>
<tr>
<td>
<a class="q-navigator-button btn btn-warning btn-dummy" title="Question: Flagged">Q</a>
</td>
<td>
A yellow icon represents a question that you have flagged for revision.
</td>
</tr>
<tr>
<td>
<a class="q-navigator-button btn btn-success btn-dummy" title="Question: Answered">Q</a>
</td>
<td>
A green icon represents a question that you have answered, and have not otherwise flagged for revision.
</td>
</tr>
<tr>
<td>
<a class="q-navigator-button btn btn-secondary disabled btn-dummy" title="Question: Unseen">Q</a>
</td>
<td>
A greyed-out icon represents a question that you have not yet seen.
</td>
</tr>
</table>
<div id="navigator-container">
</div>
<div class="control-button-container navigator-text">
<a href="#" class="btn btn-success btn-quiz-control btn-quiz-return">Resume Exam</a>
</div>
<div class="control-button-container review-text">
<a href="#" class="btn btn-danger btn-quiz-control btn-quiz-return">Back to Exam</a>
<a href="#" class="btn btn-success quiz-button-submit">Submit Exam</a>
</div>
</div>
<div class="container quiz-panel quiz-console" style="display: none" id="quiz-render">
<h1>
Exam Console
</h1>
<div class="container question-container">
<h4 class="question-title" id="quiz-question-title">
<h4 class="question-title" id="quiz-question-title" tabindex="-1">
Question x.
</h4>
<p class="question-header" id="quiz-question-header">
@ -186,10 +237,25 @@
</div>
<div class="control-button-container">
<a href="#" class="btn btn-success q-question-nav" id="q-nav-prev" title="Previous Question"><i class="bi bi-caret-left-square-fill"></i>&nbsp;Back</a>
<a href="#" class="btn btn-secondary" id="q-nav-flag" title="Flag Question"><i class="bi bi-flag-fill"></i></a>
<a href="#" class="btn btn-secondary" id="q-nav-flag" title="Question Un-Flagged. Click to flag for revision."><i class="bi bi-flag-fill"></i></a>
<a href="#" class="btn btn-success q-question-nav" id="q-nav-next" title="Next Question">Next&nbsp;<i class="bi bi-caret-right-square-fill"></i></a>
</div>
<div class="control-button-container">
<a href="#" class="btn btn-primary" id="q-review-answers" title="Submit Answers">Submit Answers</a>
</div>
</div>
<div class="container quiz-panel quiz-timeout" style="display: none;" id="quiz-timeout">
<h1>
Time Limit Expired
</h1>
<p>
The time limit set for this exam has expired. You must submit your answers immediately.
</p>
<div class="control-button-container">
<a href="#" class="btn btn-success quiz-button-submit" title="Submit Exam">Submit Exam</a>
</div>
</div>
<div id="alert-box"></div>
{% endblock %}
{% block script %}
<script

View File

@ -4,7 +4,7 @@
<div class="quiz-console w-100" style="display: none;" id="q-topbar">
<div class="d-flex justify-content align-middle">
<div class="container d-flex justify-content-center">
<span class="text-light q-timer" id="q-timer-widget"><i class="bi bi-stopwatch-fill"></i>&nbsp;<span id="q-timer-display">1:58:57</span></span>
<span class="text-light q-timer" id="q-timer-widget"><i class="bi bi-stopwatch-fill"></i>&nbsp;<span id="q-timer-display"></span></span>
</div>
<a href="#" class="btn btn-warning" aria-title="Navigate" title="Navigate" id="btn-toggle-navigator"><i class="bi bi-table"></i></a>
<a href="#" class="btn btn-danger" aria-title="Settings" title="Settings" id="btn-toggle-settings"><i class="bi bi-gear-fill"></i></a>

View File

@ -0,0 +1,41 @@
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% set cookie_flash_flag = namespace(value=False) %}
{% for category, message in messages %}
{% if category == "error" %}
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<i class="bi bi-exclamation-triangle-fill" title="Error" aria-title="Error"></i>
{{ message|safe }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% elif category == "success" %}
<div class="alert alert-success alert-dismissible fade show" role="alert">
<i class="bi bi-check2-circle" title="Success" aria-title="Success"></i>
{{ message|safe }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% elif category == "warning" %}
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<i class="bi bi-info-circle-fill" aria-title="Warning" title="Warning"></i>
{{ message|safe }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% elif category == "cookie_alert" %}
{% if not cookie_flash_flag.value %}
<div class="alert alert-primary alert-dismissible fade show" id="cookie-alert" role="alert">
<i class="bi bi-info-circle-fill" title="Cookie Alert" aria-title="Cookie Alert"></i>
{{ message|safe }}
<button type="button" id="dismiss-cookie-alert" class="btn btn-success" data-bs-dismiss="alert" aria-label="Close">Accept</button>
</div>
{% set cookie_flash_flag.value = True %}
{% endif %}
{% else %}
<div class="alert alert-primary alert-dismissible fade show" role="alert">
<i class="bi bi-info-circle-fill" title="Alert"></i>
{{ message|safe }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endif %}
{% endfor %}
{% endif %}
{% endwith %}

View File

@ -0,0 +1,44 @@
{% extends "quiz/components/base.html" %}
{% block content %}
<h1>SKA Refereeing Theory Exam</h1>
<h2>Candidate Results</h2>
<h3 class="results-name">
<span class="surname">{{ entry.name.surname }}</span>, {{ entry.name.first_name }}
</h3>
<strong class="results-details">Email Address</strong>: {{ entry.email }}
{% if entry.club %}
<strong class="results-details">Club</strong>: {{ entry.club }}
{% endif%}
{% if entry.status == 'late' %}
Your results are invalid because you did not submit your exam in time. Please contact the SKA Refereeing Coordinator.
{% else %}
<div class="results-score">
{{ score }}
</div>
<div class="results-grade">
{{ entry.results.grade[0]|upper }}{{ entry.results.grade[1:] }}
</div>
{% if entry.results.grade == 'fail' %}
Unfortunately, you have not passed the theory exam in this attempt. For your next attempt, it might help to revise the following topics:
<ul>
{% for tag in show_low_tags %}
<li>{{ tag[0] }}</li>
{% endfor %}
</ul>
{% endif %}
A copy of these results will be sent to you via email.
{% endif %}
{% endblock %}