We are planning to build an MVC application which will act as a Wizard, asking users certain questions and based on the answers a file is generated. The wizard though has to be able to branch, skip certain questions based on previous answers.
For example, Q1 always as be asked, it's a true/false question. If answered true then we proceed to Q2 and then Q3. If answered false we skip Q2 and go to Q3.
Are there any design patterns that might help, specially if the users decide to change the flow, for example stick another question in between Q2 and Q3. I thought initially I would have a view for each question. the Q1 action would return the next view (Q2 or Q3) based on the answer. however i'm not sure if that's the best way, doing this would require rebuilding the code if the questions order needs to change.
Aucun commentaire:
Enregistrer un commentaire