def test_get_user_attempts(self): """ Test adding verification status. """ VerificationStatus.add_verification_status( checkpoint=self.first_checkpoint, user=self.user, status='submitted') actual_attempts = VerificationStatus.get_user_attempts( self.user.id, self.course.id, self.first_checkpoint_location) self.assertEqual(actual_attempts, 1)
def get_attempts(self, user_id, course_id, related_assessment_location): """Get re-verification attempts against a user for a given 'checkpoint' and 'course_id'. Args: user_id(str): User Id string course_id(str): A string of course id related_assessment_location(str): Location of Reverification XBlock Returns: Number of re-verification attempts of a user """ course_key = CourseKey.from_string(course_id) return VerificationStatus.get_user_attempts(user_id, course_key, related_assessment_location)
def test_get_user_attempts(self): """ Test adding verification status. """ VerificationStatus.add_verification_status( checkpoint=self.first_checkpoint, user=self.user, status='submitted' ) actual_attempts = VerificationStatus.get_user_attempts( self.user.id, self.course.id, self.first_checkpoint_location ) self.assertEqual(actual_attempts, 1)