AnsweredAssumed Answered

Javascript to pull user_id?

Question asked by Priscilla M. Hockin Brown on Jun 5, 2020
Latest reply on Jun 5, 2020 by James Jones

Hello,

 

We are trying to deter sharing exam questions.  At first we tried just using a <div> and posting a copyright notice behind the question. Like this:

 

<p style="opacity: 0.2; color: black; position: fixed; top: 20%; width: 100%; left: 0; transform: translateY(-50%) rotate(-20deg); font-size: 20px;">&copy; 2020, Rutgers University, All Rights Reserved. &copy; 2020, Rutgers University, All Rights Reserved. &copy; 2020, Rutgers University, All Rights Reserved &copy; 2020, Rutgers University, All Rights Reserved</p>

 

In the RCE, it looks like this:

 

Once the question is saved, the RCE strips it out.  

 

So then I went with an image....

 

For the first question, I created an image and I added a fake Question Code.  (I figured, if we created hundreds of these, and then use the formula question, we would have an identifier to identify the user who may have taken a screencap of the questions.)  We got it so the image was present but the z-index would not override.  The question is behind the copyright image.  When we inspect elements, we can see that the z-index is set to auto AND it is defined by the code below:
<p><img id="8796845" style="max-width: 320px; max-height: 320px; position: absolute; z-index: -1;" src="/courses/5/files/8796845/preview?wrap=1" alt="Screen Shot 2020-04-27 at 4.36.27 PM.png" /></p>
<p> </p>
<p> </p>
<p> </p>
<p style="z-index: 20;">                    What is 5 + [x] x [y]<span style="font-size: 1rem; font-family: sans-serif;">?</span></p>
 
For the second one, we could not get the tilt.  The text <div> in the first example was a more elegant solution but Canvas was stripping out some style elements.  

So we talked to some folks at Instructure. 
They suggested we use javascript to pull out the Canvas_user_id to populate something in the question.  If we could lead the canvas_user_id with something like..."question set: " then the student would think it is just an identifier of the question and not them.  

Does anyone know how to do this?

Outcomes