refactor: enhance candidate scores table layout and improve status display

This commit is contained in:
Ross
2026-07-13 10:56:36 +01:00
parent 66cca1a512
commit 2c56fcd4e7
+44 -44
View File
@@ -78,52 +78,52 @@
<div class="mb-3"> <div class="mb-3">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-dark table-striped table-hover table-sm cid-score-table sortable small" id="candidate-scores-list-table"> <table class="table table-dark table-striped table-hover table-sm cid-score-table sortable small" id="candidate-scores-list-table">
<tr> <tr>
<th title="click to sort by candidate / user id">Candidate ID</th> <th title="click to sort by candidate / user id">Candidate ID</th>
<th title="click to sort by score">Score</th> <th title="click to sort by score">Score</th>
{% if exam.app_name == "longs" or exam.app_name == "rapids" %}
<th>Normalised Score</th>
{% endif %}
<th>Status</th>
{% if can_edit %}
<th title="Include in stats calculations">Stats</th>
{% endif %}
</tr>
{% for cid in cids %}
<tr class="candidate-row" data-answer-count={{user_answer_count|get_item:cid}} data-cid-name="{{ cids_user_id_map|get_item:cid|lower }}" data-cid-val="{{ cid|lower }}">
{% if cid|slice:":1" == "u" %}
<td class="cid" >{{cids_user_id_map|get_item:cid}}</td>
{% else %}
<td class="cid" data-cid="{{cid|slice:'2:'}}"><a href="{% url 'cid_scores_admin' cid|slice:'2:' %}">{{cid}}</a>
<span title="Click to show candidate details"
hx-get="{% url 'generic:cid_details' cid|slice:'2:' %}"
hx-target="this"
>
<i class="bi bi-binoculars search-cid" ></i>
</span>
</td>
{% endif %}
<td>{{user_scores|get_item:cid}}</td>
{% if exam.app_name == "longs" or exam.app_name == "rapids" %} {% if exam.app_name == "longs" or exam.app_name == "rapids" %}
<td>{{user_scores_normalised|get_item:cid}}</td> <th>Normalised Score</th>
{% endif %} {% endif %}
<td> <th>Status</th>
{% if pass_status|get_item:cid == 'Pass' %}
<span class="badge bg-success">Pass</span>
{% else %}
<span class="badge bg-danger">Fail</span>
{% endif %}
</td>
{% if can_edit %} {% if can_edit %}
<td> <th class="sorttable_nosort" title="Include in stats calculations">Stats</th>
{% include "generic/partials/_candidate_stats_checkbox.html" with cid=cid is_excluded=excluded_map|get_item:cid exam=exam %}
</td>
{% endif %} {% endif %}
</tr> </tr>
{% endfor %} {% for cid in cids %}
</table> <tr class="candidate-row" data-answer-count={{user_answer_count|get_item:cid}} data-cid-name="{{ cids_user_id_map|get_item:cid|lower }}" data-cid-val="{{ cid|lower }}">
{% if cid|slice:":1" == "u" %}
<td class="cid" >{{cids_user_id_map|get_item:cid}}</td>
{% else %}
<td class="cid" data-cid="{{cid|slice:'2:'}}"><a href="{% url 'cid_scores_admin' cid|slice:'2:' %}">{{cid}}</a>
<span title="Click to show candidate details"
hx-get="{% url 'generic:cid_details' cid|slice:'2:' %}"
hx-target="this"
>
<i class="bi bi-binoculars search-cid" ></i>
</span>
</td>
{% endif %}
<td>{{user_scores|get_item:cid}}</td>
{% if exam.app_name == "longs" or exam.app_name == "rapids" %}
<td>{{user_scores_normalised|get_item:cid}}</td>
{% endif %}
<td>
{% if pass_status|get_item:cid == 'Pass' %}
<span class="badge bg-success">Pass</span>
{% else %}
<span class="badge bg-danger">Fail</span>
{% endif %}
</td>
{% if can_edit %}
<td>
{% include "generic/partials/_candidate_stats_checkbox.html" with cid=cid is_excluded=excluded_map|get_item:cid exam=exam %}
</td>
{% endif %}
</tr>
{% endfor %}
</table>
</div> </div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
@@ -149,9 +149,9 @@
{% block breakdown %}{% endblock breakdown %} {% block breakdown %}{% endblock breakdown %}
<details <details
hx-get="{% url exam.app_name|add:':exam_report_email_status' exam_id=exam.pk %}" hx-get="{% url exam.app_name|add:':exam_report_email_status' exam_id=exam.pk %}"
hx-trigger="revealed" hx-trigger="revealed"
hx-target="#user-details"> hx-target="#user-details">
<summary>Email results</summary> <summary>Email results</summary>
User results emailed: {{exam.exam_results_emailed|default:"Never"}}<br/> User results emailed: {{exam.exam_results_emailed|default:"Never"}}<br/>
<button id="email-results-button" <button id="email-results-button"