add option to view cid candidate name in scores page
This commit is contained in:
@@ -1,13 +1,36 @@
|
||||
<div id="history-modal"
|
||||
class="modal modal-blur fade"
|
||||
style="display: none"
|
||||
aria-hidden="false"
|
||||
tabindex="-1">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||||
<h2>Exam user history:
|
||||
<span id="history-user"></span>
|
||||
</h2>
|
||||
<div class="modal-content"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card text-white bg-dark">
|
||||
<h3>CID candidates</h3>
|
||||
{% if cid_users %}
|
||||
<p>{{cid_user_count}} CID candidates.</p>
|
||||
|
||||
<div id="htmx-info"></div>
|
||||
|
||||
<ol class="cid-candidate-list">
|
||||
{% for cid in cid_users %}
|
||||
|
||||
<li class="cid-user" data-cid={{cid.cid}}><div class="cid-data"><a href="{% url 'generic:update_cid' cid.pk %}">{{cid.cid}}</a> [{{cid.passcode}}]</div><div class="cid-name">{{cid.name}}</div> <div class="cid-email">Email: {{cid.email}}</div>
|
||||
<li class="cid-user" data-cid={{cid.cid}}><div class="cid-data">
|
||||
<i class="bi bi-clock-history"
|
||||
title="View user exam history"
|
||||
hx-get="{% url exam.app_name|add:':exam_user_status_cid' exam.id cid.cid %}"
|
||||
hx-target=".modal-content"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#history-modal"
|
||||
_="on htmx:afterOnLoad put {{cid.cid}} into #history-user.innerHTML "
|
||||
></i>
|
||||
<a href="{% url 'generic:update_cid' cid.pk %}">{{cid.cid}}</a> [{{cid.passcode}}]</div><div class="cid-name">{{cid.name}}</div> <div class="cid-email">Email: {{cid.email}}</div>
|
||||
</li>
|
||||
|
||||
{% endfor %}
|
||||
@@ -29,7 +52,18 @@
|
||||
<ol class="user-candidate-list">
|
||||
{% for user in user_users %}
|
||||
|
||||
<li class="user-user" data-user="{{user.username}}"><div>{{user.username}}</div>
|
||||
<li class="user-user" data-user="{{user.username}}">
|
||||
|
||||
<div>
|
||||
<i class="bi bi-clock-history"
|
||||
title="View user exam history"
|
||||
hx-get="{% url exam.app_name|add:':exam_user_status_user' exam.id user.id %}"
|
||||
hx-target=".modal-content"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#history-modal"
|
||||
_="on htmx:afterOnLoad put {{cid.cid}} into #history-user.innerHTML "
|
||||
></i>
|
||||
{{user.username}}</div>
|
||||
<div>Email: {{user.email}}</div>
|
||||
</li>
|
||||
|
||||
@@ -64,37 +98,47 @@
|
||||
</ul>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
{% endif %}
|
||||
<span
|
||||
title="View all user exam history"
|
||||
hx-get="{% url exam.app_name|add:':exam_user_status' exam.id %}"
|
||||
hx-target=".modal-content"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#history-modal"
|
||||
_="on htmx:afterOnLoad put {{cid.cid}} into #history-user.innerHTML "
|
||||
>
|
||||
Exam history <i class="bi bi-clock-history"></i>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
{% block js %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Highlight users that have submitted answers
|
||||
$("#submitted-candidates li").each(function(n, el) {
|
||||
console.log(el);
|
||||
if (el.dataset.cid != "None") {
|
||||
$(`.cid-user[data-cid=${el.dataset.cid}]`).addClass("submitted")
|
||||
}
|
||||
if (el.dataset.user != "None") {
|
||||
$(`.user-user[data-user="${el.dataset.user}"]`).addClass("submitted")
|
||||
}
|
||||
});
|
||||
$("#submitted-candidates li").each(function(n, el) {
|
||||
console.log(el);
|
||||
if (el.dataset.cid != "None") {
|
||||
$(`.cid-user[data-cid=${el.dataset.cid}]`).addClass("submitted")
|
||||
}
|
||||
if (el.dataset.user != "None") {
|
||||
$(`.user-user[data-user="${el.dataset.user}"]`).addClass("submitted")
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
})
|
||||
</script>
|
||||
{% endblock js %}
|
||||
|
||||
|
||||
{% block css %}
|
||||
<style>
|
||||
.submitted {
|
||||
color: green;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.submitted {
|
||||
color: green;
|
||||
}
|
||||
</style>
|
||||
{% endblock css %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@
|
||||
<div>
|
||||
<table class="table table-dark table-striped table-hover table-sm cid-score-table sortable">
|
||||
<tr>
|
||||
<th>Candidate ID</th>
|
||||
<th>Score</th>
|
||||
<th title="click to sort by candidate / user id">Candidate ID</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 %}
|
||||
@@ -60,9 +60,16 @@
|
||||
{% for cid in cids %}
|
||||
<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>
|
||||
<td class="cid" >{{cids_user_id_map|get_item:cid}}</td>
|
||||
{% else %}
|
||||
<td><a href="{% url 'cid_scores_admin' cid|slice:'2:' %}">{{cid}}</a></td>
|
||||
<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>
|
||||
|
||||
@@ -172,6 +179,15 @@
|
||||
content: "*";
|
||||
color: red;
|
||||
}
|
||||
|
||||
.search-cid {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.cid:hover .search-cid {
|
||||
display: inline-block;
|
||||
color: darkblue;
|
||||
}
|
||||
</style>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user