Skip to content

Commit

Permalink
Merge pull request #540 from edx/dcs/not-reviewed
Browse files Browse the repository at this point in the history
Move attempt to error state if it comes back as not reviewed
  • Loading branch information
davestgermain authored Feb 21, 2019
2 parents 9272270 + 7c71b5c commit 936186a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion edx_proctoring/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from edx_proctoring import api
from edx_proctoring import constants
from edx_proctoring import models
from edx_proctoring.statuses import ProctoredExamStudentAttemptStatus
from edx_proctoring.statuses import ProctoredExamStudentAttemptStatus, SoftwareSecureReviewStatus
from edx_proctoring.utils import emit_event, locate_attempt_by_attempt_code
from edx_proctoring.backends import get_backend_provider

Expand Down Expand Up @@ -141,6 +141,8 @@ def finish_review_workflow(sender, instance, signal, **kwargs): # pylint: disab
# eligibility table
if review.is_passing:
attempt_status = ProctoredExamStudentAttemptStatus.verified
elif review.review_status == SoftwareSecureReviewStatus.not_reviewed:
attempt_status = ProctoredExamStudentAttemptStatus.error
elif review.reviewed_by or not constants.REQUIRE_FAILURE_SECOND_REVIEWS:
# reviews from the django admin have a reviewer set. They should be allowed to
# reject an attempt
Expand Down
11 changes: 11 additions & 0 deletions edx_proctoring/tests/test_reviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,17 @@ def test_failure_submission_rejected(self):
self.assertEqual(attempt['status'], expected_status)
self.assertEqual(review.review_status, SoftwareSecureReviewStatus.suspicious)

def test_failure_not_reviewed(self):
"""
Tests that a review which comes back as "not reviewed"
transitions to an error state
"""
test_payload = self.get_review_payload(ReviewStatus.not_reviewed)
ProctoredExamReviewCallback().make_review(self.attempt, test_payload)

attempt = get_exam_attempt_by_id(self.attempt_id)
self.assertEqual(attempt['status'], ProctoredExamStudentAttemptStatus.error)

def test_update_archived_attempt(self):
"""
Test calling the interface point with an attempt_code that was archived
Expand Down

0 comments on commit 936186a

Please sign in to comment.