diff --git a/generic/models.py b/generic/models.py index d254ba8e..2182a030 100644 --- a/generic/models.py +++ b/generic/models.py @@ -1002,6 +1002,9 @@ class ExamOrCollectionGenericBase(models.Model, AuthorMixin): def add_marker(self, user): self.markers.add(user) + def get_candidate_count(self): + return self.valid_cid_users.count() + self.valid_user_users.count() + class ExamBase(ExamOrCollectionGenericBase): exam_mode = models.BooleanField( diff --git a/generic/templates/generic/partials/_exam_list.html b/generic/templates/generic/partials/_exam_list.html index 7bef9b9e..65893ba6 100644 --- a/generic/templates/generic/partials/_exam_list.html +++ b/generic/templates/generic/partials/_exam_list.html @@ -15,7 +15,7 @@ Questions: {{ exam.get_questions|length }} - Candidates: {{ exam.stats_candidates|default:0|floatformat:0 }} + Candidates: {{ exam.get_candidate_count }} Authors: {{ exam.get_authors }}