Skip to content

Commit

Permalink
Add reset button to onboarding exams (#725)
Browse files Browse the repository at this point in the history
* add reset button to onboarding exams
  • Loading branch information
zacharis278 authored Dec 9, 2020
1 parent 85772d9 commit e662097
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ Change Log
Unreleased
~~~~~~~~~~

[2.5.0] - 2020-12-09
~~~~~~~~~~~~~~~~~~~~

* Changed behavior of practice exam reset to create a new exam attempt instead
of rolling back state of the current attempt.
* Added new proctoring info panel to expose onboarding exam status to learners
* Added option to reset a failed or pending onboarding exam.

[2.4.9] - 2020-11-17
~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion edx_proctoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"""

# Be sure to update the version number in edx_proctoring/package.json
__version__ = '2.4.9'
__version__ = '2.5.0'

default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
39 changes: 31 additions & 8 deletions edx_proctoring/templates/onboarding_exam/rejected.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,37 @@
{% endblock %}

{% block body %}
<p>
{% blocktrans %}
Please contact
<a href="mailto:{{ integration_specific_email }}">
{{ integration_specific_email }}
</a> if you have questions, or to retry your onboarding exam.
{% endblocktrans %}
</p>

{% if experimental_proctoring_features %}
<p>
{% blocktrans %}
Please contact
<a href="mailto:{{ integration_specific_email }}">
{{ integration_specific_email }}
</a> if you have questions. You may retake this onboarding exam by clicking "Retry my exam".
{% endblocktrans %}
</p>
<div>
{% trans "Retry my exam" as retry_exam %}
<button type="button" class="exam-action-button proctored-reset-onboarding btn btn-pl-primary btn-base" data-action="reset_attempt" data-exam-id="{{exam_id}}" data-change-state-url="{{change_state_url}}" data-loading-text="<span class='fa fa-circle-o-notch fa-spin'></span> {% trans 'Resetting Onboarding Exam' %}" data-cta-text="{{ retry_exam }}">
{{ retry_exam }}
</button>
</div>
{% else %}
<p>
{% blocktrans %}
Please contact
<a href="mailto:{{ integration_specific_email }}">
{{ integration_specific_email }}
</a> if you have questions, or to retry your onboarding exam.
{% endblocktrans %}
</p>
{% endif %}
<script>
$('.exam-action-button').click(
edx.courseware.proctored_exam.updateStatusHandler
);
</script>
{% endblock %}

{% block footer_content %}
Expand Down
21 changes: 19 additions & 2 deletions edx_proctoring/templates/onboarding_exam/submitted.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,25 @@
so make sure this email has been added to your inbox filter.
{% endblocktrans %}
</p>

{% if experimental_proctoring_features %}
<p>
{% blocktrans %}
If you have made an error in this submission you may restart the onboarding process.
Your current submission will be removed and will not receive a review.
{% endblocktrans %}
</br>
{% trans "I understand and want to reset this onboarding exam." as retry_confirm %}
<button type="button" class="btn btn-link exam-action-confirm" data-cta-text="{{ retry_confirm }}">
{{ retry_confirm }}
</button>
</p>
<p>
{% trans "Retry my exam" as retry_exam %}
<button type="button" class="exam-action-button proctored-reset-onboarding btn btn-pl-primary btn-base" disabled data-action="reset_attempt" data-exam-id="{{exam_id}}" data-change-state-url="{{change_state_url}}" data-cta-text="{{ retry_exam }}">
{{ retry_exam }}
</button>
</p>
{% endif %}
<p>
{% blocktrans %}
Please contact
Expand All @@ -36,4 +54,3 @@
{% endblocktrans %}
</p>
{% endblock %}

6 changes: 6 additions & 0 deletions edx_proctoring/templates/practice_exam/submitted.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ <h3>
{% endblock %}
</div>
<script type="text/javascript">
$('.exam-action-confirm').click(function(event, ele) {
$('.exam-action-button').prop('disabled', false);
});
$('.exam-action-button').click(
edx.courseware.proctored_exam.updateStatusHandler
);
$('.start-timed-exam').click(
function(event) {
var action_url = $(this).data('ajax-url');
Expand Down
2 changes: 1 addition & 1 deletion edx_proctoring/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def put(self, request, attempt_id):
exam_attempt_id = reset_practice_exam(
attempt['proctored_exam']['id'],
request.user.id,
requesting_user=request.user.id,
requesting_user=request.user,
)
elif action == 'error':
backend = attempt['proctored_exam']['backend']
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": "2.4.9",
"version": "2.5.0",
"main": "edx_proctoring/static/index.js",
"repository": {
"type": "git",
Expand Down

0 comments on commit e662097

Please sign in to comment.