This commit is contained in:
Ross
2021-09-11 18:38:21 +01:00
parent 0e9e676dbc
commit 10f4d33c88
5 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
{% for exam in exams %}
<div class="longs">
<h1><a href="{% url 'longs:exam_overview' pk=exam.pk %}">Exam: {{ exam.name }} </a></h1>
{% if request.user.is_staff %}<a href="{% url 'longs:mark_question_overview' pk=exam.pk sk=0 %}">Mark answers</a>{% endif %}
{% if request.user.is_staff %}<a href="{% url 'longs:mark_question_overview' exam_id=exam.pk sk=0 %}">Mark answers</a>{% endif %}
{% if request.user.is_staff %}<a href="{% url 'longs:exam_scores_cid' pk=exam.pk %}">Scores</a>{% endif %}
</div>
{% endfor %}
+2 -2
View File
@@ -8,13 +8,13 @@
<div>
<button class="show-all-button">Show all</button><button class="show-unmarked-button">Show unmarked</button>
</div>
<div id="stark-marking-button"><a href="{% url 'longs:mark_question_overview' pk=exam.pk sk=0 %}"><button>Click here to start
<div id="stark-marking-button"><a href="{% url 'longs:mark_question_overview' exam_id=exam.pk sk=0 %}"><button>Click here to start
marking</button></a></div>
<ul id="question-mark-list">
{% for question, unmarked_count in question_unmarked_map %}
<li data-markcount={{unmarked_count}} {% if unmarked_count %}class="unmarked" {% endif %}><a
href="{% url 'longs:mark_question_overview' pk=exam.pk sk=forloop.counter0 %}">Question {{forloop.counter }}:
href="{% url 'longs:mark_question_overview' exam_id=exam.pk sk=forloop.counter0 %}">Question {{forloop.counter }}:
{{ question }}</a><br /> Answers to mark: {{unmarked_count}}</li>
{% endfor %}
</ul>
+1 -1
View File
@@ -67,7 +67,7 @@ urlpatterns = [
name="question_review",
),
path("exam/<int:exam_id>/<int:question_number>/<int:cid>/mark", views.mark_answer, name="mark_answer"),
path("exam/<int:pk>/<int:sk>/mark", views.mark_question_overview, name="mark_question_overview"),
path("exam/<int:exam_id>/<int:sk>/mark", views.mark_question_overview, name="mark_question_overview"),
path("exam/<int:pk>/mark", views.LongExamViews.mark_overview, name="mark_overview"),
# path("exam/<int:pk>/<int:sk>/", views.exam_take, name="exam_take"),
path(
+3 -3
View File
@@ -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()