About ITIT for StudentsIT for FacultyIT for StaffServicesHelpDocumentationIT Home

Technology Tip of the Week - October 4, 2006

Prevent Printing or Copying of WebCT Quizzes

Electronic quizzes in WebCT are a wonderful assessment tool. Faculty can create test banks of questions (or use a publisher's testbank) and then set the quiz to randomize a group of questions so that every student gets a different quiz or a different order of questions. Faculty can even randomize the answers in individual questions so that even if two students get the same question on a quiz, their answers will be in different order! Quizzes can be set to turn on and off to limit student access and can be set so that students can take them multiple times. The best part is that these quizzes are electronically scored and recorded. This means that as soon as the students submit their quizzes, they get their grade and then the grade is automatically added to the online grade book in WebCT. Pretty nifty!

However, one concern that faculty who use these quizzes have had is that students can print out a copy of the quiz or copy-paste the quiz into Word. Here is a script that can be pasted into an upper textblock of a quiz that will actually prevent students from selecting the questions, copying any of the question and answers or printing the test.  This code works with recent versions of Internet Explorer, Firefox and Netscape.

To use this option:

  1. Click on the title of a quiz you've created in the Quiz Editor to open the quiz
  2. Scroll down the menu on the right towards the bottom and click on "Edit/Add upper textblock." This upper text box is usually used to add a note or instructions for your students that they will see before taking a quiz. However, you may also use it to add scripts or HTML code to your quiz.
  3. The textblock editing box will appear. Copy the following code starting from the <head> and ending with the </script> and paste it into this textblock, then click Update. The code itself will be completely invisible to your students but they won't be able to copy or print the quiz from the menu bar or with right-click features like control "a" / control "c" / control "v" ability to select, copy and paste. Pretty cool, huh!
    -----------------------------------------------------------------------------------------------
<head>
<meta http-equiv="imagetoolbar" content="no">
</head>
<style media="print">body {display:none}</style>
<body ondragstart="return false" onselectstart="return false">

<script language=JavaScript>
<!--
var message="It is a violation of the CCRI Student Code Of Conduct to copy or print this quiz!";

function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// --> 
</script>

<script language=JavaScript>

</script>

<script type="text/javascript">

var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}

</script>

-----------------------------------------------------------------------------------------

To test the code:

  1. Click the "Preview Quiz" button in the right-hand "Actions" menu in the quiz's Quiz Editor screen. A preview of the quiz will appear in a popup window.
  2. Attempt to right-click. A popup warning message that says "Function Disabled!" should appear.
  3. Attempt to select some text. You should not be able to.
  4. Attempt to print. A blank sheet of paper should come out of your printer.
  5. If you are using Internet Explorer, and if the quiz contains an image, attempt to right-click the image. A popup warning box should appear ("Function Disabled") and the IE-specific "Image Toolbar" should not appear.

For more help with these features, please contact one of the IT Instructional Support team (Norm Grant, Gene Grande or Linda Beith) or faculty mentors Tony Basilico or Kathy Beauchene.

Website of the Week

The Valley of the Shadow: Two Communities in the American Civil War

Explore this fascinating example of discovery learning hosted by the University of Virginia. This website was built by students who researched a Northern community and Southern community to learn about the American Civil War through the eyes of everyday people. They have assembled original letters, diaries, speeches, newsletters, census and church records and maps to tell the story of this time in our history through very different perspectives. What an exciting project!

See this website at:  http://valley.vcdh.virginia.edu/

Feel free to post your thoughts or opinions of this site in the Teaching Forum message board.

These tips are provided by the Department of Information Technology instructional support team. If you have any questions on these tips, or wish to offer your own, please feel free to contact Linda Beith at lbeith@ccri.edu. View an archive of past technology tips at http://it.ccri.edu/Training/Tips/tip_week.shtml.

Go to top of page