This commit is contained in:
Ross
2021-09-11 19:30:31 +01:00
parent bb8768db73
commit 18122e9957
+10
View File
@@ -725,6 +725,16 @@ def mark_answer(request, exam_id, question_number, cid):
mark_object.marker = request.user
mark_object.save()
# Form is saved, check if we have two marks (and if they match)
if answer.mark.count() == 2:
# if they do automatically update teh scoer
marks = set(answer.mark.values_list("score", flat=True))
if len(marks) == 1:
answer.score = marks[0]
answer.save()
if "next" in request.POST:
return redirect("longs:mark_answer", exam_id=exam_id, question_number=question_number, cid=next_unmarked_id)
if "save" in request.POST: