lost track of changes...

This commit is contained in:
Ross
2023-01-09 09:52:09 +00:00
parent 9fc457c8a5
commit af52658e44
28 changed files with 469 additions and 118 deletions
+52 -30
View File
@@ -1,49 +1,71 @@
<div class="card text-white bg-dark">
<h3>CID candidates</h3>
{% if cid_users %}
<p>{{cid_user_count}} CID candidates.</p>
{% if cid_users %}
<p>{{cid_user_count}} CID candidates.</p>
<ol>
{% for cid in cid_users %}
<ol>
{% for cid in cid_users %}
<li><a href="{% url 'generic:update_cid' cid.pk %}">{{cid.cid}}</a> [{{cid.passcode}}] {{cid.name}} /
Email: {{cid.email}}
{% if cid.supervisor %} / Supervisor email: {{cid.supervisor.email}}{% endif %} <br />
Internal candidate: {{cid.internal_candidate}}
{% if cid.login_email_sent %} / Login email sent{% endif %}
{% if cid.results_email_sent %} / Results email sent{% endif %}
</li>
<li><a href="{% url 'generic:update_cid' cid.pk %}">{{cid.cid}}</a> [{{cid.passcode}}] {{cid.name}} /
Email: {{cid.email}}
{% if cid.supervisor %} / Supervisor email: {{cid.supervisor.email}}{% endif %} <br />
Internal candidate: {{cid.internal_candidate}}
{% if cid.login_email_sent %} / Login email sent{% endif %}
{% if cid.results_email_sent %} / Results email sent{% endif %}
</li>
{% endfor %}
</ol>
{% else %}
<p>This exam has no CID candidates. Add some with the below link.</p>
{% endif %}
{% endfor %}
</ol>
{% else %}
<p>This exam has no CID candidates. Add some with the below link.</p>
{% endif %}
<a href="{% url exam.app_name|add:':exam_cids_edit' exam.pk %}">Edit Exam CIDs</a>
<a href="{% url exam.app_name|add:':exam_cids_edit' exam.pk %}">Edit Exam CIDs</a>
</div>
<br/>
<div class="card text-white bg-dark">
<h3>User candidates</h3>
{% if user_users %}
<p>{{user_user_count}} User candidates.</p>
{% if user_users %}
<p>{{user_user_count}} User candidates.</p>
<ol>
{% for user in user_users %}
<ol>
{% for user in user_users %}
<li>{{user.username}}
Email: {{user.email}}
</li>
<li>{{user.username}}
Email: {{user.email}}
</li>
{% endfor %}
</ol>
{% else %}
<p>This exam has no User candidates. Add some with the below link.</p>
{% endif %}
<a href="{% url exam.app_name|add:':exam_users_edit' exam.pk %}">Edit Exam Users</a>
</div>
<br/>
{% if user_exam_data %}
<div class="card text-white bg-dark">
<h3>Submitted candidates</h3>
<ul>
{% for user_data in user_exam_data %}
<li>
CID: {{user_data.cid_user}} /
User: {{user_data.user_user}} /
Start time: {{user_data.start_time}} /
End time: {{user_data.end_time}} /
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</ol>
{% else %}
<p>This exam has no User candidates. Add some with the below link.</p>
{% endif %}
<a href="{% url exam.app_name|add:':exam_users_edit' exam.pk %}">Edit Exam Users</a>
</div>
+1 -1
View File
@@ -18,7 +18,7 @@
{% if app_name in "rapids longs anatomy" %}
{% if request.user.is_staff %}<a href="{% url app_name|add:':mark_overview' pk=exam.pk %}">Mark answers</a>{% endif %}
{% endif %}
{% if request.user.is_staff %}<a href="{% url app_name|add:':exam_scores_cid' pk=exam.pk %}">Scores</a>{% endif %}
{% if request.user.is_staff %}<a href="{% url app_name|add:':exam_scores_all' pk=exam.pk %}">Scores</a>{% endif %}
{% endif %}
</div>
{% endfor %}
+54 -14
View File
@@ -8,6 +8,22 @@
User answer scores are cached, if you update or change an answer you will need to <a href="{% url exam.app_name|add:':exam_scores_refresh' exam.pk %}">refresh the scores</a>.
{% endif %}
{% if missing_cids %}
<div class="alert alert-warning" role="alert">
The following CIDs results have not been submitted:
{% for cid in missing_cids %}
{{cid}},
{% endfor %}
</div>
{% endif %}
{% if missing_users %}
<div class="alert alert-warning" role="alert">
The following users results have not been submitted:
{% for user_id in missing_users %}
{{user_id}},
{% endfor %}
</div>
{% endif %}
{% if unmarked %}
<div class="alert alert-warning" role="alert">
The following questions need marking
@@ -15,13 +31,13 @@
<a href="{% url exam.app_name|add:':mark' exam.pk exam_index %}">{{ exam_index|add:1 }}</a>
{% endfor %}
</div>
{% endif %}
</div>
<div id="stats-block">
<h3>Stats</h3>
Candidates: {{cids|length}}<br />
Questions: <span id="question-number">{{question_number}}</span><br />
Max score: {{max_score}}<br />
Mean: {{mean}}, Median {{median}}, Mode {{mode}}
@@ -34,7 +50,7 @@
<th>Normalised Score</th>
</tr>
{% for cid in cids %}
<tr>
<tr class="candidate-row" data-answer-count={{user_answer_count|get_item:cid}}>
{% if cid|slice:":1" == "u" %}
<td>{{cids_user_id_map|get_item:cid}}</td>
{% else %}
@@ -90,22 +106,22 @@
<details>
<summary>Email results</summary>
User results emailed: {{exam.exam_results_emailed|default:"Never"}}<br/>
<button id="email-results-button"
title="Email results to users and their supervisor"
hx-get="{% url exam.app_name|add:':exam_report_email' exam_id=exam.pk %}"
hx-target="#user-details"
hx-confirm="This will email results, please make sure scores have been refreshed before continuing"
hx-prompt="Please enter an additional email to send to (user and supervisor will automatically be used if available) if required"
<button id="email-results-button"
title="Email results to users and their supervisor"
hx-get="{% url exam.app_name|add:':exam_report_email' exam_id=exam.pk %}"
hx-target="#user-details"
hx-confirm="This will email results, please make sure scores have been refreshed before continuing"
hx-prompt="Please enter an additional email to send to (user and supervisor will automatically be used if available) if required"
>Email user results</button>
<button id="email-unsent-results-button" title="Email results to users and their supervisor"
hx-get="{% url exam.app_name|add:':exam_report_email_unsent' exam_id=exam.pk %}"
hx-target="#user-details"
hx-confirm="This will email results, please make sure scores have been refreshed before continuing"
hx-prompt="Please enter an additional email to send to (user and supervisor will automatically be used if available) if required"
hx-get="{% url exam.app_name|add:':exam_report_email_unsent' exam_id=exam.pk %}"
hx-target="#user-details"
hx-confirm="This will email results, please make sure scores have been refreshed before continuing"
hx-prompt="Please enter an additional email to send to (user and supervisor will automatically be used if available) if required"
>Email unsent user results</button>
<button id="email-results-check-button" title="Check the status of emailed results"
hx-get="{% url exam.app_name|add:':exam_report_email_status' exam_id=exam.pk %}"
hx-target="#user-details">Check email status</button>
hx-get="{% url exam.app_name|add:':exam_report_email_status' exam_id=exam.pk %}"
hx-target="#user-details">Check email status</button>
<p>Note: currently only works with registered users</p>
<div id="user-details"></div>
</details>
@@ -113,3 +129,27 @@
</div>
{% endblock %}
{% block js %}
<script>
$(document).ready(() => {
let question_number = document.getElementById("question-number").text;
$(".candidate-row").each((index, el) => {
console.log(index, el)
if (el.dataset.answerCount != question_number) {
$(el).addClass("missing-answers")
}
});
});
</script>
<style>
.missing-answers td:first-child:before {
content: "*";
color: red;
}
</style>
{% endblock %}
+6
View File
@@ -27,5 +27,11 @@
<a href="{% url 'accounts_bulk_create' %}">Bulk create users</a>
<a href="{% url 'create_user' %}">Create single user</a>
<details>
<summary>
Bulk edit
</summary>
<button>Delete supervisors</button>
</details>
{% endblock %}