From d4f7266342c0f80c99dd58715efdb11a3c58f06c Mon Sep 17 00:00:00 2001 From: Bianca Severino Date: Thu, 3 Jun 2021 14:53:22 -0400 Subject: [PATCH] feat: disable IDV check if integrity signature is enabled --- CHANGELOG.rst | 5 +++++ edx_proctoring/__init__.py | 2 +- edx_proctoring/api.py | 8 ++++++-- edx_proctoring/tests/test_student_view.py | 13 +++++++++++++ package.json | 2 +- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 293b1921dec..d4a48c02710 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,11 @@ Change Log Unreleased ~~~~~~~~~~ +[3.12.0] - 2021-06-04 +~~~~~~~~~~~~~~~~~~~~~ +* If the `is_integrity_signature_enabled` waffle flag is turned on, do not render the ID verification + template for proctored exams. + [3.11.6] - 2021-06-03 ~~~~~~~~~~~~~~~~~~~~~ * Add logging for attempt status transitions caused by a time out or reattempt diff --git a/edx_proctoring/__init__.py b/edx_proctoring/__init__.py index 6a1d46c023e..6f0091677b7 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__ = '3.11.6' +__version__ = '3.12.0' default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name diff --git a/edx_proctoring/api.py b/edx_proctoring/api.py index 42bc3c1fff8..7f806c4df91 100644 --- a/edx_proctoring/api.py +++ b/edx_proctoring/api.py @@ -2491,8 +2491,12 @@ def _get_proctored_exam_view(exam, context, exam_id, user_id, course_id): return None elif attempt_status in [ProctoredExamStudentAttemptStatus.created, ProctoredExamStudentAttemptStatus.download_software_clicked]: - if context.get('verification_status') is not APPROVED_STATUS: - # if the user has not id verified yet, show them the page that requires them to do so + if not ( + context.get('is_integrity_signature_enabled') + or context.get('verification_status') is APPROVED_STATUS + ): + # if the user has not id verified yet, show them the page that requires them to do so, + # unless the integrity signature feature is enabled student_view_template = 'proctored_exam/id_verification.html' else: student_view_template = 'proctored_exam/instructions.html' diff --git a/edx_proctoring/tests/test_student_view.py b/edx_proctoring/tests/test_student_view.py index 2cc7ad9e5b6..c267ea8ae15 100644 --- a/edx_proctoring/tests/test_student_view.py +++ b/edx_proctoring/tests/test_student_view.py @@ -99,6 +99,7 @@ def _render_exam(self, content_id, context_overrides=None): }, 'verification_status': 'approved', 'verification_url': '/reverify', + 'is_integrity_signature_enabled': False, } if context_overrides: context.update(context_overrides) @@ -202,6 +203,18 @@ def test_verification_status(self, verification_status, expected_message): }) self.assertIn(expected_message, rendered_response) + def test_integrity_signature_enabled(self): + """ + This test asserts that the ID verification message is not shown if the + integrity signature feature is enabled. + """ + self._create_unstarted_exam_attempt() + rendered_response = self.render_proctored_exam({ + 'verification_status': None, + 'is_integrity_signature_enabled': True, + }) + self.assertIn(self.chose_proctored_exam_msg, rendered_response) + def test_proctored_only_entrance(self): """ This test verifies that learners are not given the option to take diff --git a/package.json b/package.json index 1f2c23de08e..eb7222fdf7c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@edx/edx-proctoring", "//": "Be sure to update the version number in edx_proctoring/__init__.py", "//": "Note that the version format is slightly different than that of the Python version when using prereleases.", - "version": "3.11.6", + "version": "3.12.0", "main": "edx_proctoring/static/index.js", "scripts": { "test": "gulp test"