Page 1 of 1

Multiple Choice Question Evalutaion

Posted: Tue Oct 28, 2008 2:51 am
by vidyabhushan
I have a database in which i have stored all MCQ questions with options and correct answer.

Now Im facing problem when generating an user interface for taking test..

There i cant write two questions at a time because i cant give name for radio buttons. Number of questions in the database is unknow apriori.

So now i thought of giving one question at a time to the participant and evaluate it and give another question.. but how can i display one question at a time??? Only after submitting answer to that particular question the next question should appear.. So how to solve this requirement??? Please some one do help me.....

Thanx in Advance....

Re: Multiple Choice Question Evalutaion

Posted: Tue Oct 28, 2008 2:53 am
by papa
Why can't you give names to radiobuttons?

Re: Multiple Choice Question Evalutaion

Posted: Tue Oct 28, 2008 2:55 am
by vidyabhushan
Number of questions in the data base is not known.

Re: Multiple Choice Question Evalutaion

Posted: Tue Oct 28, 2008 2:59 am
by papa
Well, that's one of the main reasons of using PHP. To get a dynamic solution.

How have you structured the db table so far?

Re: Multiple Choice Question Evalutaion

Posted: Tue Oct 28, 2008 3:03 am
by vidyabhushan
the question table structure is like this

question_no | question | option1 | option2 | option3 | option4 | answer | time_rqrd | marks |

Re: Multiple Choice Question Evalutaion

Posted: Tue Oct 28, 2008 3:06 am
by papa
So, if you wanted all questions on one page. You can extract them from the database and sort by question_no. Looping through the options to see how many radiobuttons you need to display.

If you still want to display one question at a time, there is a couple of ways you can go about that.

Re: Multiple Choice Question Evalutaion

Posted: Tue Oct 28, 2008 3:09 am
by vidyabhushan
Please tell me how to display one question a time????

Re: Multiple Choice Question Evalutaion

Posted: Tue Oct 28, 2008 3:16 am
by papa
Do you know HTML and PHP? No point of me writing the code for you. Show me some code after you've giving it a try and I'll help you.

First of you should make the html form and then start looking on mysql functions (if you are using mysql of course) on php.net.