Note: this is NOT like this question
I've been tasked to construct a survey that our customer service people can use to get info from our customers about our service etc.
My question is how to store the questions/answers in the db where the questions are stored like so:
- boolean question1
- if (false): string question2 (typically the reason why question1 was false)
This would be easy, however the questions can be nested multiple levels:
- boolean question1
- if (false) boolean question2
- if (true) string question3
- if (false) string question4
- if (false) boolean question2
If I didn't have to store it in the db, I would represent the questions (and indeed the whole survey) as a composite, but I don't know how I'd store something like that.