Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Posts
    8

    Red face design of questionnaire

    Hi all,

    I'm designing a dbase using SQL server and using VB.Net. i have a form (paper
    form ) where the user is required to answer some questions and for some questions
    he has to select more than one answer

    e.g

    What are your favorite colours?
    1) checkbox1
    2) checkbox2
    3) checkbox3
    4) checkbox4

    Should i create a table only for that question and have my columns as checkbox1
    to checkbox4 ? If that's the case if i have 50-100 questions similar to this
    does it means i need to have 50-100 tables? i'm not really sure whether i'm
    on the right path or if there are better solutions. Please let me know.

    Thanks in advance for ur help..

    Regards,
    shobapond

  2. #2
    Join Date
    Nov 2002
    Location
    San Francisco
    Posts
    251
    what about to have one table just with questions - each question is one record and then another table, where each record correspons to one checkbox.

    In VB it's easy to programatically ADD checkbox, so you can quickly check how many records you have in the second table and add that many checkboxes boxes.

    If I go more to details, you can have even more answers than you want to show and randomly choose incorrect answers from a pool and add to it correct answer.


    so first table can look like this:

    QuestionID: 1
    Question: "What is bla bla?"
    ShowNumberofAnswers: 4


    and second table:
    AnswerID: 1
    QuestionID: 1
    CorrectQuestion: Yes
    AnswerText: "Answer1"

    AnswerID: 2
    QuestionID: 1
    CorrectQuestion: Yes
    AnswerText: "Answer2"

    AnswerID: 3
    QuestionID: 1
    CorrectQuestion: No
    AnswerText: "Answer3"

    AnswerID: 4
    QuestionID: 1
    CorrectQuestion: No
    AnswerText: "Answer4"

    AnswerID: 5
    QuestionID: 1
    CorrectQuestion: No
    AnswerText: "Answer5"


    so then your answer offer can be

    1234 or 1235 or 1245




    jiri
    Last edited by playernovis; 01-29-03 at 04:04.

  3. #3
    Join Date
    Jan 2003
    Posts
    8

    Thumbs up

    Hi

    Thanks a lot for your help and your example it has been very useful to me

    I'm going to use your way of designing my database..


    thanks for ur advice

    Originally posted by playernovis
    what about to have one table just with questions - each question is one record and then another table, where each record correspons to one checkbox.

    In VB it's easy to programatically ADD checkbox, so you can quickly check how many records you have in the second table and add that many checkboxes boxes.

    If I go more to details, you can have even more answers than you want to show and randomly choose incorrect answers from a pool and add to it correct answer.


    so first table can look like this:

    QuestionID: 1
    Question: "What is bla bla?"
    ShowNumberofAnswers: 4


    and second table:
    AnswerID: 1
    QuestionID: 1
    CorrectQuestion: Yes
    AnswerText: "Answer1"

    AnswerID: 2
    QuestionID: 1
    CorrectQuestion: Yes
    AnswerText: "Answer2"

    AnswerID: 3
    QuestionID: 1
    CorrectQuestion: No
    AnswerText: "Answer3"

    AnswerID: 4
    QuestionID: 1
    CorrectQuestion: No
    AnswerText: "Answer4"

    AnswerID: 5
    QuestionID: 1
    CorrectQuestion: No
    AnswerText: "Answer4"


    so then your answer offer can be

    1234 or 1235 or 1245




    jiri

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •