Compare commits

..

8 Commits

7 changed files with 38 additions and 9 deletions

View File

@ -17,6 +17,7 @@ services:
- ./ref-test/app/editor/static:/usr/share/nginx/html/editor/static:ro
- ./ref-test/app/quiz/static:/usr/share/nginx/html/quiz/static:ro
- ./ref-test/app/view/static:/usr/share/nginx/html/view/static:ro
- ./ref-test/app/analysis/static:/usr/share/nginx/html/analysis/static:ro
ports:
- 80:80
- 443:443

View File

@ -45,6 +45,11 @@ server {
alias /usr/share/nginx/html/view/static/;
}
location ^~ /admin/analysis/static/ {
include /etc/nginx/mime.types;
alias /usr/share/nginx/html/analysis/static/;
}
# Proxy to the main app for all other requests
location / {
include /etc/nginx/conf.d/proxy_headers.conf;

View File

@ -54,7 +54,7 @@
</td>
<td>
{% if entry.end_time %}
{{ entry.end_time.strftime('%d %b %Y') }}
{{ entry.end_time.strftime('%Y-%m-%d %H:%M') }}
{% endif %}
</td>
<td>

View File

@ -43,7 +43,7 @@
{{ element.get_name() }}
</td>
<td>
{{ element.date.strftime('%d %b %Y %H:%M') }}
{{ element.date.strftime('%Y-%m-%d %H:%M') }}
</td>
<td>
{{ element.creator.get_username() }}

View File

@ -33,13 +33,13 @@
{% for test in tests %}
<tr class="table-row">
<td>
{{ test.start_date.strftime('%d %b %y %H:%M') }}
{{ test.start_date.strftime('%Y-%m-%d %H:%M') }}
</td>
<td>
{{ test.get_code() }}
</td>
<td>
{{ test.end_date.strftime('%d %b %Y %H:%M') }}
{{ test.end_date.strftime('%Y-%m-%d %H:%M') }}
</td>
<td>
{% if test.time_limit == None -%}

View File

@ -3,13 +3,36 @@
{% block content %}
<div class="instruction-container">
<h3>Instructions</h3>
<p>
Thank you for putting yourself forward to sit the SKA Referee Theory Exam. Please read the following instructions carefully.
</p>
<h4>
Taking the Exam
</h4>
<ul>
<li>
The exam comprises 100 multiple-choice questions.
The exam consists of 100 questions, all of them multiple choice with two or three options, which are designed to test your knowledge of a wide range of rules. For each question, answer what decision you would give as a referee unless the question instructs otherwise.
</li>
<li>
For each question, answer what decision you would give as a referee unless the question instructs otherwise.
It should take around an hour to complete.
</li>
<li>
The exam should be taken under exam conditions. Materials such as the official rules, guidelines, revision resources, or similar should not be consulted during the test.
</li>
<li>
We would remind candidates that whilst we are relying on your honesty in this test, your theory knowledge will make up a part of the practical assessment when you are observed refereeing a game.
</li>
<li>
You also may not discuss the test with any other person while you are sitting it.
</li>
<li>
If you have any queries before the exam or would like further feedback on the test, your emails are welcome.
</li>
</ul>
<h4>
Using the Web App
</h4>
<ul>
<li>
You will be able to customise the display settings of the exam from the settings panel by clicking on the red gear button <a class="btn btn-danger" aria-title="Settings" title="Settings" onclick="return false;"><i class="bi bi-gear-fill"></i></a>.
</li>
@ -17,7 +40,7 @@
You can view your progress at a glance, as well as navigate to any question in the quiz, using the question grid, accessed via the yellow grid button <a class="btn btn-warning" aria-title="Question Grid" title="Question Grid" onclick="return false;"><i class="bi bi-table"></i></a>.
</li>
<li>
If you are unsure of the answer to a question or would like to revise a question, you can flag the question to review it later on using the flag button button <a class="btn btn-secondary" id="q-nav-flag" title="Flag Button." onclick="return false;"><i class="bi bi-flag-fill"></i></a>.
If you are unsure of the answer to a question or would like to return to a question later, you can flag the question using the flag button button <a class="btn btn-secondary" id="q-nav-flag" title="Flag Button." onclick="return false;"><i class="bi bi-flag-fill"></i></a> to serve as a reminder for you to come back to it later.
</li>
</ul>
</div>
@ -46,7 +69,7 @@
Results
</h4>
<p>
The results of your exam will be processed immediately and sent to the SKA Refereeing Coordinator. You will also be emailed a copy of your results.
The results of your exam will be processed immediately and sent to the SKA Refereeing Coordinator. You will also be emailed a copy of your results. If you do not receive an email, make sure to check your spam folder.
</p>
<p>
When you are ready to begin the quiz, click the following button.

View File

@ -59,11 +59,11 @@ def _start():
except Exception as exception:
write('system.log', f'Database error when processing request \'{request.url}\': {exception}')
return abort(500)
if not test: return jsonify({'error': 'The exam code you entered is invalid.'}), 400
entry.test = test
entry.dataset = test.dataset
entry.user_code = request.form.get('user_code')
entry.user_code = None if entry.user_code == '' else entry.user_code.lower()
if not test: return jsonify({'error': 'The exam code you entered is invalid.'}), 400
if entry.user_code and entry.user_code not in test.adjustments: return jsonify({'error': f'The user code you entered is not valid.'}), 400
if test.end_date < datetime.now(): return jsonify({'error': f'The exam code you entered expired on {test["expiry_date"].strftime("%d %b %Y %H:%M")}.'}), 400
if test.start_date > datetime.now(): return jsonify({'error': f'The exam has not yet opened. Your exam code will be valid from {test["start_date"].strftime("%d %b %Y %H:%M")}.'}), 400