From 35e4b81e3445bdd735cb9dd66160c634fa5c641e Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 15 Jul 2024 11:24:02 +0100 Subject: [PATCH] a few fixes for exam marking --- generic/models.py | 2 +- generic/views.py | 6 +++--- templates/exam_list.html | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/generic/models.py b/generic/models.py index d34a69f8..0baf1e26 100644 --- a/generic/models.py +++ b/generic/models.py @@ -927,7 +927,7 @@ class ExamBase(ExamOrCollectionGenericBase): return f"{settings.REMOTE_URL}/rts" def get_exam_name(self): - return self.name + return str(self) def get_json_url(self, cid=None, passcode=None): if cid is None: diff --git a/generic/views.py b/generic/views.py index c8c628a4..5b21f0fd 100644 --- a/generic/views.py +++ b/generic/views.py @@ -579,7 +579,7 @@ class ExamViews(View, LoginRequiredMixin): data = { "status": "success", "publish_results": exam.publish_results, - "name": exam, + "name": str(exam), "id": exam.id, } return JsonResponse(data, status=200) @@ -601,7 +601,7 @@ class ExamViews(View, LoginRequiredMixin): data = { "status": "success", "active": exam.active, - "name": exam, + "name": str(exam), "id": exam.id, } return JsonResponse(data, status=200) @@ -1520,7 +1520,7 @@ class ExamViews(View, LoginRequiredMixin): obj["multi_question_json"] = h active_exams["exams"].append(obj) - if json == False: + if json is False: return active_exams["exams"] return JsonResponse(active_exams) diff --git a/templates/exam_list.html b/templates/exam_list.html index 6461aaa7..75ca0d6f 100644 --- a/templates/exam_list.html +++ b/templates/exam_list.html @@ -34,9 +34,9 @@ {% if not exam.active %}
  • {{exam}} - {% if marking %}Mark{% endif %} + {% if marking %}Mark{% endif %} - Candidates + Candidates [{{exam.valid_cid_users.count}} / @@ -50,7 +50,7 @@ - +