diff --git a/longs/models.py b/longs/models.py index 5269acaa..a7667c96 100644 --- a/longs/models.py +++ b/longs/models.py @@ -186,7 +186,7 @@ class Long(models.Model): return len([ans for ans in answers if not ans.is_marked()]) - def get_unmarked_answers(self, exam_pk=None): + def get_unmarked_answers(self, exam_pk=None, marker=None): if exam_pk is None: answers = self.cid_user_answers.all() else: diff --git a/longs/views.py b/longs/views.py index 07b283b1..a3f02919 100755 --- a/longs/views.py +++ b/longs/views.py @@ -671,7 +671,7 @@ def mark_answer(request, exam_id, question_number, cid): previous_cid = cid_list[cid_list.index(cid)-1] try: - unmarked = question.get_unmarked_answers() + unmarked = question.get_unmarked_answers(exam_pk=exam.id, marker=request.user) next_unmarked_id = unmarked[0].cid if next_unmarked_id == cid: next_unmarked_id = unmarked[1].cid