diff --git a/edx_proctoring/__init__.py b/edx_proctoring/__init__.py index 582c7208591..d4d4cc76872 100644 --- a/edx_proctoring/__init__.py +++ b/edx_proctoring/__init__.py @@ -5,6 +5,6 @@ from __future__ import absolute_import # Be sure to update the version number in edx_proctoring/package.json -__version__ = '1.5.2' +__version__ = '1.5.3' default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name diff --git a/edx_proctoring/api.py b/edx_proctoring/api.py index 60c112524d3..986ce084014 100644 --- a/edx_proctoring/api.py +++ b/edx_proctoring/api.py @@ -1715,7 +1715,9 @@ def _get_proctored_exam_context(exam, attempt, user_id, course_id, is_practice_e except NoReverseMatch: log.exception("Can't find progress url for course %s", course_id) - return { + provider = get_backend_provider(exam) + + context = { 'platform_name': settings.PLATFORM_NAME, 'total_time': total_time, 'exam_id': exam['id'], @@ -1740,7 +1742,21 @@ def _get_proctored_exam_context(exam, attempt, user_id, course_id, is_practice_e 'link_urls': settings.PROCTORING_SETTINGS.get('LINK_URLS', {}), 'tech_support_email': settings.TECH_SUPPORT_EMAIL, '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, + 'provider_tech_support_phone': provider.tech_support_phone, + 'provider_name': provider.verbose_name, } + if attempt: + provider_attempt = provider.get_attempt(attempt) + download_url = provider_attempt.get('download_url', None) or provider.get_software_download_url() + + context.update({ + 'exam_code': attempt['attempt_code'], + 'backend_instructions': provider_attempt.get('instructions', None), + 'software_download_url': download_url, + }) + return context def _get_practice_exam_view(exam, context, exam_id, user_id, course_id): @@ -1752,7 +1768,6 @@ def _get_practice_exam_view(exam, context, exam_id, user_id, course_id): attempt = get_exam_attempt(exam_id, user_id) attempt_status = attempt['status'] if attempt else None - provider = get_backend_provider(exam) if attempt_status == ProctoredExamStudentAttemptStatus.started: # when we're taking the exam we should not override the view @@ -1772,14 +1787,7 @@ def _get_practice_exam_view(exam, context, exam_id, user_id, course_id): ProctoredExamStudentAttemptStatus.created, ProctoredExamStudentAttemptStatus.download_software_clicked, ]: - provider_attempt = provider.get_attempt(attempt) student_view_template = 'proctored_exam/instructions.html' - context.update({ - 'exam_code': attempt['attempt_code'], - 'backend_instructions': provider_attempt.get('instructions', None), - 'software_download_url': (provider_attempt.get('download_url', None) - or provider.get_software_download_url()), - }) else: # note: then the status must be ready_to_start student_view_template = 'proctored_exam/ready_to_start.html' @@ -1791,7 +1799,6 @@ def _get_practice_exam_view(exam, context, exam_id, user_id, course_id): student_view_template = 'proctored_exam/ready_to_submit.html' if student_view_template: - context['backend_js_bundle'] = provider.get_javascript() template = loader.get_template(student_view_template) context.update(_get_proctored_exam_context(exam, attempt, user_id, course_id, is_practice_exam=True)) return template.render(context) @@ -1827,8 +1834,6 @@ def _get_proctored_exam_view(exam, context, exam_id, user_id, course_id): if attempt_status == ProctoredExamStudentAttemptStatus.declined: return None - provider = get_backend_provider(exam) - if attempt_status == ProctoredExamStudentAttemptStatus.started: # when we're taking the exam we should not override the view return None @@ -1909,14 +1914,7 @@ def _get_proctored_exam_view(exam, context, exam_id, user_id, course_id): ProctoredExamStudentAttemptStatus.created, ProctoredExamStudentAttemptStatus.download_software_clicked, ]: - provider_attempt = provider.get_attempt(attempt) student_view_template = 'proctored_exam/instructions.html' - download_url = provider_attempt.get('download_url', None) or provider.get_software_download_url() - context.update({ - 'exam_code': attempt['attempt_code'], - 'backend_instructions': provider_attempt.get('instructions', None), - 'software_download_url': download_url - }) else: # note: then the status must be ready_to_start student_view_template = 'proctored_exam/ready_to_start.html' @@ -1950,7 +1948,6 @@ def _get_proctored_exam_view(exam, context, exam_id, user_id, course_id): student_view_template = 'proctored_exam/ready_to_submit.html' if student_view_template: - context['backend_js_bundle'] = provider.get_javascript() template = loader.get_template(student_view_template) context.update(_get_proctored_exam_context(exam, attempt, user_id, course_id)) return template.render(context) diff --git a/edx_proctoring/backends/backend.py b/edx_proctoring/backends/backend.py index 0841b5046f2..dc30ab3a51f 100644 --- a/edx_proctoring/backends/backend.py +++ b/edx_proctoring/backends/backend.py @@ -14,6 +14,8 @@ class ProctoringBackendProvider(six.with_metaclass(abc.ABCMeta)): """ verbose_name = u'Unknown' ping_interval = constants.DEFAULT_DESKTOP_APPLICATION_PING_INTERVAL_SECONDS + tech_support_email = '' + tech_support_phone = '' # whether this backend supports an instructor review/configuration dashboard has_dashboard = False diff --git a/edx_proctoring/templates/proctored_exam/instructions.html b/edx_proctoring/templates/proctored_exam/instructions.html index ccaa9904e08..8b1c5da032a 100644 --- a/edx_proctoring/templates/proctored_exam/instructions.html +++ b/edx_proctoring/templates/proctored_exam/instructions.html @@ -8,13 +8,31 @@

