.
This commit is contained in:
+9
-3
@@ -415,7 +415,9 @@ class ExamViews(View, LoginRequiredMixin):
|
|||||||
raise PermissionDenied
|
raise PermissionDenied
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request, "exam_list.html".format(self.app_name), {"exams": exams, "app_name": self.app_name}
|
request,
|
||||||
|
"exam_list.html".format(self.app_name),
|
||||||
|
{"exams": exams, "app_name": self.app_name, "view_all": all},
|
||||||
)
|
)
|
||||||
|
|
||||||
@method_decorator(login_required)
|
@method_decorator(login_required)
|
||||||
@@ -451,7 +453,9 @@ class ExamViews(View, LoginRequiredMixin):
|
|||||||
.prefetch_related(
|
.prefetch_related(
|
||||||
Prefetch(
|
Prefetch(
|
||||||
"answers",
|
"answers",
|
||||||
queryset=self.Answer.objects.filter(proposed=False, status=self.Answer.MarkOptions.CORRECT),
|
queryset=self.Answer.objects.filter(
|
||||||
|
proposed=False, status=self.Answer.MarkOptions.CORRECT
|
||||||
|
),
|
||||||
to_attr="prefetched_primary_answer"
|
to_attr="prefetched_primary_answer"
|
||||||
# queryset=self.Answer.objects.filter(),
|
# queryset=self.Answer.objects.filter(),
|
||||||
),
|
),
|
||||||
@@ -638,7 +642,9 @@ class ExamViews(View, LoginRequiredMixin):
|
|||||||
# "cid_user_answers",
|
# "cid_user_answers",
|
||||||
Prefetch(
|
Prefetch(
|
||||||
"answers",
|
"answers",
|
||||||
queryset=self.Answer.objects.filter(proposed=False, status=self.Answer.MarkOptions.CORRECT),
|
queryset=self.Answer.objects.filter(
|
||||||
|
proposed=False, status=self.Answer.MarkOptions.CORRECT
|
||||||
|
),
|
||||||
to_attr="prefetched_primary_answer"
|
to_attr="prefetched_primary_answer"
|
||||||
# queryset=self.Answer.objects.filter(),
|
# queryset=self.Answer.objects.filter(),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
{% for exam in exams %}
|
{% for exam in exams %}
|
||||||
{% if exam.active %}
|
{% if exam.active %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{% url app_name|add:'exam_overview' pk=exam.pk %}" class="flex-col">{{exam.name}}</a> <a href="{% url app_name|add:'mark_overview' pk=exam.pk %}" class="flex-col">Mark</a><a href="{% url app_name|add:'exam_scores_cid' pk=exam.pk %}" class="flex-col">Scores</a> <span class="flex-col icon-container"><span class="published-icon {% if exam.publish_results %}published{% endif %}">Results Published</span></span>
|
<a href="{% url app_name|add:':exam_overview' pk=exam.pk %}" class="flex-col">{{exam.name}}</a> <a href="{% url app_name|add:':mark_overview' pk=exam.pk %}" class="flex-col">Mark</a><a href="{% url app_name|add:':exam_scores_cid' pk=exam.pk %}" class="flex-col">Scores</a> <span class="flex-col icon-container"><span class="published-icon {% if exam.publish_results %}published{% endif %}">Results Published</span></span>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -19,12 +19,17 @@
|
|||||||
{% for exam in exams %}
|
{% for exam in exams %}
|
||||||
{% if not exam.active %}
|
{% if not exam.active %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{% url app_name|add:'exam_overview' pk=exam.pk %}" class="flex-col">{{exam.name}}</a> <a href="{% url app_name|add:'mark_overview' pk=exam.pk %}" class="flex-col">Mark</a><a href="{% url app_name|add:'exam_scores_cid' pk=exam.pk %}" class="flex-col">Scores</a> <span class="flex-col icon-container"><span class="published-icon {% if exam.publish_results %}published{% endif %}">Results Published</span></span>
|
<a href="{% url app_name|add:':exam_overview' pk=exam.pk %}" class="flex-col">{{exam.name}}</a> <a href="{% url app_name|add:':mark_overview' pk=exam.pk %}" class="flex-col">Mark</a><a href="{% url app_name|add:':exam_scores_cid' pk=exam.pk %}" class="flex-col">Scores</a> <span class="flex-col icon-container"><span class="published-icon {% if exam.publish_results %}published{% endif %}">Results Published</span></span>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</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>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user