After working strenuously on a project using AJAX + PHP designing a matching quiz game, I learned that the learning suite that my company uses to distribute its products does not let me run server-side scripts on the backend to check answers securely. This is all due to an unfortunate hierarchical autocracy.
Long story short, I have to somehow check answers on the client side (or figure out something tricky). Luckily, I have been able to upload jQuery to the local folder structure so I can use that.
What is the most secure method for checking clients’ answers on the client-side? Or is there some way to reference an external file…like an XML file or something, to check the answers more securely?
The only thing I can think of is obfuscating your code. This process is also known is minifying it. If you do this your code will be harder to read and thus marginally more difficult to hack. It does not make it unhackable, but it makes life slightly more difficult for those who wish to cheat. You have several options:
I think that covers all of the main ones, but if you know of any more that I haven’t mentioned, please leave a comment below.
Related question to this answer: Is there a good JavaScript minifier?