Answer the question
In order to leave comments, you need to log in
How to store user responses and display questions in the testing system?
Hello! I am writing a testing system where I would like to store the user's answer to each question, but I don't know how to save the answers. It comes to mind, only: to create a column "user_answers" of type TEXT and write down the question ID in this way || Response ID, or responses separated by commas ||| Question ID || Response IDs and so on. Maybe there are other options?
How can I display questions for the user and how can I save the selected answer? Well, you can save the answer after clicking on the "answer" button, the selected answer will be recorded in the database as described above, but how to display answers to which the user has not yet answered? Check the user_answers column each time?
Ps sorry for this wording!
Answer the question
In order to leave comments, you need to log in
3 tables:
questions:
id | question
answers:
id | question_id | answer
answer_user
answer_id | user_id (или question_id | answer_id | user_id)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question