thnx for your reply. The problem is that i m fecthing the data from database (including questions and there answers) and saving it in js for further check once user submit the question. I am doing so because in this way i do not require a constant connection to my database or rather u can say that server load will not be that much. But in that way, if a user views the source code of that page, s/he will be able to see the correct answers too and I don’t want that.
for example u can visit on : http://www.phptutorial.info/scripts/mul … xample.php
here u will get a sample MCQ and if you view the source code u will see that they are checking the user answer with one particular number (look in the very first js function, function Goahead. Though i am not litterly doing the same thing but again the issue is same.