From 7f5af94df2917dfdf785264100c3a5b9c8a34f8d Mon Sep 17 00:00:00 2001 From: Ross Date: Wed, 3 Mar 2021 21:02:39 +0000 Subject: [PATCH] . --- longs/templates/longs/exam_scores_user.html | 13 +++++++++++++ longs/views.py | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/longs/templates/longs/exam_scores_user.html b/longs/templates/longs/exam_scores_user.html index 86936e20..5641ec86 100644 --- a/longs/templates/longs/exam_scores_user.html +++ b/longs/templates/longs/exam_scores_user.html @@ -11,6 +11,19 @@ {% endfor %}
Total mark: {{ total_score }} / {{max_score}} +
+

Answers

+ + +
Other exams
diff --git a/longs/views.py b/longs/views.py index 87ce32ea..3ac38dd8 100755 --- a/longs/views.py +++ b/longs/views.py @@ -889,21 +889,27 @@ def exam_scores_cid_user(request, pk, sk): #answers_and_marks = [] answers_marks = [] #answers = [] + answer_text = [] for q in questions: # Get user answer user_answer = q.cid_user_answers.filter(cid=cid).first() + + if not user_answer or user_answer is None: # skip if no answer #answers_marks.append("") #answers.append("") answer_score = 4 #ans = "Not answered" + answer_text.append("Not answered") else: answer_score = user_answer.get_answer_score() + answer_text.append((answer_observations, answer_interpretation, answer_principle_diagnosis, answer_differential_diagnosis, answer_management)) + if not exam.publish_results: answer_score = 0 #answers.append(ans) @@ -931,6 +937,7 @@ def exam_scores_cid_user(request, pk, sk): "answers_marks": answers_marks, "total_score": total_score, "max_score": max_score, + "answer_text": answer_text #"answers_and_marks": answers_and_marks, }, )