From 2f8cb1ac17bd2f3b6f02761e60e448bfc79d0f84 Mon Sep 17 00:00:00 2001 From: Bianca Severino Date: Tue, 16 Mar 2021 13:15:47 -0400 Subject: [PATCH] Update error message for proctored exams --- CHANGELOG.rst | 6 ++++ edx_proctoring/__init__.py | 2 +- edx_proctoring/api.py | 36 ++++++++++--------- .../templates/proctored_exam/error.html | 30 ++++++++-------- edx_proctoring/tests/test_student_view.py | 2 +- package.json | 2 +- 6 files changed, 45 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6822b039b64..8195760cdf7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,12 @@ Change Log Unreleased ~~~~~~~~~~ +[3.7.13] - 2021-03-16 +~~~~~~~~~~~~~~~~~~~~~ +* Update proctored exam error message to remove statement that the user must restart their exam + from scratch, and include a proctoring escalation email rather than a link to support if + applicable. + [3.7.12] - 2021-03-15 ~~~~~~~~~~~~~~~~~~~~~ * Update the onboarding status to take into account sections that are not accessible to the user diff --git a/edx_proctoring/__init__.py b/edx_proctoring/__init__.py index da0210172ff..d2d28f5f764 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.7.12' +__version__ = '3.7.13' default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name diff --git a/edx_proctoring/api.py b/edx_proctoring/api.py index b4905729fbf..738c5f6a6c0 100644 --- a/edx_proctoring/api.py +++ b/edx_proctoring/api.py @@ -1332,22 +1332,7 @@ def create_proctoring_attempt_status_email(user_id, exam_attempt_obj, course_nam # If the course has a proctoring escalation email set, use that rather than edX Support. # Currently only courses using Proctortrack will have this set. - proctoring_escalation_email = None - instructor_service = get_runtime_service('instructor') - if instructor_service: - try: - proctoring_escalation_email = instructor_service.get_proctoring_escalation_email(course_id) - except (InvalidKeyError, ObjectDoesNotExist): - log.warning( - 'While creating proctoring status email for user_id={user_id} in exam_id={exam_id}, ' - 'could not retrieve proctoring escalation email with course_id={course_id}. Using ' - 'default contact URL.'.format( - user_id=user_id, - exam_id=exam_attempt_obj.proctored_exam.id, - course_id=course_id, - ) - ) - + proctoring_escalation_email = _get_proctoring_escalation_email(course_id) if proctoring_escalation_email: contact_url = 'mailto:{}'.format(proctoring_escalation_email) contact_url_text = proctoring_escalation_email @@ -1398,6 +1383,24 @@ def _get_email_template_paths(template_name, backend): return [base_template] +def _get_proctoring_escalation_email(course_id): + """ + Returns the proctoring escalation email for a course as a string, if it exists, + otherwise returns None. + """ + proctoring_escalation_email = None + instructor_service = get_runtime_service('instructor') + if instructor_service: + try: + proctoring_escalation_email = instructor_service.get_proctoring_escalation_email(course_id) + except (InvalidKeyError, ObjectDoesNotExist): + log.warning( + 'Could not retrieve proctoring escalation email for course_id={course_id}. ' + 'Using default support contact URL instead.'.format(course_id=course_id) + ) + return proctoring_escalation_email + + def reset_practice_exam(exam_id, user_id, requesting_user): """ Resets a completed practice exam attempt back to the created state. @@ -2137,6 +2140,7 @@ def _get_proctored_exam_context(exam, attempt, user_id, course_id, is_practice_e ) if attempt else '', 'link_urls': settings.PROCTORING_SETTINGS.get('LINK_URLS', {}), 'tech_support_email': settings.TECH_SUPPORT_EMAIL, + 'proctoring_escalation_email': _get_proctoring_escalation_email(course_id), 'exam_review_policy': _get_review_policy_by_exam_id(exam['id']), 'backend_js_bundle': provider.get_javascript(), 'provider_tech_support_email': provider.tech_support_email, diff --git a/edx_proctoring/templates/proctored_exam/error.html b/edx_proctoring/templates/proctored_exam/error.html index 7040d1afe5d..db194212e27 100644 --- a/edx_proctoring/templates/proctored_exam/error.html +++ b/edx_proctoring/templates/proctored_exam/error.html @@ -6,19 +6,21 @@

{% endblocktrans %}

-

- {% blocktrans %} - A technical error has occurred with your proctored exam. Please - reach out to - edX Support and your course team immediately for assistance. - {% endblocktrans %} -

-

- {% blocktrans %} - Once the error is resolved, you will need to restart the exam - and answer all questions again. If you have concerns about your - proctoring session results, please contact your course team. - {% endblocktrans %} -

+

+ {% if proctoring_escalation_email %} + {% blocktrans %} + A system error has occurred with your proctored exam. Please reach out to your course + team at {{proctoring_escalation_email}} + for assistance, and return to the exam once you receive further instructions. + {% endblocktrans %} + {% else %} + {% blocktrans %} + A system error has occurred with your proctored exam. Please reach out to + {{platform_name}} Support for + assistance, and return to the exam once you receive further instructions. + {% endblocktrans %} + {% endif %} +

+ {% include 'proctored_exam/footer.html' %} diff --git a/edx_proctoring/tests/test_student_view.py b/edx_proctoring/tests/test_student_view.py index c732a06534a..d5996254837 100644 --- a/edx_proctoring/tests/test_student_view.py +++ b/edx_proctoring/tests/test_student_view.py @@ -67,7 +67,7 @@ def setUp(self): self.timed_exam_submitted_expired = 'The time allotted for this exam has expired. Your exam has been submitted' self.submitted_timed_exam_msg_with_due_date = 'After the due date has passed,' self.exam_time_expired_msg = 'You did not complete the exam in the allotted time' - self.exam_time_error_msg = 'A technical error has occurred with your proctored exam' + self.exam_time_error_msg = 'A system error has occurred with your proctored exam' self.chose_proctored_exam_msg = 'Set up and start your proctored exam' self.proctored_exam_optout_msg = 'Take this exam without proctoring' self.proctored_exam_completed_msg = 'Are you sure you want to end your proctored exam' diff --git a/package.json b/package.json index 2736b045472..33de9ee8b8b 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.7.12", + "version": "3.7.13", "main": "edx_proctoring/static/index.js", "scripts":{ "test":"gulp test"