B
B
BarneyGumble2016-08-24 17:43:30
Database design
BarneyGumble, 2016-08-24 17:43:30

What is the correct way to develop a MySQL database architecture for a PHP testing system?

The task is simple - I need to develop a system for testing employees with subsequent evaluation of their results.
There are 20 questions in total.
Answer types - 3:
1. One option (radio button)
2. Several options (checkbox)
3. Free form (textarea)
All data about the test subject and his results must be saved to the database.
I have encountered the complexity of developing a database architecture for this task, and I would like to hear your advice, as YOU would do in this situation.
So far I've come up with the following scheme -efcce391f5124729ae7140ab955bd543.jpg
This whole story is complicated by questions with free answers, because for such questions it is impossible to create a table with correct, pre-known answer options, so that the script runs through two tables (user answers and correct answers), and comparing them, would give the result.
The director will evaluate the manual free answers. Only he can evaluate what is written and mark the option as either correct or not. Those. it is desirable for him to see in the browser a page with manual answers of each test subject, in order to put his tick next to the correct one, sending this data to a separate database table.
Then, having tables with the results of the answers, we can write a script that compares everything and gives the result.
How would you solve the same problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Skleinov, 2016-08-24
@lexskal

As I understand it, this is an analogy of centralized testing ....
The first table is a table of questions with answers, both correct and incorrect, and a key with correct answers ... in the script, when answering a question, the answer is checked with the key and if it is true - true (score ).... For all answers, the score is summed up and entered in the second table along with the written answers and the number of test questions to calculate the average score.
As for logging user responses, this is the second table. It contains the necessary data of the user and his answers with an assessment.
Answer options can be entered in one field, say, separated by a comma or a new answer from a new line. It makes no sense to have a separate field for each answer.
The score for written questions is also scripted to add to the total score.

X
xmoonlight, 2016-08-24
@xmoonlight

users: id, user
answersTypes: id, type
questions: id, question, answersTypeID
answers: id, answer , questionID, sortPos
answersUsers: id, answerID, userID, questionID
--- answer
field - can contain an id or a string (this field is arbitrary data)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question