Commit 67f11806 by Chris Dodge

add copy to clipboard feature

parent d7723f0e
...@@ -17,29 +17,8 @@ ...@@ -17,29 +17,8 @@
Here is your unique exam code. You'll be asked for it during the setup. Here is your unique exam code. You'll be asked for it during the setup.
{% endblocktrans %} {% endblocktrans %}
</h3> </h3>
<h1> {{exam_code}}</h1> <h1> {{exam_code}}<span class='copy-to-clipboard'></span>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" </h1>
width="110"
height="14"
id="clippy" >
<param name="movie" value="/static/proctoring/clippy.swf"/>
<param name="allowScriptAccess" value="always" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param NAME="FlashVars" value="text={{exam_code}}">
<param name="bgcolor" value="#ffffff">
<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="#ffffff"
/>
</object>
<p> <p>
{% blocktrans %} {% blocktrans %}
Please do not share this code. It can only be used once and it tied to your edX account. Please do not share this code. It can only be used once and it tied to your edX account.
...@@ -65,6 +44,48 @@ ...@@ -65,6 +44,48 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
var hasFlash = false;
try {
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
if (fo) {
hasFlash = true;
}
} catch (e) {
if (navigator.mimeTypes
&& navigator.mimeTypes['application/x-shockwave-flash'] != undefined
&& navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin) {
hasFlash = true;
}
}
if (hasFlash) {
$('.copy-to-clipboard').html(
'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \
width="110" \
height="14" \
id="clippy" > \
<param name="movie" value="/static/proctoring/clippy.swf"/> \
<param name="allowScriptAccess" value="always" /> \
<param name="quality" value="high" /> \
<param name="scale" value="noscale" /> \
<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>'
);
}
setInterval( 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