This commit is contained in:
Ross
2024-02-17 23:54:04 +00:00
parent baa1ffe890
commit 4629b08e2f
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -827,6 +827,9 @@ class ExamBase(ExamOrCollectionGenericBase):
self.recreate_json = recreate_json
super().save(*args, **kwargs)
def get_questions(self):
return self.exam_questions.all().order_by("examquestiondetail__sort_order")
def get_exam_stats(self, name=True):
if self.stats_candidates < int(4):
return f"- Candidates: {int(self.stats_candidates)} (too few to generate stats)"
+1 -1
View File
@@ -505,7 +505,7 @@ class Exam(ExamBase):
return exam_question
def get_exam_json(self, based=True):
questions = self.exam_questions.all()
questions = self.get_questions()
exam_questions = defaultdict(dict)