Skip to content

Commit

Permalink
swap CTA presentations for instructions page for proctortrack
Browse files Browse the repository at this point in the history
and update some presentational details

JIRA:EDUCATOR-3830
  • Loading branch information
Matt Hughes committed Jan 10, 2019
1 parent 425b8d1 commit 8388940
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 42 deletions.
2 changes: 1 addition & 1 deletion edx_proctoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
37 changes: 17 additions & 20 deletions edx_proctoring/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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):
Expand All @@ -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
Expand All @@ -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'
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions edx_proctoring/backends/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
44 changes: 24 additions & 20 deletions edx_proctoring/templates/proctored_exam/instructions.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,31 @@ <h3>
{% endblocktrans %}
</h3>
{% if backend_instructions %}
{% for instruction in backend_instructions %}
<p>{{instruction|safe}}</p>
{% endfor %}
<p>
<a href="#" id="software_download_link" data-action="click_download_software" target="_blank">{% trans "Start System Check" %}</a>
{% 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 %}
</p>

<ol>
{% for instruction in backend_instructions %}
<li>{{instruction|safe}}</li>
{% endfor %}
</ol>
{% if provider_tech_support_email and provider_tech_support_phone %}
<p>
{% 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 %}
</p>
{% endif %}
<button id="software_download_link" class="exam-action-button btn-pl-primary" data-action="click_download_software">{% trans "Start System Check" %}</button>
<div class="footer-sequence border-b-0 padding-b-0">
<a href="#" class="start-proctored-exam">{% trans "Start Proctored Exam" %}</a>
</div>
{% else %}
<p>
{% blocktrans %}
Expand Down Expand Up @@ -54,12 +72,12 @@ <h3>
3. When you have finished setting up proctoring, start the exam.
{% endblocktrans %}
</p>
{% endif %}
<div>
<button type="button" class="exam-action-button btn-pl-primary start-proctored-exam">
{% trans "Start Proctored Exam" %}
</button>
</div>
{% endif %}
</div>
</div>
{% include 'proctored_exam/error_modal.html' %}
Expand Down Expand Up @@ -109,7 +127,6 @@ <h3>
}
);


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

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) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 8388940

Please sign in to comment.