Skip to content

Commit

Permalink
Allow authors to remove option for unproctored exams
Browse files Browse the repository at this point in the history
TNL-5084
  • Loading branch information
andy-armstrong committed Oct 31, 2016
1 parent cb9e776 commit c12227d
Show file tree
Hide file tree
Showing 11 changed files with 232 additions and 439 deletions.
3 changes: 1 addition & 2 deletions edx_proctoring/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,6 @@ def _get_proctored_exam_view(exam, context, exam_id, user_id, course_id):
student_view_template = None

credit_state = context.get('credit_state')
verification_status = context.get('verification_status')

# see if only 'verified' track students should see this *except* if it is a practice exam
check_mode = (
Expand Down Expand Up @@ -1727,7 +1726,7 @@ 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 verification_status is not 'approved':
if context.get('verification_status') is not 'approved':
# if the user has not id verified yet, show them the page that requires them to do so
student_view_template = 'proctored_exam/id_verification.html'
else:
Expand Down
4 changes: 2 additions & 2 deletions edx_proctoring/templates/practice_exam/entrance.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ <h3>
on your grade in the course.
{% endblocktrans %}
</p>
<button class="gated-sequence start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false>
<button class="gated-sequence start-timed-exam action-primary" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false>
{% trans "Continue to my practice exam" %}
<p>
{% blocktrans %}
You will be guided through steps to set up online proctoring software and to perform various checks.
{% endblocktrans %}
</p>

<i class="fa fa-arrow-circle-right practice-exam start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false></i>
<span class="icon fa fa-arrow-circle-right" aria-hidden="true" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false></span>
</button>
</div>
{% include 'proctored_exam/footer.html' %}
Expand Down
4 changes: 2 additions & 2 deletions edx_proctoring/templates/practice_exam/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ <h4>
{% endblocktrans %}
</p>
<hr>
<button class="gated-sequence start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false>
<span><i class="fa fa-lock"></i></span>
<button class="gated-sequence start-timed-exam action-primary" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false>
<span class="icon fa fa-lock" aria-hidden="true"></span>
<a>
{% trans "Try this practice exam again" %}
</a>
Expand Down
2 changes: 1 addition & 1 deletion edx_proctoring/templates/practice_exam/submitted.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h3>
You have completed this practice exam and can continue with your course work.
{% endblocktrans %}
</p>
<button class="gated-sequence start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false>
<button class="gated-sequence start-timed-exam action-primary" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false>

<a>
{% trans "You can also retry this practice exam" %}
Expand Down
19 changes: 6 additions & 13 deletions edx_proctoring/templates/proctored_exam/entrance.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,19 @@ <h3>
To be eligible to earn credit for this course, you must take and pass the proctoring review for this exam.
{% endblocktrans %}
</p>
<button class="gated-sequence start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false>
<button class="gated-sequence start-timed-exam action-primary" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false>
{% trans "Continue to my proctored exam. I want to be eligible for credit." %}
<span class="icon fa fa-arrow-circle-right" aria-hidden="true"></span>
<p>
{% blocktrans %}
You will be guided through steps to set up online proctoring software and to perform various checks.</br>
{% endblocktrans %}
</p>

<i class="fa fa-arrow-circle-right"></i>
</button>
<button class="gated-sequence start-timed-exam" data-attempt-proctored=false>
{% trans "Take this exam without proctoring." %}
<i class="fa fa-arrow-circle-right"></i>
<p>
{% blocktrans %}
I am not interested in academic credit.
{% endblocktrans %}
</p>
</button>

{% if allow_proctoring_opt_out %}
{% include 'proctored_exam/proctoring_opt_out_button.html' %}
{% endif %}
</div>
{% include 'proctored_exam/confirm-decline.html' %}
{% include 'proctored_exam/footer.html' %}

17 changes: 5 additions & 12 deletions edx_proctoring/templates/proctored_exam/failed-prerequisites.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,16 @@ <h3>
{% endfor %}
</ol>
</p>
<p>
{% blocktrans %}
Due to unsatisfied prerequisites, you can only take this exam without proctoring.
{% endblocktrans %}
</p>

<button class="gated-sequence start-timed-exam" data-attempt-proctored=false>
<a>
{% trans "Take this exam without proctoring." %}
</a>
<i class="fa fa-arrow-circle-right"></i>
{% if allow_proctoring_opt_out %}
<p>
{% blocktrans %}
I understand that I am not eligible for academic credit.
Due to unsatisfied prerequisites, you can only take this exam without proctoring.
{% endblocktrans %}
</p>
</button>

{% include 'proctored_exam/proctoring_opt_out_button.html' %}
{% endif %}
<p>
{% blocktrans %}
If you have questions about the status of your requirements for course credit, contact {{ platform_name }} Support.
Expand Down
11 changes: 6 additions & 5 deletions edx_proctoring/templates/proctored_exam/instructions.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ <h2 id="acessible-error-title">{% trans "Cannot Start Proctored Exam" %}</h2>
</div>

<div class="footer-sequence border-b-0 padding-b-0">
{% if not is_sample_attempt %}
<p class="proctored-exam-instruction">
{% trans "Don't want to take this exam with online proctoring?" %}<a class="proctored-decline-exam" href='#' data-action="decline" data-exam-id="{{exam_id}}" data-change-state-url="{{change_state_url}}">
{% trans "Take this exam as an open exam instead." %}
{% if not is_sample_attempt and allow_proctoring_opt_out %}
<p class="proctored-exam-instruction">
<a href="#" class="proctored-decline-exam" data-action="decline" data-exam-id="{{exam_id}}" data-change-state-url="{{change_state_url}}">
{% trans "Take this exam without proctoring." %}
</a>
</p>
{% trans "Doing so means that you are no longer eligible for academic credit." %}
</p>
{% endif %}
</div>
{% include 'proctored_exam/footer.html' %}
Expand Down
14 changes: 3 additions & 11 deletions edx_proctoring/templates/proctored_exam/pending-prerequisites.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,9 @@ <h3>
{% endblocktrans %}
</p>

<button class="gated-sequence start-timed-exam" data-attempt-proctored=false>
<a>
{% trans "Take this exam without proctoring." %}
</a>
<i class="fa fa-arrow-circle-right"></i>
<p>
{% blocktrans %}
I am not interested in academic credit.
{% endblocktrans %}
</p>
</button>
{% if allow_proctoring_opt_out %}
{% include 'proctored_exam/proctoring_opt_out_button.html' %}
{% endif %}
</div>
{% include 'proctored_exam/confirm-decline.html' %}
{% include 'proctored_exam/footer.html' %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% load i18n %}

{% if allow_proctoring_opt_out %}
<button class="gated-sequence start-timed-exam" data-attempt-proctored=false>
{% trans "Take this exam without proctoring." %}
<span class="icon fa fa-arrow-circle-right" aria-hidden="true"></span>
<p>
{% blocktrans %}
I am not interested in academic credit.
{% endblocktrans %}
</p>
</button>
{% endif %}
4 changes: 2 additions & 2 deletions edx_proctoring/templates/timed_exam/entrance.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ <h3>
</strong>
{% trans "you will have "%} {{total_time|lower}} {% trans " to complete and submit the exam." %}
</p>
<button class="gated-sequence start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}">
<button class="gated-sequence start-timed-exam action-primary" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}">
<a>
{% blocktrans %}
I am ready to start this timed exam.
{% endblocktrans %}
<i class="fa fa-arrow-circle-right"></i>
<span class="icon fa fa-arrow-circle-right" aria-hidden="true"></span>
</a>
</button>
</div>
Expand Down

0 comments on commit c12227d

Please sign in to comment.