From 12144e06d1ee892200776c640bf340afd9d5199b Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 16 Dec 2024 17:57:53 +0000 Subject: [PATCH] improve exam collections --- generic/forms.py | 5 +++++ generic/templates/generic/examcollection_detail.html | 4 +++- templates/exam_list.html | 8 +++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/generic/forms.py b/generic/forms.py index 7106109a..35399f47 100755 --- a/generic/forms.py +++ b/generic/forms.py @@ -771,6 +771,11 @@ class ExamCollectionForm(ModelForm): widget=FilteredSelectMultiple(verbose_name=name, is_stacked=False), ) + self.fields["author"] = ModelMultipleChoiceField( + queryset=User.objects.all(), + widget=FilteredSelectMultiple(verbose_name="Authors", is_stacked=False), required=False, + ) + def save(self, commit=True): # Get the unsaved Long instance instance = ModelForm.save(self, False) diff --git a/generic/templates/generic/examcollection_detail.html b/generic/templates/generic/examcollection_detail.html index 0de7938e..da86a567 100755 --- a/generic/templates/generic/examcollection_detail.html +++ b/generic/templates/generic/examcollection_detail.html @@ -10,7 +10,9 @@ Delete

- This collection contains the following exams +
Authors: {{ object.get_authors }}
+ +

This collection contains the following exams

diff --git a/templates/exam_list.html b/templates/exam_list.html index c8052aba..e9775973 100644 --- a/templates/exam_list.html +++ b/templates/exam_list.html @@ -51,7 +51,13 @@ {% for exam in exams %} {% if not exam.active %}

  • - {{exam}} + + {{exam}} + {% if exam.examcollection %} + + {% endif %} + + {% if marking %}Mark{% endif %} Candidates