This commit is contained in:
Ross
2022-06-26 22:45:52 +01:00
parent 455be37922
commit e2c8f751f2
13 changed files with 108 additions and 705 deletions
+12 -64
View File
@@ -1,71 +1,19 @@
{% extends 'anatomy/exams.html' %}
{% extends 'generic/exam_scores_base.html' %}
{% block content %}
<div class="anatomy">
<h2>{{ exam.name }}</h2>
User answer scores are cached, if you update or change an answer you will need to <a href="{% url 'anatomy:exam_scores_refresh' exam.pk %}">refresh the scores</a>.
{% if unmarked %}
<div class="alert alert-warning" role="alert">
The following questions need marking
{% for exam_index in unmarked %}
<a href="{% url 'anatomy: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 />
Max score: {{max_score}}<br />
Mean: {{mean}}, Median {{median}}, Mode {{mode}}
<div id="stats-plot">{{plot|safe}}</div>
</div>
<div>
<table class="table table-dark table-striped table-hover table-sm cid-score-table">
<tr>
<th>Candidate ID</th>
<th>Score</th>
</tr>
{% for user, value in user_answers_marks.items %}
<tr>
<td><a href="{% url 'cid_scores_admin' user %}">{{user}}</a></td>
<td>{{user}}</td>
<td>{{user_scores|get_item:user}}</td>
</tr>
{% endfor %}
</table>
</div>
<div>
<h3>Results as a table</h3>
<table class="table table-dark table-striped table-hover table-sm">
<thead class="thead-dark">
<tr>
<th>Candidate</th>
{% for cid in cids %}
<th><a href="{% url 'anatomy:exam_scores_cid_user' exam.pk cid 'None' %}">{{cid}}</a></th>
{% endfor %}
</tr>
</thead>
{% block table_answers %}
{% for question in questions %}
<tr>
<td><a href="{% url 'anatomy:mark' exam_pk=exam.pk sk=forloop.counter0 %}">Question {{forloop.counter}}</a></td>
{% for ans, score in by_question|get_item:question %}
<td class="user-answer-score-{{score}}" title="answer score: {{score}}">{{ans}}</td>
<td><a href="{% url 'anatomy:mark' exam_pk=exam.pk sk=forloop.counter0 %}">Question {{forloop.counter}}</a>
</td>
{% comment %} {% for cid in cids %}
<td class="anatomy-ans user-answer-score-{{score_by_question|get_item:question|get_item:cid}}" title="answer score: {{score_by_question|get_item:question|get_item:cid}}">{{ans_by_question|get_item:question|get_item:cid}}</td>
{% endfor %} {% endcomment %}
{% for cid in cids %}
{% with by_question|get_item:question|get_item:cid as ans_score %}
<td class="anatomy-ans user-answer-score-{{ans_score.1}}" title="answer score: {{ans_score.1}}">{{ans_score.0}}</td>
{% endwith %}
{% endfor %}
</tr>
{% endfor %}
<tr>
<td>Score:</td>
{% for score in user_scores_list %}
<td>{{score}}</td>
{% endfor %}
</tr>
</table>
{% endblock table_answers %}
</div>
{% endblock %}
@@ -1,81 +0,0 @@
{% extends 'anatomy/exams.html' %}
{% block content %}
<div id="stats-plot">{{plot|safe}}</div>
<div class="anatomy">
<h2>{{ exam.name }}</h2>
User answer scores are cached, if you update or change an answer you will need to <a href="{% url 'anatomy:exam_scores_refresh' exam.pk %}">refresh the scores</a>.
{% if unmarked %}
<div class="alert alert-warning" role="alert">
The following questions need marking
{% for exam_index in unmarked %}
<a href="{% url 'anatomy: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 />
Max score: {{max_score}}<br />
Mean: {{mean}}, Median {{median}}, Mode {{mode}}
</div>
<div>
<table class="table table-dark table-striped table-hover table-sm cid-score-table">
<tr>
<th>Candidate ID</th>
<th>Score</th>
{% comment %} <th>Normalised Score</th> {% endcomment %}
</tr>
{% comment %} {% for user, value in user_answers_marks.items %} {% endcomment %}
{% for cid in cids %}
<tr>
<td><a href="{% url 'cid_scores_admin' cid %}">{{cid}}</a></td>
<td>{{user_scores|get_item:cid}}</td>
{% comment %} <td>{{user_scores_normalised|get_item:user}}</td> {% endcomment %}
</tr>
{% endfor %}
</table>
</div>
<div>
<h3>Answers as a table</h3>
<table class="table table-dark table-striped table-hover table-sm col-sm">
<thead class="thead-dark">
<tr>
<th>Candidate</th>
{% for cid in cids %}
<th><a href="{% url 'anatomy:exam_scores_cid_user' exam.pk cid 'None' %}">{{cid}}</a></th>
{% comment %} <th><a href="">{{cid}}</a></th> {% endcomment %}
{% endfor %}
</tr>
</thead>
{% for question in questions %}
<tr>
<td><a href="{% url 'anatomy:mark' exam_pk=exam.pk sk=forloop.counter0 %}">Question {{forloop.counter}}</a>
</td>
{% comment %} {% for cid in cids %}
<td class="anatomy-ans user-answer-score-{{score_by_question|get_item:question|get_item:cid}}" title="answer score: {{score_by_question|get_item:question|get_item:cid}}">{{ans_by_question|get_item:question|get_item:cid}}</td>
{% endfor %} {% endcomment %}
{% for cid in cids %}
{% with by_question|get_item:question|get_item:cid as ans_score %}
<td class="anatomy-ans user-answer-score-{{ans_score.1}}" title="answer score: {{ans_score.1}}">{{ans_score.0}}</td>
{% endwith %}
{% endfor %}
</tr>
{% endfor %}
<tr>
<td>Score:</td>
{% for cid in cids %}
<td>{{user_scores|get_item:cid}}</td>
{% endfor %}
</tr>
</table>
</div>
{% endblock %}