diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6b56e1f6943..2bc32bca12f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,10 @@ Change Log Unreleased ~~~~~~~~~~ +[4.7.1] - 2021-11-16 +~~~~~~~~~~~~~~~~~~~~ +* Assign interstitial to timed exam status + [4.7.0] - 2021-11-08 ~~~~~~~~~~~~~~~~~~~~ * Convert onboarding profile API waffle flag to Django setting. diff --git a/edx_proctoring/__init__.py b/edx_proctoring/__init__.py index b33e3d16995..9b63b889c6f 100644 --- a/edx_proctoring/__init__.py +++ b/edx_proctoring/__init__.py @@ -3,6 +3,6 @@ """ # Be sure to update the version number in edx_proctoring/package.json -__version__ = '4.7.0' +__version__ = '4.7.1' default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name diff --git a/edx_proctoring/api.py b/edx_proctoring/api.py index 121f31aba02..3c8a8b3c721 100644 --- a/edx_proctoring/api.py +++ b/edx_proctoring/api.py @@ -2464,7 +2464,7 @@ def _get_timed_exam_view(exam, context, exam_id, user_id, course_id): attempt_status = attempt['status'] if attempt else None has_due_date = exam['due_date'] is not None - if not attempt_status: + if not attempt_status or attempt_status == ProctoredExamStudentAttemptStatus.created: if is_exam_passed_due(exam, user=user_id): student_view_template = 'timed_exam/expired.html' else: diff --git a/edx_proctoring/tests/test_student_view.py b/edx_proctoring/tests/test_student_view.py index f00cb52bea9..eb3164389e6 100644 --- a/edx_proctoring/tests/test_student_view.py +++ b/edx_proctoring/tests/test_student_view.py @@ -1439,6 +1439,27 @@ def test_get_studentview_completed_timed_exam(self, status, expected_content): ) self.assertIn(expected_content, rendered_response) + def test_get_studentview_created_timed_exam(self): + """ + Test that get_student_view for a created timed exam returns interstitial + """ + self._create_unstarted_exam_attempt(is_proctored=False) + + rendered_response = get_student_view( + user_id=self.user_id, + course_id=self.course_id, + content_id=self.content_id_timed, + context={ + 'display_name': self.exam_name, + } + ) + self.assertNotIn( + f'data-exam-id="{self.proctored_exam_id}"', + rendered_response + ) + self.assertIn(self.timed_exam_msg.format(exam_name=self.exam_name), rendered_response) + self.assertNotIn(self.start_an_exam_msg, rendered_response) + def test_expired_exam(self): """ Test that an expired exam shows a difference message when the exam is expired just recently diff --git a/package.json b/package.json index 79bc238982a..d705d3c471e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@edx/edx-proctoring", "//": "Note that the version format is slightly different than that of the Python version when using prereleases.", - "version": "4.7.0", + "version": "4.7.1", "main": "edx_proctoring/static/index.js", "scripts": { "test": "gulp test"