{% endblocktrans %}

{% if backend_instructions %} - {% for instruction in backend_instructions %} -

{{instruction|safe}}

- {% endfor %}

- {% trans "Start System Check" %} + {% blocktrans %} + Note: As part of the proctored exam setup, you will be asked + to verify your identity. Before you begin, make sure you are + on a computer with a webcam, and that you have a valid form + of photo identification such as a driver’s license or + passport. + {% endblocktrans %}

- +
    + {% for instruction in backend_instructions %} +
  1. {{instruction|safe}}
  2. + {% endfor %} +
+ {% if provider_tech_support_email and provider_tech_support_phone %} +

+ {% blocktrans %} + If you have issues relating to proctoring, you can contact {{ provider_name }} technical support by emailing {{ provider_tech_support_email }} or by calling {{ provider_tech_support_phone }}. + {% endblocktrans %} +

+ {% endif %} + + {% else %}

{% blocktrans %} @@ -54,12 +72,12 @@

3. When you have finished setting up proctoring, start the exam. {% endblocktrans %}

- {% endif %}
+ {% endif %} {% include 'proctored_exam/error_modal.html' %} @@ -109,7 +127,6 @@

} ); - function check_exam_started() { var url = $('.instructions').data('exam-started-poll-url') + '?sourceid=instructions'; $.ajax(url).success(function(data){ @@ -128,19 +145,6 @@

}); } - function poll_until_ready() { - var url = $('.instructions').data('exam-started-poll-url') + '?sourceid=instructions'; - $.ajax(url).success(function(data){ - if (data.status === 'ready_to_start') { - // we've state transitioned, so refresh the page - // to reflect the new state (which will expose the test) - location.reload(); - } else { - setTimeout(poll_until_ready, 5000); - } - }); - } - $('.start-proctored-exam').click(check_exam_started); $("#software_download_link").click(function (e) { diff --git a/package.json b/package.json index 564bad7dba4..fbc7707d78a 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": "1.5.2", + "version": "1.5.3", "main": "edx_proctoring/static/index.js", "repository": { "type": "git",