I am trying to write an online programming quiz app. So, many questions might be like, “What would be the output of the following code ?”.
There is a possibility that users might just copy-paste the whole code and try running it in another window. Is there any good way I can prevent this? I know we can disable right click and Ctrl-C, but is there any more elegant way? Even better, is there a way the app can know that the user is trying to copy stuff, and inform the user that it is not allowed?
(Tagging javascript just because I don’t know what to tag this as. Please retag to something more meaningful if you if you can think of something)
To really prevent any text tampering you could convert the code snippet into an image and post that for the user to read and interpret.
The image solution still leaves open the possibility of interpreting the image with an OCR app but using an OCR is significantly more complex than simply copying and pasting.