Commit 03c9cc37 by Chris Dodge

change to use a select text button

parent fe1b666e
...@@ -7,22 +7,43 @@ ...@@ -7,22 +7,43 @@
</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
......
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