L
L
Lev Rozanov2020-04-14 09:22:16
Database design
Lev Rozanov, 2020-04-14 09:22:16

How to properly store tests in the database?

The task is to develop a system for advanced training. Users need to take a test, which can have an arbitrary number of questions, multiple answers, and only one answer is correct. There will be three attempts to pass the test.

The storage of the number of attempts will be stored in the users table, but the question is: how to properly organize the structure of the table with tests, what to store them with maximum simplicity and convenience? My only idea is to store each question and answer on a separate line. Those. approximately the following table structure - question (stores the question), answer (stores the answer), true (stores the correct answer), id_prof (stores the id of the profession to which the test belongs).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-04-14
@dimonchik2013

blockchain zayuzai))
look - it doesn’t matter how and what you developed at first, if it can be painlessly redone,
collect more data and
store questions in general in JSON, it’s better to store them, then separately check with the correct one, but all reasoning is worthless since you still have a bunch you want the logic from above
like the others - sometimes the moodle code / base and that's all

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question