This commit is contained in:
Ross
2021-09-12 10:57:28 +01:00
parent 2a536f20d6
commit 2d04568e9f
2 changed files with 25 additions and 2 deletions
+14
View File
@@ -406,6 +406,20 @@ class ExamViews(View, LoginRequiredMixin):
questions = exam.exam_questions.all()
# Long cases require some special info
try:
if exam.double_mark:
question_unmarked_map = []
for q in questions:
question_unmarked_map.append((q, int(q.get_unmarked_answer_count(exam_pk=exam.pk)), int(q.get_unmarked_answer_count(exam_pk=exam.pk, marker=request.user)) ))
return render(
request, "{}/mark_overview.html".format(self.app_name), {"exam": exam, "question_unmarked_map": question_unmarked_map})
)
except AttributeError:
pass
question_unmarked_map = []
for q in questions:
question_unmarked_map.append((q, int(q.get_unmarked_answer_count(exam_pk=exam.pk))))
+11 -2
View File
@@ -12,10 +12,19 @@
marking</button></a></div>
<ul id="question-mark-list">
{% for question, unmarked_count in question_unmarked_map %}
{% for question, unmarked_count, unmarked_count_marker in question_unmarked_map %}
<li data-markcount={{unmarked_count}} {% if unmarked_count %}class="unmarked" {% endif %}><a
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>
{{ question }}</a><br /> Answers incompletely marked: {{unmarked_count}}
{% if exam.double_mark %}
<br/>
Answers left for you to mark: {{unmarked_count_marker}}
{% endif %}
</li>
{% endfor %}
</ul>
</div>