I'm trying to produce an online quiz for someone and I want to prevent users from viewing the source. Otherwise they can workout which answer to pick by peeking at the source. Can anyone tell me how to do this? Is it possible?
Thanks
I'm trying to produce an online quiz for someone and I want to prevent users from viewing the source. Otherwise they can workout which answer to pick by peeking at the source. Can anyone tell me how to do this? Is it possible?
Thanks
Go to javascript.com, they have **** loads of scripts for nearly everything including stopping 'view source' actions. Although not foolproof, they work pretty well.
Depending how the quiz is coded why not just keep the code elsewhere in a separate file?
Interesting thought. I don't know how that is done. It is currently coded in normal HTML. Is there an include facility in HTML? I haven't yet mastered any serious JavaScript programming. I'm too busy at the moment.Originally Posted by D-A-L
The quiz has multiple choice answers. The correct answer links to the next question. The incorrect answers point to a "Wrong, start again page"
I have opened a window which has no status bar so you can't see where the links are pointing. All links also have 'visited' and 'unvisited' set to the same colour so that links to the 'wrong' page aren't obvious.
The quiz is an educational thing for kids but I don't underestimate their ingenuity at cheating. Hiding view source should be enough security for this.
Thanks for the advice thus far.
there is an 'include' function in HTML -
<!--#include file="file.extension" -->
but when you load the page and view source, the page's code is presented with the code imported from the include tag.
That's true but I was thinking of the javascript route also.... You could disable right-click with something like this - http://javascript.internet.com/page-...ght-click.html
That would stop a few users but people could always click view>source. You could make sure the windows does not have a file menu which would help but again they could use the shortcut key to View Source. Both those will stop quite a few people but the more advanced way would have to be javascript I think.
Thanks D.A.L. Given that this is for young people, not rocket scientist, I reckon that will do the trick. The window I have created doesn't have a file menu.
Now that I've found this site, I doubt if it is the last time I'll visit.![]()
Encode it in flash or shockwave and despite downloading the file it will not be decipherable just in binary format. Although there are tools to extract images and animations from flash and shockwave there are none to decipher the compiled .swf file.
The other alternatives are to code it with .net as a .DLL or something like coldfusion which has a built in encrypt command. Client side java script is easily disassembled by simply loading the whole page into a text viewer not your browser and then pulling the code apart from there.