From dc5f826f884b590bd24cfa11110c891abcec9b33 Mon Sep 17 00:00:00 2001 From: Ross Date: Sun, 18 Apr 2021 10:16:55 +0100 Subject: [PATCH] . --- rapids/models.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rapids/models.py b/rapids/models.py index da5700bd..fb6ff9cc 100644 --- a/rapids/models.py +++ b/rapids/models.py @@ -268,6 +268,15 @@ class Rapid(models.Model): marked_answers = correct_answers | half_mark_answers | incorrect_answers return marked_answers + def GetCorrectUnstrippedAnswers(self): + return set( + [ + i + for i in self.answers.all() + if i.status != i.MarkOptions.CORRECT + ] + ) + def GetImages(self, feedback=False): qs = self.images.all() @@ -397,6 +406,11 @@ class Exam(ExamBase): "type": "rapid", } + if not self.exam_mode: + exam_questions[q.id]["feedback_images"] = feedback_images + exam_questions[q.id]["answer"] = q.GetCorrectUnstrippedAnswers() + + #if feedback_images: # exam_questions[q.id]["feedback_image"] = feedback_images