add user_user support to atlas collections

This commit is contained in:
Ross
2023-07-03 13:06:08 +01:00
parent 15b6233802
commit c799f106d7
9 changed files with 160 additions and 90 deletions
@@ -4,6 +4,9 @@
<h2>{{collection.name}}
<h2>Start: {{exam.name}}</h2>
{% if request.user.is_authenticated and valid_user %}
<a href="{% url 'atlas:collection_case_view_take_user' pk=collection.pk case_number=0 %}">Start</a>
{% else %}
Enter your CID and passcode in the below boxes.<br />
<p><input id="cid-box" type="text" value="Candidate ID"></p>
<p><input id="passcode-box" type="text" value="Passcode"></p>
@@ -45,5 +48,6 @@
});
});
</script>
{% endif %}
{% endblock %}
@@ -1,7 +1,9 @@
{% extends 'base.html' %}
{% block content %}
CID: {{cid}}
{% if cid is not None %}
CID: {{cid}}
{% endif %}
<h2>Collection: {{collection.name}}</h2>
@@ -9,9 +11,21 @@
{{answer_count}} out of {{collection_length}} cases answered. Click to go to case.
<div class="sba-finish-list">
<ul>
{% for question, answer in question_answer_tuples %}
<li><a href="{% url 'atlas:collection_case_view_take' pk=collection.id case_number=forloop.counter0 cid=cid passcode=passcode %}"><button {% if not answer %}class="unanswered"{% endif %}>{{forloop.counter}}: {{answer.answer}}</button></a></li>
{% endfor %}
{% for question, answer in question_answer_tuples %}
<li>
<a href="
{% if cid is not None %}
{% url 'atlas:collection_case_view_take' pk=collection.id case_number=forloop.counter0 cid=cid passcode=passcode %}
{% else %}
{% url 'atlas:collection_case_view_take_user' pk=collection.id case_number=forloop.counter0 %}
{% endif %}
">
<span {% if not answer %}class="unanswered"{% endif %}>Case: {{forloop.counter}}</span>
</a>
<br/>
{{answer.answer}}
</li>
{% endfor %}
</ul>
</div>