I want to create a Survey that consists of multiple Questions (different implementation classes). I would love to represent the Survey creation as well as all the Questions as FormType to make it easy to have Validation and all the good stuff from the Symfony Form Component. It is very easy to nest forms like described here.
But now comes the tricky part:
Every Question has its own FormType and a survey should be created as well as answered (filled out by the survey taker) on one page. So all questions on one page. More or less this is like Google Forms, being able to add new Questions on one page quickly as well make it easy for the user to see all questions at once.
My 2 Question would be:
- How can I add a FormType whose nested Types are known at runtime (admin can select which Question Type he wants to add)?
- How can I validate and store all the Forms on one page when the survey taker fills out a survey?
I would love to hear some ideas from you.
Thanks, Lukas