What I have is in ColdFusion...  And I don't own it (although I did write it). It was 
written for commercial clients.
So I'm hesitant to send it.
But this is not hard...

Persoanlly what I would do is have 2 db tables...

1-Questions
2-Answers (foreign key to questions).
and if you want to save peoples answers you would have a third table
3-User_Answers

This way you only have one template to build.

If you are really good with DHTML and JavaScript, you can load all the data in to a 
JavaScript array and simply update
the question and answers everytime the user submits an answer. Save the answers in a 
JavaScript array to deal with later.
You can even have something where onUnload(Want to save answers to continue later?);
This means no reloading for every question.

With that many questions you only want them to see one question at a time.
But let them know somewhere how many questions they've done and how many
they have left to answer.

On the last one you submit it all in a post, enter it in a database if you want and 
give them the results.
Can even be the same page. Just look for

        if (isset($_POST['answers']) )
                check the answer;
        } else {
                output form;
        }

That's the way I would do it. This way it's easy to have many questionnairs, add 
questions, edit answers etc.


If you are not great with DHTML or Javascript, simply insert and retrieve one 
question.user answer at a time.
If you dont want to put answers in the database you can store it in a session.

Cheers,
Mike




*********** REPLY SEPARATOR  ***********

On 03/01/2003 at 3:16 PM Devin Atencio wrote:

>Mike,
>
>I would assume the questions would vary anywhere from 60-100 questions
>with each question possibly having 4-5 answers. Do you have some code
>I could look at? I have been trying to think about how to store the
>customers response, then score that against the correct answers etc
>in the database.
>
>Any help you could give me would be greatly appreciated.
>
>Devin Atencio.
>
>
>On Fri, 2003-01-03 at 15:14, Michael J. Pawlowsky wrote:
>> I've done a few...  It all depends on how many question and how many
>answers.
>> How often will they change.
>> How many will you have.
>>
>>
>> Mike
>>
>>
>>
>> *********** REPLY SEPARATOR  ***********
>>
>> On 03/01/2003 at 2:47 PM Devin Atencio wrote:
>>
>> >Dear PHP Users,
>> >
>> >I am in the process of trying to create an Online Program that will
>> >give questions and possible answers then score the test. I was wondering
>> >if anyone has done this type of thing already and might be able to give
>> >me some pointers on what the best method of doing this might be?
>> >
>> >Devin
>> >
>> >
>> >--
>> >PHP General Mailing List (http://www.php.net/)
>> >To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>>





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to