Commit 08e4928f by Chris Dodge

remove useless line

parent 4f839e65
...@@ -603,7 +603,7 @@ def update_attempt_status(exam_id, user_id, to_status, raise_if_not_found=True, ...@@ -603,7 +603,7 @@ def update_attempt_status(exam_id, user_id, to_status, raise_if_not_found=True,
if cascade_effects: if cascade_effects:
# some state transitions (namely to a rejected or declined status) # some state transitions (namely to a rejected or declined status)
# will mark other exams as declined because once we fail or decline # will mark other exams as declined because once we fail or decline
# one exam all other (un-completed) proctored exams will we likewise # one exam all other (un-completed) proctored exams will be likewise
# updated to reflect a declined status # updated to reflect a declined status
cascade_failure = to_status in [ cascade_failure = to_status in [
ProctoredExamStudentAttemptStatus.rejected, ProctoredExamStudentAttemptStatus.rejected,
...@@ -627,23 +627,23 @@ def update_attempt_status(exam_id, user_id, to_status, raise_if_not_found=True, ...@@ -627,23 +627,23 @@ def update_attempt_status(exam_id, user_id, to_status, raise_if_not_found=True,
] ]
for exam in exams: for exam in exams:
if exam.content_id != exam_attempt_obj.proctored_exam.content_id: # see if there was an attempt on those other exams already
# make sure there was no attempt attempt = get_exam_attempt(exam.id, user_id)
attempt = get_exam_attempt(exam.id, user_id) if attempt and ProctoredExamStudentAttemptStatus.is_completed_status(attempt['status']):
if attempt and ProctoredExamStudentAttemptStatus.is_completed_status(attempt['status']): # don't touch any completed statuses
# don't touch any completed statuses # we won't revoke those
continue continue
if not attempt: if not attempt:
create_exam_attempt(exam.id, user_id, taking_as_proctored=False) create_exam_attempt(exam.id, user_id, taking_as_proctored=False)
# update any new or existing status to declined # update any new or existing status to declined
update_attempt_status( update_attempt_status(
exam.id, exam.id,
user_id, user_id,
ProctoredExamStudentAttemptStatus.declined, ProctoredExamStudentAttemptStatus.declined,
cascade_effects=False cascade_effects=False
) )
if to_status == ProctoredExamStudentAttemptStatus.submitted: if to_status == ProctoredExamStudentAttemptStatus.submitted:
# also mark the exam attempt completed_at timestamp # also mark the exam attempt completed_at timestamp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment