Files
penracourses/templates/exam_list.html
T
2022-01-03 17:13:54 +00:00

79 lines
3.1 KiB
HTML

{% extends app_name|add:'/base.html' %}
{% block content %}
<h1>Examinations</h1>
<div class="{{app_name}}">
Active exams:<br/>
<ul class="exam-list">
{% for exam in exams %}
{% if exam.active %}
<li class="exam-item">
<a href="{% url app_name|add:':exam_overview' pk=exam.pk %}" class="flex-col">{{exam.name}}</a>
{% if marking %}<a href="{% url app_name|add:':mark_overview' pk=exam.pk %}" class="flex-col">Mark</a>{% endif %}
<a href="{% url app_name|add:':exam_cids' exam_id=exam.pk %}" class="flex-col">Candidates</a>
<a href="{% url app_name|add:':exam_scores_cid' pk=exam.pk %}" class="flex-col">Scores</a>
<input type="checkbox" id="{{exam.pk}}-pub" class="exam-publish-results-switch" data-posturl="{% url app_name|add:':exam_toggle_results_published' pk=exam.pk %}"
{% if exam.publish_results %}checked{% endif %}>
<label for="{{exam.pk}}-pub" class="flex-col icon-container published-icon">Results Published</label>
</li>
{% endif %}
{% endfor %}
</ul>
Inactive exams:<br/>
<ul class="exam-list">
{% for exam in exams %}
{% if not exam.active %}
<li class="exam-item">
<a href="{% url app_name|add:':exam_overview' pk=exam.pk %}" class="flex-col">{{exam.name}}</a>
{% if marking %}<a href="{% url app_name|add:':mark_overview' pk=exam.pk %}" class="flex-col">Mark</a>{% endif %}
<a href="{% url app_name|add:':exam_cids' exam_id=exam.pk %}" class="flex-col">Candidates</a>
<a href="{% url app_name|add:':exam_scores_cid' pk=exam.pk %}" class="flex-col">Scores</a>
<input type="checkbox" id="{{exam.pk}}-pub" class="exam-publish-results-switch" data-posturl="{% url app_name|add:':exam_toggle_results_published' pk=exam.pk %}"
{% if exam.publish_results %}checked{% endif %}>
<label for="{{exam.pk}}-pub" class="flex-col icon-container published-icon">Results Published</label>
</li>
{% endif %}
{% endfor %}
</ul>
{% if view_all %}
<a href="{% url app_name|add:':exam_list' %}">Hide archived</a>
{% else %}
<a href="{% url app_name|add:':exam_list_all' %}">View all</a>
{% endif %}
</div>
{% include 'exam_overview_js.html' %}
<style>
.published-icon {
border: 1px dotted gray;
opacity: 20%;
border-radius: 4px;
display: inline-block;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
}
.published-icon:hover {
opacity: 100%;
}
.exam-publish-results-switch:checked + .published-icon {
border: 1px solid purple;
color: purple;
opacity: 100%;
display: inline-block;
}
.exam-publish-results-switch {
display: none;
}
</style>
{% endblock %}