What is the best approach for storing question data in a database?

There is a wizard that can contain more than 150 questions, or a total of 10. Each question may differ from a previously asked question. For example, it is possible that one question requires an answer to the answer "Yes / No", but the next one may contain a list with several choices with four parameters. It should also be possible to fill out a completely open answer to the question asked in this wizard. The wizard consists of several sections.

The results of this wizard should also be evaluated. For example: "Have you ever forgot to wear shoes when you are going to work?" "Well no". If the user replied β€œyes”, we must evaluate this and tell him that he should put his shoes on the door, so he will never forget him again. (Example)

The results of this wizard should be stored in the database, but this is done in one table, and just adding all the data to this table looks useless to me. Is there anyone here who has a clean solution so that, for example, if we ever had to rebuild a wizard like this, we can just use the same database?

+3
source share
5 answers

. :

, , , AnyOtherInfoYouMightWantToStore

Id, WizardId, Question, SortNumber

Alternative

Id, QuestionId, TypeId (, , , freetext...), Name, SortNumber

Id, UserId ( , - ), QuestionId, AlternativeId

. , ( + , , , , , "" )

+5

, . .

. , , , "/" ( , ). .

, . , ; , , , .

+5

Wikipedia - - .

() () () ().

, , . , .

+2

. /: .

+1

" Duane Hookum at Your Survey" :

http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=3

it is a (mostly) normalized database that you can look at for more information on how to create a survey database.

+1
source

Source: https://habr.com/ru/post/1728579/


All Articles