Commit f0d18ad1 by chrisndodge

Merge pull request #192 from edx/cdodge/dont-auto-decline-on-failures

only declines should cascade downwards. If a previous ICRV failed, th…
parents a89c119c 6fb77f5a
...@@ -643,11 +643,11 @@ def update_attempt_status(exam_id, user_id, to_status, raise_if_not_found=True, ...@@ -643,11 +643,11 @@ def update_attempt_status(exam_id, user_id, to_status, raise_if_not_found=True,
# we just want other exams which are proctored and are not practice # we just want other exams which are proctored and are not practice
exams = [ exams = [
exam _exam
for exam in _exams for _exam in _exams
if ( if (
exam.content_id != exam_attempt_obj.proctored_exam.content_id and _exam.content_id != exam_attempt_obj.proctored_exam.content_id and
exam.is_proctored and not exam.is_practice_exam _exam.is_proctored and not _exam.is_practice_exam
) )
] ]
......
...@@ -194,10 +194,10 @@ class ProctoredExamStudentAttemptStatus(object): ...@@ -194,10 +194,10 @@ class ProctoredExamStudentAttemptStatus(object):
def is_a_cascadable_failure(cls, to_status): def is_a_cascadable_failure(cls, to_status):
""" """
Returns a boolean if the passed in to_status has a failure that needs to be cascaded Returns a boolean if the passed in to_status has a failure that needs to be cascaded
to other attempts. to other unattempted exams.
""" """
return to_status in [ return to_status in [
cls.rejected, cls.declined cls.declined
] ]
@classmethod @classmethod
......
...@@ -1426,13 +1426,13 @@ class ProctoredExamApiTests(LoggedInTestCase): ...@@ -1426,13 +1426,13 @@ class ProctoredExamApiTests(LoggedInTestCase):
ProctoredExamStudentAttemptStatus.rejected, ProctoredExamStudentAttemptStatus.rejected,
False, False,
None, None,
ProctoredExamStudentAttemptStatus.declined None
), ),
( (
ProctoredExamStudentAttemptStatus.rejected, ProctoredExamStudentAttemptStatus.rejected,
True, True,
ProctoredExamStudentAttemptStatus.created, ProctoredExamStudentAttemptStatus.created,
ProctoredExamStudentAttemptStatus.declined ProctoredExamStudentAttemptStatus.created
), ),
( (
ProctoredExamStudentAttemptStatus.rejected, ProctoredExamStudentAttemptStatus.rejected,
...@@ -1511,8 +1511,11 @@ class ProctoredExamApiTests(LoggedInTestCase): ...@@ -1511,8 +1511,11 @@ class ProctoredExamApiTests(LoggedInTestCase):
# make sure an attempt was made for second_exam # make sure an attempt was made for second_exam
second_exam_attempt = get_exam_attempt(second_exam_id, self.user_id) second_exam_attempt = get_exam_attempt(second_exam_id, self.user_id)
self.assertIsNotNone(second_exam_attempt) if expected_second_status:
self.assertEqual(second_exam_attempt['status'], expected_second_status) self.assertIsNotNone(second_exam_attempt)
self.assertEqual(second_exam_attempt['status'], expected_second_status)
else:
self.assertIsNone(second_exam_attempt)
# no auto-generated attempts for practice and timed exams # no auto-generated attempts for practice and timed exams
self.assertIsNone(get_exam_attempt(practice_exam_id, self.user_id)) self.assertIsNone(get_exam_attempt(practice_exam_id, self.user_id))
......
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