Allow browsing user scores as admin

This commit is contained in:
Ross
2023-06-05 17:44:32 +01:00
parent fef378a2ac
commit ff00047110
6 changed files with 63 additions and 8 deletions
+10 -2
View File
@@ -2,7 +2,7 @@
{% block content %}
<div class="">
<h2>User: {{ request.user.username }}</h2>
<h2>User: {{ cid_user.username }}</h2>
<h3>Assigned exams</h3>
<div class="alert alert-dark" role="alert">
<details>
@@ -35,7 +35,15 @@
<h4>{{exam_type|title}}</h4>
<ul class='{{exam_type|lower}}'>
{% for exam in exams %}
<li class="exam" data-exam-id="{{exam.pk}}"><a href="{% url exam_type|add:':exam_scores_user' pk=exam.pk %}">{{exam.name}}</a> {% if exam.active %}[Active]{% endif %} {% if exam.publish_results %}[Results Published]{% endif %}</li>
<li class="exam" data-exam-id="{{exam.pk}}">
{% if admin %}
<a href= "{% url exam_type|add:':exam_scores_user_admin' pk=exam.pk user_id=user.pk %}" >
{% else %}
<a href= "{% url exam_type|add:':exam_scores_user' pk=exam.pk %}" >
{% endif %}
{{exam.name}}</a> {% if exam.active %}[Active]{% endif %} {% if exam.publish_results %}[Results Published]{% endif %}</li>
{% endfor %}
</ul>
{% endif %}