I have a web project that requires I build a quiz and am having some difficulty working out how to efficiently code it. I'd like to create some sort of json template system so that the quizzes can be defined in a config file, my problem is that almost every question on the quiz is structured differently.
So some questions are simple yes/no answers, some have text input, some are multiple choice. Now this is not too difficult to do by defining the question attributes in json but there is also some logic involved. For example:
If question 2 is answered no and question 3 is answered no, then go back to question 2 and ask it again but only ask it twice, otherwise go to question 4.
This is where I am struggling, as I've said I'd like to create some sort of json template system so that the quizzes can be defined in a config file but I cannot think of a way to do that with logic in the quiz.
Any ideas?