.
This commit is contained in:
+13
-1
@@ -192,7 +192,19 @@ class Long(models.Model):
|
||||
else:
|
||||
answers = self.cid_user_answers.filter(exam__id=exam_pk)
|
||||
|
||||
return [ans for ans in answers if not ans.is_marked()]
|
||||
unmarked_answers = [ans for ans in answers if not ans.is_marked()]
|
||||
|
||||
if marker is None:
|
||||
return unmarked_answers
|
||||
|
||||
# If marker is specified we check for what they have marker
|
||||
marker_unmarked = []
|
||||
for answer in unmarked_answers:
|
||||
if answer.mark.filter(marker=marker).count() < 1:
|
||||
marker_unmarked.append(answer)
|
||||
|
||||
return marker_unmarked
|
||||
|
||||
|
||||
def get_question_json(self, based=True):
|
||||
# self == q?
|
||||
|
||||
@@ -671,7 +671,10 @@ def mark_answer(request, exam_id, question_number, cid):
|
||||
previous_cid = cid_list[cid_list.index(cid)-1]
|
||||
|
||||
try:
|
||||
if exam.double_mark:
|
||||
unmarked = question.get_unmarked_answers(exam_pk=exam.id, marker=request.user)
|
||||
else:
|
||||
unmarked = question.get_unmarked_answers(exam_pk=exam.id)
|
||||
next_unmarked_id = unmarked[0].cid
|
||||
if next_unmarked_id == cid:
|
||||
next_unmarked_id = unmarked[1].cid
|
||||
|
||||
Reference in New Issue
Block a user