I am trying to write a script that will pull question from the database. Each question will have four options (stored in database) to choose from and the right answer is picked using radio button. After all question has been answered, it will check right answer from database to display the percentage scored.
I would like to start writing the script but I am running out of ideas on how to pull this off. I am kind of stuck in the logic of it. Any suggestions will be appreciated.
i am not that master on script.. sorry...
I was assuming that all the quiz questions would be asked on one page.
If the questions to the quiz are shown one at a time the user's quiz total could be stored in the session (which has the risk of being up to get garbage collected if the user doesn't answer back in about 20 minutes). Storing it in the database like that you'd need a way to lookup the user, by IP is ok but has the risk of inconveniencing users that don't have a static IP number and it happens to change during the test.
Joomla has many choices of quiz application or extension.
try research it.
Hi, Thats pretty easy. Store the quiz question & four options (with first option as answer) in a database table. While displaying the question, shuffles the options. And When user selects an option check if that value matches with first option in database. If yes, increment his points row or else do nothing.