I implemented the anti-copying function supplied by Rob Butner and Indjana Dzons. Thank you both very much.
The instructions are alread available but I have made some very minor changes.
1) Insert
<?php include("common.php") ?>
Into header.php in your theme. I put it at the second to last line before the <!-- END OF HEADER --> because that enables me to put a warning at the top of the quiz (see 4 below)
2) create a file common.php in your theme folder (Indjana Dzons had it somewhere else but I think it is helpful to have it inside the theme folder since that is the one folder that one copies accross when updating Moodle.)
<?php
if (stristr($_SERVER['SCRIPT_FILENAME']."X", "attempt.phpX")) {
include("blockit.html"); }
?>
One could add other pages (other than attempt.php) to the above if one wants to prevent students from copying other files but since the above prevents both the quiz attempt screen and the feedback screen, which is also created by attempt.php, it is enough for me.
3) Create a file blockit.html in your theme folder. Include the super-java script blocker supplied by Rob Butner here
I just used the code between <SCRIPT Xlanguage="JavaScript"><!-- and the last </SCRIPT>
This is an encoded javascript so I guess it makes it more difficult to beat. It prevents students from copying by interfering drastically with the clipboard and select. I think that the clipboard and the select range is emptied at a high rate. It becomes impossible to copy anything on any window on ones computer. BE WARNED: JUST OPENING ROB BUTNERS SCRIPT IN YOUR BROWSER CAUSES MAJOR LIMITATIONS TO YOUR ABILITY TO COPY. USE "view source" or save and open the header.php in a text editor or you will not be able to copy it.
Control P appears to work at first but in fact all that is printed out is a blank page. This is a mystery to me.
4) At the top of the blockit.html page I included
<meta http-equiv="Content-Type" content="text/html; charset=x-euc-jp">
<br /><table align="center" class="generalbox" border="0" cellpadding="5" cellspacing="0"><tr><td bgcolor="pink" class="generalboxcontent">Copying and printing during the Test is prohibited</td></tr></table><center><br />
Change the content statement to
content="text/html; charset=x-euc-jp"
If using Japanese.
It seems to work very well but
1) It still seems possible to download source. The determined copier could use this method of copying the quiz.
2) I cannot seem to get the above Rob Butner"Super-encoded-anti-copyiing-Javascript to work in Tandem with the Rob Butner provided Simpler-Javascript given above on this forum. The one above on this forum prevents use of the right click and gives warnings about the way that the browser functionality has been changed. The "Super-encoded" version seems just to work in the background which has the result that the student will not know why the functions are not working. I would like to be able to use both.
Part of the problem was that I was using
"<scriptxxx" but in fact it should be script l a n g u a g e without the spaces as Genner explains above. But all the same, I still can't get security.js above to work.
3) If one saves the quiz then it is impossible to view that quiz simply in a browser. "aboutblack" is displayed. But it is still possible to view it in a text editor.
But of course, this functionality is a great help.
Tim
takemoto