Commit c057412c by chrisndodge

Merge pull request #79 from edx/cdodge/link-to-button

Cdodge/link to button
parents fc70b1bd 23c492be
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
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>
<div class="gated-sequence"> <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> <span><i class="fa fa-lock"></i></span>
<a class="start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false> <a>
{% trans "Yes, I want to take this exam with online proctoring (and be eligible for credit)" %} {% trans "Yes, I want to take this exam with online proctoring (and be eligible for credit)" %}
</a> </a>
<p> <p>
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
</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 start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false></i>
</div> </button>
<div class="gated-sequence"> <button class="gated-sequence start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=false data-start-immediately=true>
<span><i class="fa fa-unlock"></i></span> <span><i class="fa fa-unlock"></i></span>
<a class="start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=false data-start-immediately=true> <a>
{% trans "No, I want to take this exam without proctoring (and not be eligible for credit)" %} {% trans "No, I want to take this exam without proctoring (and not be eligible for credit)" %}
</a> </a>
<p> <p>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
{% 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=false data-start-immediately=true></i> <i class="fa fa-arrow-circle-right start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=false data-start-immediately=true></i>
</div> </button>
</div> </div>
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctoring/seq_proctored_exam_footer.html' %}
......
...@@ -2,27 +2,48 @@ ...@@ -2,27 +2,48 @@
<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-top-bar" data-exam-id="{{exam_id}}" data-exam-started-poll-url="{{exam_started_poll_url}}">
<h3> <h3>
{% blocktrans %} {% blocktrans %}
Awaiting Proctoring Software Installation and Setup You Have Chosen to take a Proctored Exam
{% endblocktrans %} {% endblocktrans %}
</h3> </h3>
<p> <p>
{% blocktrans %} {% blocktrans %}
You have chosen to take {{display_name}} as a proctored exam. You should be directed to a new window You must set up and start the proctoring software before you begin your exam
with installation and setup instructions. You can also <a href="{{software_download_url}}" target="_blank">open the installation window directly.</a>
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<div class="proctored-exam-message"> <div class="proctored-exam-message">
<h3> <h3>
{% blocktrans %} {% blocktrans %}
Here is your unique exam code. You will be asked for it during the setup. Install and Set Up Proctoring Software
{% endblocktrans %} {% endblocktrans %}
</h3> </h3>
<h2> {{exam_code}}<span class='copy-to-clipboard'></span></h2> <p>
{% blocktrans %}
1. Open the procotring software installation window and follow the instructions to <a href="{{software_download_url}}" target="_blank">install and set up the proctoring software</a>.
{% endblocktrans %}
</p>
<p>
{% blocktrans %}
2. Dopy this unique exam code and poste it in the proctoring software window when you are asked for it.
{% endblocktrans %}
</p>
<p>
<span class="proctored-exam-code">{{exam_code}}</span>&nbsp;<button class='proctored-exam-select-code'>Click to select exam code</button>
</p>
<p> <p>
{% blocktrans %} {% blocktrans %}
Do not share this code. It is linked to your {{platform_name}} account and can be used only once. Do not share this code. It is linked to your {{platform_name}} account and can be used only once.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<p>
{% blocktrans %}
3. Keep the proctoring sesion 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.
{% endblocktrans %}
</p>
<p>
{% blocktrans %}
4. Return to the {{platform_name}} courseware to start your exam
{% endblocktrans %}
</p>
</div> </div>
</div> </div>
<div class="footer-sequence border-b-0 padding-b-0"> <div class="footer-sequence border-b-0 padding-b-0">
...@@ -82,49 +103,32 @@ ...@@ -82,49 +103,32 @@
} }
); );
$(document).ready(function(){ $('.proctored-exam-select-code').click(function() {
selectText($('.proctored-exam-code'));
$(event.currentTarget).blur();
});
var hasFlash = false; function selectText(textToBeSelected) {
try { // this selects all the text in an element
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); // http://stackoverflow.com/questions/12243898/how-to-select-all-text-in-contenteditable-div
if (fo) { var doc = document,
hasFlash = true; range, selection,
} element = textToBeSelected[0];
} catch (e) {
if (navigator.mimeTypes
&& navigator.mimeTypes['application/x-shockwave-flash'] != undefined
&& navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin) {
hasFlash = true;
}
}
if (hasFlash) { if (doc.body.createTextRange) {
$('.copy-to-clipboard').html( range = doc.body.createTextRange();
'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \ range.moveToElementText(element);
width="110" \ range.select();
height="14" \ } else if (window.getSelection) {
id="clippy" > \ selection = window.getSelection();
<param name="movie" value="/static/proctoring/clippy.swf"/> \ range = doc.createRange();
<param name="allowScriptAccess" value="always" /> \ range.selectNodeContents(element);
<param name="quality" value="high" /> \ selection.removeAllRanges();
<param name="scale" value="noscale" /> \ selection.addRange(range);
<param NAME="FlashVars" value="text={{exam_code}}"> \
<param name="bgcolor" value="#F2F4F5"> \
<embed src="/static/proctoring/clippy.swf" \
width="110" \
height="14" \
name="clippy" \
quality="high" \
allowScriptAccess="always" \
type="application/x-shockwave-flash" \
pluginspage="http://www.macromedia.com/go/getflashplayer" \
FlashVars="text={{exam_code}}" \
bgcolor="#F2F4F5" \
/> \
</object>'
);
} }
}
$(document).ready(function(){
_waiting_for_proctored_interval = setInterval( _waiting_for_proctored_interval = setInterval(
poll_exam_started, poll_exam_started,
5000 5000
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
You can try this practice exam as many times as you want. You can try this practice exam as many times as you want.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<div class="gated-sequence"> <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> <span><i class="fa fa-lock"></i></span>
<a class="start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false> <a>
{% trans "Yes, I want to take this practice exam with online proctoring" %} {% trans "Yes, I want to take this practice exam with online proctoring" %}
</a> </a>
<p> <p>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</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 start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false></i>
</div> </button>
</div> </div>
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctoring/seq_proctored_exam_footer.html' %}
......
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<hr> <hr>
<div class="gated-sequence"> <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> <span><i class="fa fa-lock"></i></span>
<a class="start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false> <a>
{% trans "Try this practice exam again" %} {% trans "Try this practice exam again" %}
</a> </a>
</div> </button>
</div> </div>
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctoring/seq_proctored_exam_footer.html' %}
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
You have completed this practice exam and can continue with your course. You have completed this practice exam and can continue with your course.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<div class="gated-sequence"> <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> <span><i class="fa fa-lock"></i></span>
<a class="start-timed-exam" 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" %} {% trans "You can also retry this practice exam" %}
</a> </a>
</div> </button>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$('.start-timed-exam').click( $('.start-timed-exam').click(
......
...@@ -96,7 +96,7 @@ class ProctoredExamApiTests(LoggedInTestCase): ...@@ -96,7 +96,7 @@ class ProctoredExamApiTests(LoggedInTestCase):
self.timed_exam_msg = '%s is a Timed Exam' self.timed_exam_msg = '%s 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 %s as a proctored exam' self.chose_proctored_exam_msg = 'You Have Chosen to take a Proctored Exam'
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'
...@@ -805,7 +805,7 @@ class ProctoredExamApiTests(LoggedInTestCase): ...@@ -805,7 +805,7 @@ class ProctoredExamApiTests(LoggedInTestCase):
'default_time_limit_mins': 90 'default_time_limit_mins': 90
} }
) )
self.assertIn(self.chose_proctored_exam_msg % self.exam_name, rendered_response) self.assertIn(self.chose_proctored_exam_msg, rendered_response)
def test_declined_attempt(self): def test_declined_attempt(self):
""" """
......
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