Commit 66f13dc2 by chrisndodge

Merge pull request #151 from edx/rc/2015-09-15-rebase

Rc/2015 09 15 rebase
parents 93bd13bd f58ae915
...@@ -2,27 +2,26 @@ ...@@ -2,27 +2,26 @@
<div class="sequence proctored-exam entrance" data-exam-id="{{exam_id}}"> <div class="sequence proctored-exam entrance" data-exam-id="{{exam_id}}">
<h3> <h3>
{% blocktrans %} {% blocktrans %}
Would you like to take "{{ display_name }}" as a practice proctored exam? Try a proctored exam
{% endblocktrans %} {% endblocktrans %}
</h3> </h3>
<p> <p>
{% blocktrans %} {% blocktrans %}
You can try this practice exam as many times as you want. Get familiar with proctoring for real exams later in the course. This practice exam has no impact
on your grade in the course.
{% endblocktrans %} {% endblocktrans %}
</p> </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" 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>
<a> <a>
{% trans "Yes, I want to take this practice exam with online proctoring" %} {% trans "Continue to my practice exam" %}
</a> </a>
<p> <p>
{% blocktrans %} {% blocktrans %}
You will be guided through steps to set up online proctoring software and to perform various checks. You will be guided through steps to set up online proctoring software and to perform various checks.
When you start the exam, the timer on the right shows the time remaining in the exam.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<i class="fa fa-arrow-circle-right start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false></i> <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>
</button> </button>
</div> </div>
{% include 'proctored_exam/footer.html' %} {% include 'proctored_exam/footer.html' %}
......
...@@ -2,43 +2,36 @@ ...@@ -2,43 +2,36 @@
<div class="sequence proctored-exam entrance" data-exam-id="{{exam_id}}"> <div class="sequence proctored-exam entrance" data-exam-id="{{exam_id}}">
<h3> <h3>
{% blocktrans %} {% blocktrans %}
Would you like to take "{{ display_name }}" as a proctored exam? This exam is proctored.
{% endblocktrans %} {% endblocktrans %}
</h3> </h3>
<p> <p>
{% blocktrans %} {% blocktrans %}
As a verified learner in this course, you have the option of taking this exam with online proctoring.
To be eligible to earn credit for this course, you must take and pass the proctoring review for this exam. To be eligible to earn credit for this course, you must take and pass the proctoring review for this exam.
{% endblocktrans %} {% endblocktrans %}
</p> </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" 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>
<a> <a>
{% trans "Yes, I want to take this exam with online proctoring (and be eligible for credit)" %} {% trans "Continue to my proctored exam. I want to be eligible for credit." %}
</a> </a>
<p> <p>
{% blocktrans %} {% blocktrans %}
You will be guided through steps to set up online proctoring software and to perform various checks.</br> You will be guided through steps to set up online proctoring software and to perform various checks.</br>
&#8226; Have your photo ID ready so that you can verify your identity. </br>
&#8226; Be ready to start your exam after you complete the proctoring setup. </br>
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<i class="fa fa-arrow-circle-right"></i> <i class="fa fa-arrow-circle-right"></i>
</button> </button>
<button class="gated-sequence start-timed-exam" data-attempt-proctored=false> <button class="gated-sequence start-timed-exam" data-attempt-proctored=false>
<span><i class="fa fa-unlock"></i></span>
<a> <a>
{% trans "No, I want to take this exam without proctoring (and not be eligible for credit)" %} {% trans "Take this exam without proctoring." %}
</a> </a>
<i class="fa fa-arrow-circle-right"></i>
<p> <p>
{% blocktrans %} {% blocktrans %}
If you take this exam without proctoring, you will not be eligible to use this course for academic credit, I am not interested in academic credit.
even if you achieve a passing grade.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<i class="fa fa-arrow-circle-right"></i>
</button> </button>
</div> </div>
<div class="proctored-exam-skip-confirm-wrapper hidden"> <div class="proctored-exam-skip-confirm-wrapper hidden">
...@@ -50,15 +43,15 @@ ...@@ -50,15 +43,15 @@
</div> </div>
<div class="msg-content"> <div class="msg-content">
{% blocktrans %} {% blocktrans %}
You will no longer be eligible to use this course for academic credit. If you take this exam without proctoring, you will <strong> no longer be eligible for academic credit. </strong>
{% endblocktrans %} {% endblocktrans %}
</div> </div>
<div class="proctored-exam-skip-actions"> <div class="proctored-exam-skip-actions">
<button class="proctored-exam-skip-cancel-button btn btn-default btn-base">
{% trans "Cancel" %}
</button>
<button class="proctored-exam-skip-confirm-button btn btn-primary btn-base" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}"> <button class="proctored-exam-skip-confirm-button btn btn-primary btn-base" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}">
{% trans "Yes, Take this as an open exam" %} {% trans "Continue Exam Without Proctoring" %}
</button>
<button class="proctored-exam-skip-cancel-button btn btn-default btn-base">
{% trans "Go Back" %}
</button> </button>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
......
{% load i18n %} {% load i18n %}
<div class="faq-proctoring-exam"> <div class="faq-proctoring-exam">
<h4> {% trans "See Also" %} </h4>
<p> <p>
<a class="footer-link" href="{{link_urls.faq}}" target="_blank"> <a class="footer-link" href="{{link_urls.faq}}" target="_blank">
{% blocktrans %} {% blocktrans %}
Frequently asked questions about proctoring and earning college credit About Proctored Exams
{% endblocktrans %}
</a>
<a class="footer-link" href="{{link_urls.online_proctoring_rules}}" target="_blank">
{% blocktrans %}
Online proctoring rules
{% endblocktrans %}
</a>
<a class="footer-link" href="{{link_urls.tech_requirements}}" target="_blank">
{% blocktrans %}
Technical Requirements for taking a proctored exam
{% endblocktrans %} {% endblocktrans %}
</a> </a>
</p> </p>
......
{% load i18n %} {% load i18n %}
<div class="sequence proctored-exam instructions message-top-bar" data-exam-id="{{exam_id}}" data-exam-started-poll-url="{{exam_started_poll_url}}"> <div class="sequence proctored-exam instructions message-left-bar" data-exam-id="{{exam_id}}" data-exam-started-poll-url="{{exam_started_poll_url}}">
<h3>
{% blocktrans %} <div class="">
You Have Chosen To Take a Proctored Exam
{% endblocktrans %}
</h3>
<p>
{% blocktrans %}
You must set up and start the proctoring software before you begin your exam
{% endblocktrans %}
</p>
<div class="proctored-exam-message">
<h3> <h3>
{% blocktrans %} {% blocktrans %}
Install and Set Up Proctoring Software Follow these steps to set up and start your proctored exam.
{% endblocktrans %} {% endblocktrans %}
</h3> </h3>
<p> <p>
{% blocktrans %} {% blocktrans %}
1. Open the proctoring software installation window and follow the instructions to <a href="{{software_download_url}}" target="_blank">install and set up the proctoring software</a>. 1. Copy this unique exam code. You will be prompted to paste this code later before you start the exam.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<p> <p>
{% blocktrans %} <span class="proctored-exam-code">{{exam_code}}</span>
2. Copy this unique exam code and paste it in the proctoring software window when you are asked for it.
{% endblocktrans %}
</p> </p>
<p> <p>
<span class="proctored-exam-code" role="application">{{exam_code}}</span>&nbsp;<button class='proctored-exam-select-code'>Select exam code</button> {% blocktrans %}
Select the exam code, then copy it using Command+C (Mac) or Control+C (Windows).
{% endblocktrans %}
</p> </p>
<p> <p>
{% blocktrans %} {% blocktrans %}
Do not share this code. It is linked to your {{platform_name}} account and can be used only once. 2. Follow the link below to set up proctoring.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<p> <p>
<span><a href="{{software_download_url}}" target="_blank">Start System Check</a></span>
</p>
<p>
{% blocktrans %} {% blocktrans %}
3. Keep the proctoring session window open while you are taking the exam. If you close it, the proctoring recording is stopped and you will not successfully complete the proctored exam. A new window will open. You will run a system check before downloading the proctoring application.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<p> <p>
{% blocktrans %} {% blocktrans %}
4. Return to the {{platform_name}} courseware to start your exam. You will be asked to verify your identity before you begin the exam. Make sure you have valid photo identification, such as a driver's license or passport, before you continue.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
</div> </div>
...@@ -93,31 +87,6 @@ ...@@ -93,31 +87,6 @@
} }
); );
$('.proctored-exam-select-code').click(function() {
selectText($('.proctored-exam-code'));
$(event.currentTarget).blur();
});
function selectText(textToBeSelected) {
// this selects all the text in an element
// http://stackoverflow.com/questions/12243898/how-to-select-all-text-in-contenteditable-div
var doc = document,
range, selection,
element = textToBeSelected[0];
if (doc.body.createTextRange) {
range = doc.body.createTextRange();
range.moveToElementText(element);
range.select();
} else if (window.getSelection) {
selection = window.getSelection();
range = doc.createRange();
range.selectNodeContents(element);
selection.removeAllRanges();
selection.addRange(range);
}
}
$(document).ready(function(){ $(document).ready(function(){
_waiting_for_proctored_interval = setInterval( _waiting_for_proctored_interval = setInterval(
poll_exam_started, poll_exam_started,
......
{% load i18n %} {% load i18n %}
<div class="sequence proctored-exam success-top-bar instructions" data-exam-id="{{exam_id}}" data-exam-started-poll-url="{{exam_started_poll_url}}"> <div class="sequence proctored-exam success-left-bar instructions" data-exam-id="{{exam_id}}" data-exam-started-poll-url="{{exam_started_poll_url}}">
<h3> <div>
{% blocktrans %}
Your Proctoring Installation and Set Up is Complete
{% endblocktrans %}
</h3>
<p>
{% blocktrans %}
Do not close the proctoring session window until you have completed and submitted your exam.
{% endblocktrans %}
</p>
<div class="proctored-exam-message">
<h3> <h3>
{% blocktrans %} {% blocktrans %}
You Can Begin Your Exam Now Follow these instructions
{% endblocktrans %} {% endblocktrans %}
</h3> </h3>
<p> <p>
{% blocktrans %} {% blocktrans %}
When you start your exam you will have {{total_time}} to complete it. You cannot stop the timer once you start. &#8226; Do not close the proctoring window until you have completed and submitted your exam. </br>
{% endblocktrans %} &#8226; When you start your exam you will have {{ total_time }} to complete it. </br>
{% blocktrans %} &#8226; If the allotted time expires before your end your exam, the answers you have completed up
If the allotted time expires before you mark your exam as ended, the answers you have completed up to that point are submitted for grading, and your proctoring session is uploaded for review. to that point are submitted for grading and your proctoring session is uploaded for review. </br>
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<div> <div>
......
{% load i18n %}
<div class="faq-proctoring-exam">
<p>
<a class="footer-link" href="{{link_urls.faq}}" target="_blank">
{% blocktrans %}
About Proctored Exams
{% endblocktrans %}
</a>
</p>
</div>
...@@ -95,21 +95,22 @@ class ProctoredExamApiTests(LoggedInTestCase): ...@@ -95,21 +95,22 @@ class ProctoredExamApiTests(LoggedInTestCase):
self.disabled_exam_id = self._create_disabled_exam() self.disabled_exam_id = self._create_disabled_exam()
# Messages for get_student_view # Messages for get_student_view
self.start_an_exam_msg = 'Would you like to take "{exam_name}" as a proctored exam?' self.start_an_exam_msg = 'This exam is proctored'
self.timed_exam_msg = '{exam_name} is a Timed Exam' self.timed_exam_msg = '{exam_name} is a Timed Exam'
self.exam_time_expired_msg = 'You did not complete the exam in the allotted time' self.exam_time_expired_msg = 'You did not complete the exam in the allotted time'
self.exam_time_error_msg = 'There was a problem with your proctoring session' self.exam_time_error_msg = 'There was a problem with your proctoring session'
self.chose_proctored_exam_msg = 'You Have Chosen To Take a Proctored Exam' self.chose_proctored_exam_msg = 'Follow these steps to set up and start your proctored exam'
self.proctored_exam_optout_msg = 'Take this exam as an open exam instead' self.proctored_exam_optout_msg = 'Take this exam as an open exam instead'
self.proctored_exam_completed_msg = 'Are you sure you want to end your proctored exam' self.proctored_exam_completed_msg = 'Are you sure you want to end your proctored exam'
self.proctored_exam_submitted_msg = 'You have submitted this proctored exam for review' self.proctored_exam_submitted_msg = 'You have submitted this proctored exam for review'
self.proctored_exam_verified_msg = 'Your proctoring session was reviewed and passed all requirements' self.proctored_exam_verified_msg = 'Your proctoring session was reviewed and passed all requirements'
self.proctored_exam_rejected_msg = 'Your proctoring session was reviewed and did not pass requirements' self.proctored_exam_rejected_msg = 'Your proctoring session was reviewed and did not pass requirements'
self.start_a_practice_exam_msg = 'Would you like to take "{exam_name}" as a practice proctored exam?' self.start_a_practice_exam_msg = 'Get familiar with proctoring for real exams later in the course'
self.practice_exam_submitted_msg = 'You have submitted this practice proctored exam' self.practice_exam_submitted_msg = 'You have submitted this practice proctored exam'
self.practice_exam_created_msg = 'You must set up and start the proctoring software before you begin your exam' self.practice_exam_created_msg = 'Follow these steps to set up and start your proctored exam'
self.practice_exam_completion_msg = 'Are you sure you want to end your proctored exam' self.practice_exam_completion_msg = 'Are you sure you want to end your proctored exam'
self.ready_to_start_msg = 'Your Proctoring Installation and Set Up is Complete' self.ready_to_start_msg = 'Follow these instructions'
self.practice_exam_failed_msg = 'There was a problem with your practice proctoring session' self.practice_exam_failed_msg = 'There was a problem with your practice proctoring session'
self.proctored_exam_email_subject = 'Proctoring Session Results Update' self.proctored_exam_email_subject = 'Proctoring Session Results Update'
self.proctored_exam_email_body = 'the status of your proctoring session review' self.proctored_exam_email_body = 'the status of your proctoring session review'
......
...@@ -505,6 +505,17 @@ class TestStudentProctoredExamAttempt(LoggedInTestCase): ...@@ -505,6 +505,17 @@ class TestStudentProctoredExamAttempt(LoggedInTestCase):
# make sure we have the accessible human string # make sure we have the accessible human string
self.assertEqual(response_data['accessibility_time_string'], 'you have 1 hour and 30 minutes remaining') self.assertEqual(response_data['accessibility_time_string'], 'you have 1 hour and 30 minutes remaining')
# check the special casing of the human string when under a minute
reset_time = datetime.now(pytz.UTC) + timedelta(minutes=90, seconds=30)
with freeze_time(reset_time):
response = self.client.get(
reverse('edx_proctoring.proctored_exam.attempt', args=[attempt_id])
)
self.assertEqual(response.status_code, 200)
response_data = json.loads(response.content)
self.assertEqual(response_data['accessibility_time_string'], 'you have less than a minute remaining')
def test_attempt_ready_to_start(self): def test_attempt_ready_to_start(self):
""" """
Test to get an attempt with ready_to_start status Test to get an attempt with ready_to_start status
......
...@@ -296,9 +296,16 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView): ...@@ -296,9 +296,16 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView):
time_remaining_seconds = get_time_remaining_for_attempt(attempt) time_remaining_seconds = get_time_remaining_for_attempt(attempt)
attempt['time_remaining_seconds'] = time_remaining_seconds attempt['time_remaining_seconds'] = time_remaining_seconds
attempt['accessibility_time_string'] = _('you have {remaining_time} remaining').format(
remaining_time=humanized_time(int(round(time_remaining_seconds / 60.0, 0))) accessibility_time_string = _('you have {remaining_time} remaining').format(
) remaining_time=humanized_time(int(round(time_remaining_seconds / 60.0, 0))))
# special case if we are less than a minute, since we don't produce
# text translations of granularity at the seconds range
if time_remaining_seconds < 60:
accessibility_time_string = _('you have less than a minute remaining')
attempt['accessibility_time_string'] = accessibility_time_string
return Response( return Response(
data=attempt, data=attempt,
......
...@@ -34,7 +34,7 @@ def load_requirements(*requirements_paths): ...@@ -34,7 +34,7 @@ def load_requirements(*requirements_paths):
setup( setup(
name='edx-proctoring', name='edx-proctoring',
version='0.8.3', version='0.9.6',
description='Proctoring subsystem for Open edX', description='Proctoring subsystem for Open edX',
long_description=open('README.md').read(), long_description=open('README.md').read(),
author='edX', author='edX',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment