From 4629b08e2f4bea58b77195de166b06e0581b67c1 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 17 Feb 2024 23:54:04 +0000 Subject: [PATCH] . --- generic/models.py | 3 +++ longs/models.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/generic/models.py b/generic/models.py index 578e1eaa..94b2ee53 100644 --- a/generic/models.py +++ b/generic/models.py @@ -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)" diff --git a/longs/models.py b/longs/models.py index f7cb73d7..970883b2 100644 --- a/longs/models.py +++ b/longs/models.py @@ -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)