From 1da7a8f2bb23a4fa7d08a01a72dcb37253e8e6de Mon Sep 17 00:00:00 2001 From: Ross Date: Sun, 26 Jun 2022 19:19:35 +0100 Subject: [PATCH] . --- generic/views.py | 9 ++++----- rapids/templates/rapids/exam_scores_new.html | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/generic/views.py b/generic/views.py index fcca04ee..88a3f282 100644 --- a/generic/views.py +++ b/generic/views.py @@ -1504,9 +1504,10 @@ class ExamViews(View, LoginRequiredMixin): for cid_user_answer in cid_user_answers: # Convoluted (probably...) if cid_user_answer.user is None: - cid = cid_user_answer.cid + cid = f"c/{cid_user_answer.cid}" + cids_user_id_map[cid] = cid # cid_passcodes[cid] = cid_user_answer.passcode - cids.add("c/"+cid) + cids.add(cid) else: cid = f"u/{cid_user_answer.user.pk}" cids_user_id_map[cid] = cid_user_answer.user.username @@ -1535,11 +1536,8 @@ class ExamViews(View, LoginRequiredMixin): if self.app_name == "rapids": callstate = s.get_answer_callstate() - print(cid, callstate) by_question[q][cid] = (ans, answer_score, callstate) user_answers_callstates[cid].append(callstate) - print(user_answers_callstates) - print("CID:::",cid, user_answers_callstates[cid]) elif self.app_name in ("rapids", "anatomy", "sbas"): by_question[q][cid] = (ans, answer_score) else: @@ -1645,6 +1643,7 @@ class ExamViews(View, LoginRequiredMixin): # "user_scores_list": user_scores_list, # "user_names": user_names, # "user_answers_and_marks": user_answers_and_marks, + "cids_user_id_map": cids_user_id_map, "max_score": max_score, "mean": mean, "median": median, diff --git a/rapids/templates/rapids/exam_scores_new.html b/rapids/templates/rapids/exam_scores_new.html index e05bf994..56a562ad 100644 --- a/rapids/templates/rapids/exam_scores_new.html +++ b/rapids/templates/rapids/exam_scores_new.html @@ -34,9 +34,9 @@ {% for cid in cids %} {% if cid|slice:":1" == "u" %} - {{cid}} + {{cids_user_id_map|get_item:cid}} {% else %} - {{cid}} + {{cid}} {% endif %} {{user_scores|get_item:cid}} {{user_scores_normalised|get_item:cid}} @@ -52,7 +52,7 @@ Candidate {% for cid in cids %} {% comment %} {{cid}} {% endcomment %} - {{cid}} + {{cids_user_id_map|get_item:cid}} {% endfor %} @@ -85,7 +85,7 @@