Welcome to Questionaries, where you can ask questions and receive answers from other members of the community.

Let us know at info@questionaries.org

data structure details?

10 like 0 dislike
hi i am trying to build something like an interactive application that works like a Q/A. The user is presented with information, and presented with a choice. When they choose, that choice is sent (ajax) to a php script that takes that choice and spits out more questions/options.
asked 1 year ago by webmaster (25,380 points)

1 Answer

1 like 0 dislike
 
Best answer
I have seen this implemented as

If you wanted to take the surveymonkey approach where you have questions (and the answer options serialised into the table) you would have another table called logic. The fields would be
* id
* question_id
* next_question_id

So when someone answers a question it would look to see if there is any logic associated with that question and feed the next_q_id into a function to get the question. If no logic exists then just get question_id + 1
answered 1 year ago by monirulislam (51,620 points)

Related questions

6 like 0 dislike
2 answers
asked 1 year ago by starcaller (24,080 points)
8 like 0 dislike
1 answer