Esempio n. 1
0
 def post(self, request, external_id):
     """
     Called when 3rd party proctoring service has finished its review of
     an attempt.
     """
     attempt = get_exam_attempt_by_external_id(external_id)
     if attempt is None:
         raise StudentExamAttemptDoesNotExistsException('not found')
     self.make_review(attempt, request.data)
     return Response(data='OK')
Esempio n. 2
0
 def post(self, request, external_id):  # pylint: disable=unused-argument
     """
     Post callback handler
     """
     attempt = get_exam_attempt_by_external_id(external_id)
     if not attempt:
         LOG.warning(u"Attempt code %r cannot be found.", external_id)
         return Response(data='You have entered an exam code that is not valid.', status=404)
     if attempt['status'] in [ProctoredExamStudentAttemptStatus.created,
                              ProctoredExamStudentAttemptStatus.download_software_clicked]:
         mark_exam_attempt_as_ready(attempt['proctored_exam']['id'], attempt['user']['id'])
     return Response(data='OK')
Esempio n. 3
0
 def post(self, request, external_id):  # pylint: disable=unused-argument
     """
     Post callback handler
     """
     attempt = get_exam_attempt_by_external_id(external_id)
     if not attempt:
         LOG.warning("Attempt code %r cannot be found.", external_id)
         return Response(data='You have entered an exam code that is not valid.', status=404)
     if attempt['status'] in [ProctoredExamStudentAttemptStatus.created,
                              ProctoredExamStudentAttemptStatus.download_software_clicked]:
         mark_exam_attempt_as_ready(attempt['proctored_exam']['id'], attempt['user']['id'])
     return Response(data='OK')
Esempio n. 4
0
 def post(self, request, external_id):
     """
     Called when 3rd party proctoring service has finished its review of
     an attempt.
     """
     attempt = get_exam_attempt_by_external_id(external_id)
     if attempt is None:
         raise StudentExamAttemptDoesNotExistsException('not found')
     if request.user.has_perm('edx_proctoring.can_review_attempt', attempt):
         self.make_review(attempt, request.data)
         resp = Response(data='OK')
     else:
         resp = Response(status=403)
     return resp
Esempio n. 5
0
 def post(self, request, external_id):
     """
     Called when 3rd party proctoring service has finished its review of
     an attempt.
     """
     attempt = get_exam_attempt_by_external_id(external_id)
     if attempt is None:
         raise StudentExamAttemptDoesNotExistsException('not found')
     if request.user.has_perm('edx_proctoring.can_review_attempt', attempt):
         self.make_review(attempt, request.data)
         resp = Response(data='OK')
     else:
         resp = Response(status=403)
     return resp
Esempio n. 6
0
 def post(self, request, external_id):
     """
     Called when 3rd party proctoring service has finished its review of
     an attempt.
     """
     attempt = get_exam_attempt_by_external_id(external_id)
     if attempt is None:
         err_msg = (
             u'Attempted to access external exam id {external_id} but '
             u'it does not exist.'.format(external_id=external_id))
         raise StudentExamAttemptDoesNotExistsException(err_msg)
     if request.user.has_perm('edx_proctoring.can_review_attempt', attempt):
         self.make_review(attempt, request.data)
         resp = Response(data='OK')
     else:
         resp = Response(status=403)
     return resp