From 10f4d33c881e2e3e496eb533af162554d941bb22 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 11 Sep 2021 18:38:21 +0100 Subject: [PATCH] . --- longs/templates/longs/index.html | 2 +- longs/templates/longs/mark_overview.html | 4 ++-- .../longs/{mark.html => mark_question_overview.html} | 0 longs/urls.py | 2 +- longs/views.py | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) rename longs/templates/longs/{mark.html => mark_question_overview.html} (100%) diff --git a/longs/templates/longs/index.html b/longs/templates/longs/index.html index 5edac633..d2a9f4fc 100644 --- a/longs/templates/longs/index.html +++ b/longs/templates/longs/index.html @@ -4,7 +4,7 @@ {% for exam in exams %}

Exam: {{ exam.name }}

- {% if request.user.is_staff %}Mark answers{% endif %} + {% if request.user.is_staff %}Mark answers{% endif %} {% if request.user.is_staff %}Scores{% endif %}
{% endfor %} diff --git a/longs/templates/longs/mark_overview.html b/longs/templates/longs/mark_overview.html index aa1afbff..c90edca1 100644 --- a/longs/templates/longs/mark_overview.html +++ b/longs/templates/longs/mark_overview.html @@ -8,13 +8,13 @@
-
diff --git a/longs/templates/longs/mark.html b/longs/templates/longs/mark_question_overview.html similarity index 100% rename from longs/templates/longs/mark.html rename to longs/templates/longs/mark_question_overview.html diff --git a/longs/urls.py b/longs/urls.py index a8837a46..b718efe9 100755 --- a/longs/urls.py +++ b/longs/urls.py @@ -67,7 +67,7 @@ urlpatterns = [ name="question_review", ), path("exam////mark", views.mark_answer, name="mark_answer"), - path("exam///mark", views.mark_question_overview, name="mark_question_overview"), + path("exam///mark", views.mark_question_overview, name="mark_question_overview"), path("exam//mark", views.LongExamViews.mark_overview, name="mark_overview"), # path("exam///", views.exam_take, name="exam_take"), path( diff --git a/longs/views.py b/longs/views.py index 0d580b86..5e4e5c20 100755 --- a/longs/views.py +++ b/longs/views.py @@ -722,8 +722,8 @@ def mark_answer(request, exam_id, question_number, cid): # @user_passes_test(user_is_admin, login_url="/accounts/login") @login_required @user_is_long_marker -def mark_question_overview(request, pk, sk): - exam = get_object_or_404(Exam, pk=pk) +def mark_question_overview(request, exam_id, sk): + exam = get_object_or_404(Exam, pk=exam_id) questions = exam.exam_questions.all() @@ -740,7 +740,7 @@ def mark_question_overview(request, pk, sk): raise Http404("Exam question does not exist") - user_answers = question.cid_user_answers.filter(exam__id=pk) + user_answers = question.cid_user_answers.filter(exam__id=exam_id) unmarked_count = user_answers.filter(score=CidUserAnswer.ScoreOptions.UNMARKED).count()