I have a friend who’s working at a newspaper and has been given a big flow-chart for a sort of “Which of these are you?”-type online quiz. You know the type — “Which type of athlete are you?”, “Which Television Show X character are you?”, etc.
Essentially Question A forks to two options, each of those options forks to another question with N options, each of which forks to another question with another arbitrary number of options, and so on, with the user eventually reaching an end-point. You might reach a “You are $this” response after 1 fork, or it might take 5. No question is used more than once.
I’m really quite curious what’d be the best way to do this. It could probably be done in ~1000 lines with a bunch of nested functions, but I get the feeling my lack of Computer Science education is failing me at this point. Alternatively, is there a library somewhere that’d be good for this, or is this simply a question of writing a bunch of code?
Any thoughts? Thanks!
If there is only one Final Conclusion in the flowchart quiz, then the problem is comparable to a 20Q Game, Category Page Arrangement, or an Org Chart.
It may involve 3 columns: Child Question(s), Parent Question(s), and the List Of Answers.
If the Final Question is asked, either it goes to the Final Conclusion (and ends) or it goes back to a certain Parent Question (to loop).
Hope it makes sense.