Multiple Choice Question Evalutaion

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vidyabhushan
Forum Newbie
Posts: 16
Joined: Mon Oct 20, 2008 4:58 pm

Multiple Choice Question Evalutaion

Post 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....
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Multiple Choice Question Evalutaion

Post by papa »

Why can't you give names to radiobuttons?
vidyabhushan
Forum Newbie
Posts: 16
Joined: Mon Oct 20, 2008 4:58 pm

Re: Multiple Choice Question Evalutaion

Post by vidyabhushan »

Number of questions in the data base is not known.
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Multiple Choice Question Evalutaion

Post 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?
vidyabhushan
Forum Newbie
Posts: 16
Joined: Mon Oct 20, 2008 4:58 pm

Re: Multiple Choice Question Evalutaion

Post by vidyabhushan »

the question table structure is like this

question_no | question | option1 | option2 | option3 | option4 | answer | time_rqrd | marks |
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Multiple Choice Question Evalutaion

Post 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.
vidyabhushan
Forum Newbie
Posts: 16
Joined: Mon Oct 20, 2008 4:58 pm

Re: Multiple Choice Question Evalutaion

Post by vidyabhushan »

Please tell me how to display one question a time????
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Multiple Choice Question Evalutaion

Post 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.
Post Reply