From c6cf8a568e48efc0ca9f28828ee4e2f038a91620 Mon Sep 17 00:00:00 2001 From: Ross Date: Thu, 23 Dec 2021 22:43:27 +0000 Subject: [PATCH] . --- anatomy/templates/anatomy/exam_scores.html | 3 +-- longs/templates/longs/exam_scores.html | 5 +++-- longs/views.py | 10 ++++++++-- physics/templates/physics/exam_scores.html | 2 +- rapids/templates/rapids/exam_scores.html | 3 +-- sbas/templates/sbas/exam_scores.html | 2 +- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/anatomy/templates/anatomy/exam_scores.html b/anatomy/templates/anatomy/exam_scores.html index 8c0fd1c2..6e0f089d 100644 --- a/anatomy/templates/anatomy/exam_scores.html +++ b/anatomy/templates/anatomy/exam_scores.html @@ -46,8 +46,7 @@ Candidate {% for cid in cids %} - {% comment %} {{cid}} {% endcomment %} - {{cid}} + {{cid}} {% endfor %} diff --git a/longs/templates/longs/exam_scores.html b/longs/templates/longs/exam_scores.html index c98f14fc..c5029ae5 100644 --- a/longs/templates/longs/exam_scores.html +++ b/longs/templates/longs/exam_scores.html @@ -46,14 +46,15 @@ Candidate {% for cid in cids %} - {{cid}} + {{cid}} {% endfor %} {% for question in questions %} - Question {{forloop.counter}} + Question + {{forloop.counter}} {% for ans, score in by_question|get_item:question %} {{score}} {% endfor %} diff --git a/longs/views.py b/longs/views.py index 22ed6395..d2b09505 100755 --- a/longs/views.py +++ b/longs/views.py @@ -1036,11 +1036,17 @@ def exam_scores_cid(request, pk): ) -def exam_scores_cid_user(request, pk, sk, passcode): +def exam_scores_cid_user(request, pk, cid, passcode): exam = get_object_or_404(Exam, pk=pk) # TODO:Need some kind of test for cid - cid = sk + + if not exam.exam_mode: + raise Http404("Packet not in exam mode") + + if not exam.check_cid_user(cid, passcode, request): + raise Http404("Error accessing exam") + questions = exam.exam_questions.all() diff --git a/physics/templates/physics/exam_scores.html b/physics/templates/physics/exam_scores.html index 3d73d595..5b8eb126 100644 --- a/physics/templates/physics/exam_scores.html +++ b/physics/templates/physics/exam_scores.html @@ -36,7 +36,7 @@ Candidate {% for cid in cids %} - {{cid}} + {{cid}} {% endfor %} diff --git a/rapids/templates/rapids/exam_scores.html b/rapids/templates/rapids/exam_scores.html index 7c9c70fc..04b43d6f 100644 --- a/rapids/templates/rapids/exam_scores.html +++ b/rapids/templates/rapids/exam_scores.html @@ -47,8 +47,7 @@ Candidate {% for cid in cids %} - {% comment %} {{cid}} {% endcomment %} - {{cid}} + {{cid}} {% endfor %} diff --git a/sbas/templates/sbas/exam_scores.html b/sbas/templates/sbas/exam_scores.html index 177e1acd..2ab22dc9 100644 --- a/sbas/templates/sbas/exam_scores.html +++ b/sbas/templates/sbas/exam_scores.html @@ -36,7 +36,7 @@ Candidate {% for cid in cids %} - {{cid}} + {{cid}} {% endfor %}