Page 1 of 1
how to save answers
Posted: Thu Nov 13, 2008 3:25 pm
by yacahuma
If you had to save the answer of an exam, and the exam had 1000 questions. Will you save the answers like
OPTION #1:
COLUMNS: EXAM_ID | USER_ID | Q1 | Q2 | Q3| ... | Q1000
Ej of a row
1 | 1 | a|b|c|d......|x
OR
OPTION #2:
COLUMNS: EXAM_ID | USER_ID | Q_ID | ANSWER
EJ
1 | 1 | 1 | a
1 | 1 | 2 | b
1 | 1 | 2 | c
Why?
Re: how to save answers
Posted: Fri Nov 14, 2008 11:33 am
by Hannes2k
Hi,
I would prefer the second solution, because, creating 1000 columns isn't a nice job and displaying it with a database managment tool won't be possible.
And:
With option#2 you can easily extend your system. Maybe the new test have 1010 questions or just 990? And what happen if you create a second test with just 50 questions?
With option #2 you can store the answers for each test in your database. You could theoretical also store the answers for a multiple choice question. This won't be possible with Option #1.
Re: how to save answers
Posted: Sun Nov 16, 2008 9:16 pm
by yacahuma
thank you.
Re: how to save answers
Posted: Mon Nov 17, 2008 4:41 am
by aceconcepts
To normalise it further you could create an additional table to house user id with exam id thus there would be no need to have exam id in option#2.