From c1dd40031d78164dac25312e6949055ed15d3e40 Mon Sep 17 00:00:00 2001 From: Ross Date: Wed, 6 Apr 2022 16:50:54 +0100 Subject: [PATCH] . --- anatomy/models.py | 2 +- atlas/models.py | 3 +++ longs/models.py | 2 +- rapids/models.py | 6 +++++- rapids/templates/rapids/exam_scores_user.html | 8 +++++++- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/anatomy/models.py b/anatomy/models.py index 6226ef29..95029f65 100644 --- a/anatomy/models.py +++ b/anatomy/models.py @@ -259,7 +259,7 @@ class AnatomyQuestion(models.Model): ] ) - def get_question_json(self, based=True): + def get_question_json(self, based=True, feedback=False): """Returns a json representation of the question""" # Loop through rapidimage associations diff --git a/atlas/models.py b/atlas/models.py index d3de8f62..1d7b90d2 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -575,6 +575,9 @@ class Series(models.Model): return size def anonymise_images(self): + # NOTE: this will not maintain the correct hashed filename + # but that doesn't matter as we will never get the same anonymisation + # even with the same dicom... anonymizer = dicognito.anonymizer.Anonymizer() for series_image in self.images.all(): diff --git a/longs/models.py b/longs/models.py index bb710cb2..86c35535 100644 --- a/longs/models.py +++ b/longs/models.py @@ -204,7 +204,7 @@ class Long(models.Model): return marker_unmarked - def get_question_json(self, based=True): + def get_question_json(self, based=True, feedback=False): # self == q? #q = get_object_or_404(Long, pk=question_id) question_id = self.pk diff --git a/rapids/models.py b/rapids/models.py index 52793066..baf4076e 100644 --- a/rapids/models.py +++ b/rapids/models.py @@ -433,7 +433,7 @@ class Rapid(models.Model): return new_answers - def get_question_json(self, based=True): + def get_question_json(self, based=True, feedback=False): """Returns json""" # Loop through rapidimage associations @@ -468,6 +468,10 @@ class Rapid(models.Model): json["feedback_images"] = feedback_images json["answers"] = list(self.get_correct_unstripped_answers()) + if feedback: + json["feedback"] = self.feedback + + return json diff --git a/rapids/templates/rapids/exam_scores_user.html b/rapids/templates/rapids/exam_scores_user.html index 5d47ef37..586df820 100644 --- a/rapids/templates/rapids/exam_scores_user.html +++ b/rapids/templates/rapids/exam_scores_user.html @@ -7,7 +7,12 @@ Question 1
-
Answers:
+
+
+
+ Answers: +
+
@@ -62,6 +67,7 @@ $(".question-display-block .answers").empty().append(data.answers.toString()); n = parseInt(question_number) + 1 $(".question-display-block .question-number").empty().append(n); + $(".question-display-block .feedback").empty().append(data.feedback); // show some message according to the response. // For eg. A message box showing that the status has been changed $(".inner-display-block").show();