I am interested in creating an application that can create quizzes, by suplying a quiz name, questions and 4 possible answers (1 correct, 3 incorrect). These quizzes will be accessible to the user and certain user types can edit them, while others can answer them.
Should I separate the questions and answers in different tables? Or should I just have a question table, with 4 fields for the answers?
If you have done this before, what other considerations should I take when creating this quiz generator?
I’d say your relationships should be something like:
This would allow you to have more than 4 answers, if the requirements ever changed.
Things to consider perhaps:
How are you going to test if the answer is correct? Boolean, string comparison?
What if a given question asks for something that you couldn’t easily show in a “yes/no” or “true/false” situation? This problem may never arise if you want to limit to multiple choice, but it could.
How are you going to grade the quiz? Another table to store statistics about a users quiz history? Or is it a one off, using sessions?
using save all
should be all you need ~