Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Database design for a quiz app [closed]

I am little stuck with the database design for my quiz app. Kindly guide me on this -

My app UI will go something like this -

Image

My DB Tables -

User -

user_id
user_name
user_email
user_password
user_registration_date
user_active

Question -

question_id
question_title
question_category_id
question_level_id
question_author_id
question_status
question_create_date

Category -

cat_id
cat_name
cat_author
cat_create-date
cat_status

Level -

level_id
level_name

Answer -

?????????

Queries -

I am stuck with the answer table..means I am not sure what columns to be set in answer table with the data type for this.

MY answer will only going to be in option format means 1,2,3,4 options or true false in an option NO text type answer ..just a choice selection.

Kindly guide me as I am stuck with this.

Please signify if there is something wrong in the above mentioned tables as well and let me know if crating a separate table for Level is OK or its a bad (Level will only be - Beginner, Intermediate, Advance).

like image 996
Trialcoder Avatar asked Oct 21 '25 05:10

Trialcoder


1 Answers

In the past when I have done this I have handled answers in this way:

Table: QuestionAnswers
Fields: ID, QuestionID, AnswerText (string), AnswerCorrect (bool)

Table: QuestionAnswerResponses
Fields: ID, QuestionAnswerID (linking to the ID table above), Userid, AnswerSelected (bool), TimeAnswered (datetimr).

like image 145
Jack Pettinger Avatar answered Oct 23 '25 19:10

Jack Pettinger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!