continue building examcollections

This commit is contained in:
Ross
2024-02-05 18:30:35 +00:00
parent 269a86c25b
commit b1da429036
30 changed files with 546 additions and 70 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
<a href="{% url 'generic:user_group_view' %}">User Groups</a> /
<a href="{% url 'accounts_list' %}">Manage Users</a> /
<a href="{% url 'generic:supervisor' %}">Manage Supervisors</a> /
<a href="{% url 'generic:exam_collection_list' %}">Collections</a>
<a href="{% url 'generic:examcollection_list' %}">Collections</a>
{% endif %}
{% endblock %}
@@ -49,9 +49,17 @@ Open access: {{ exam.open_access }}<br />
{% if exam.exam_mode %}
<div class="parent-help" title="Click to enable / disable the exam results">
Publish results: <input type="checkbox" id="exam-publish-results-switch" data-posturl="{% url app_name|add:':exam_toggle_results_published' pk=exam.pk %}"
{% if exam.publish_results %}checked{% endif %}> <span class="help-text">[When checked the exam results will be available to users on this site]</span>
{% if exam.publish_results %}checked{% endif %}> <span class="help-text">[When checked the exam results will be available to users on this site]</span>
</div>
{% if app_name == "anatomy" or app_name == "rapids" or app_name == "longs" %}
<p><a href="{% url app_name|add:':mark_overview' pk=exam.pk %}"><button>Mark exam</button></a></p>
{% endif %}
{% endif %}
{% if exam.examcollection %}
Exam Collection: <a href="{{ exam.examcollection.get_absolute_url }}">{{ exam.examcollection }}</a> <br/>
{% endif %}
Author(s): {% for author in exam.author.all %}
{{ author }}{% if not forloop.last %}, {% endif %}
{% endfor %}<br/>
@@ -3,7 +3,8 @@
{% block navigation %}
{{block.super}}
<br/>Test
<br/>
{% comment %} <a href="{% url 'generic:cid_group_detail' cidusergroup.pk %}">Collections</a> / {% endcomment %}
<a href="{% url 'generic:examcollection_create' %}">Create Exam Collection</a>
{% endblock %}
+65
View File
@@ -0,0 +1,65 @@
{% extends "generic/base.html" %}
<!-- {% load static from static %} -->
{% load crispy_forms_tags %}
{% block css %}
{% endblock %}
{% block js %}
<!--<script type="text/javascript" src="/admin/jsi18n/"></script>-->
{{form.media}}
<script type="text/javascript">
</script>
<!-- {{ form.media }} -->
{% endblock %}
{% block content %}
<h2>Clone Exam Collection {{object.name}}</h2>
Clones the collection. This will maintain the collection name but will create clones of all of the associated exams.
<form action="" method="post" enctype="multipart/form-data" id="examcollection-form">
{% csrf_token %}
{{ form|crispy }}
<p>The following exams will be cloned<br/>
<h3>Anatomy Exams:</h3>
<ul>
{% for exam in view.initial_object.anatomy_exams.all %}
<li>{{ exam }}</li>
{% endfor %}
</ul>
<h3>Longs Exams:</h3>
<ul>
{% for exam in view.initial_object.longs_exams.all %}
<li>{{ exam }}</li>
{% endfor %}
</ul>
<h3>SBAs Exams:</h3>
<ul>
{% for exam in view.initial_object.sbas_exams.all %}
<li>{{ exam }}</li>
{% endfor %}
</ul>
<h3>Physics Exams:</h3>
<ul>
{% for exam in view.initial_object.physics_exams.all %}
<li>{{ exam }}</li>
{% endfor %}
</ul>
<h3>Rapids Exams:</h3>
<ul>
{% for exam in view.initial_object.rapids_exams.all %}
<li>{{ exam }}</li>
{% endfor %}
</ul>
</p>
<input type="submit" class="submit-button" value="Submit" name="submit">
</form>
{% endblock %}
@@ -4,7 +4,49 @@
<h1>{{ object.name }} [{{object.date}}] </h1>
{{object.anatomy_exams}}
<p>
<a href="{% url 'generic:examcollection_edit' object.pk %}">Edit</a>
<a href="{% url 'generic:examcollection_clone' object.pk %}">Clone</a>
<a href="{% url 'generic:examcollection_delete' object.pk %}">Delete</a>
</p>
This collection contains the following exams
<h2>Anatomy Exams:</h2>
<ul>
{% for exam in object.anatomy_exams.all %}
<li><a href="{% url 'anatomy:exam_overview' exam.pk %}">{{ exam }}</a> - <a href="{% url 'anatomy:exam_update' exam.pk %}">(Edit)</a></li>
{% endfor %}
</ul>
<h2>Longs Exams:</h2>
<ul>
{% for exam in object.longs_exams.all %}
<li><a href="{% url 'longs:exam_overview' exam.pk %}">{{ exam }}</a> - <a href="{% url 'longs:exam_update' exam.pk %}">(Edit)</a></li>
{% endfor %}
</ul>
<h2>Rapids Exams:</h2>
<ul>
{% for exam in object.rapids_exams.all %}
<li><a href="{% url 'rapids:exam_overview' exam.pk %}">{{ exam }}</a> - <a href="{% url 'rapids:exam_update' exam.pk %}">(Edit)</a></li>
{% endfor %}
</ul>
<h2>Physics Exams:</h2>
<ul>
{% for exam in object.physics_exams.all %}
<li><a href="{% url 'physics:exam_overview' exam.pk %}">{{ exam }}</a> - <a href="{% url 'physics:exam_update' exam.pk %}">(Edit)</a></li>
{% endfor %}
</ul>
<h2>SBAs Exams:</h2>
<ul>
{% for exam in object.sbas_exams.all %}
<li><a href="{% url 'sbas:exam_overview' exam.pk %}">{{ exam }}</a> - <a href="{% url 'sbas:exam_update' exam.pk %}">(Edit)</a></li>
{% endfor %}
</ul>
+26
View File
@@ -0,0 +1,26 @@
{% extends "generic/base.html" %}
<!-- {% load static from static %} -->
{% load crispy_forms_tags %}
{% block css %}
{% endblock %}
{% block js %}
<!--<script type="text/javascript" src="/admin/jsi18n/"></script>-->
{{form.media}}
<script type="text/javascript">
</script>
<!-- {{ form.media }} -->
{% endblock %}
{% block content %}
<h2>Edit Exam Collection {{object.name}}</h2>
<form action="" method="post" enctype="multipart/form-data" id="examcollection-form">
{% csrf_token %}
{{ form|crispy }}
<input type="submit" class="submit-button" value="Submit" name="submit">
</form>
{% endblock %}
@@ -5,7 +5,7 @@
<h1>Exam Collections</h1>
<ul class="collections">
{% for collection in object_list %}
<li class="collection"><a href="{% url 'generic:exam_collection_detail' collection.pk %}">{{ collection.name }} [{{ collection.date}}] (Authors: {{ collection.get_authors }})</a></li>
<li class="collection"><a href="{% url 'generic:examcollection_detail' collection.pk %}">{{ collection.name }} [{{ collection.date}}] (Authors: {{ collection.get_authors }})</a></li>
{% empty %}
<li>No exam collections yet.</li>
{% endfor %}