I’m developing online examination system in php-mysql. That exam will consist of multiple-choice questions; I follow these steps:
1 ). I add all questions & their multiple choices (4 choices for each question) in a Database Table.
2 ). I give value 1 to correct answers & value 0 to wrong answers.
3 ). When user click finish exam button, then their all answers will be added with each other. for example,
0+1+1+0+0+0+1 FOR SEVEN DIFFERENT QUESTIONS AND RESULT WILL BE LIKE THIS 3/7
Now can anyone tell me that this process is OK for that type of application OR I need to improve it by using some other methodology. Thanks in advance.
Just a couple of thoughts. Are you also going to be storing the individual answers? If not, then you won’t be able to go back and see/show which answers the users picked.
Make sure, if you use this approach, that the form values for the responses aren’t
0and1as if people get wise to this then they may view the HTML source and cheat.To protect against this, one way would be to assign other/random values to each form response value, then check the responses with PHP. For example:
Then in your PHP code, check each answer to make sure the response is valid and increment the score appropriately. For example:
I’ve seen some multiple choice questionnaires penalise incorrect responses (so for example, you lose points for an invalid attempt). This can help if you want to stop people selecting random answers. Of course, for this to work you would also need to allow an ‘Unsure’ response (which, in your case, would result in
0) then the incorrect responses would add a negative value.I hope this helps