I am working on survey bundle. The goal is to provide user a fully working survey system. I have already prepared a backend which allows you to create survey, add questions (open text, radio buttons, checkboxes), make questions required or not, activate survey, generate tokens and send link to the survey with token on email. Of course i also have frontend which shows survey and saves answers. Now i want to add another possibility. A question with answers (radio or checkbox) and comment. For example:
Do you have a dog?
- Yes
- No
If user select Yes then additional field with question "What is the dog's name?" should appeared and allow user to enter dogs name. If user select No then nothing happen.
Such simple question can be with hidden field but what if i will have 20 questions with such "additional" informations?
Do you know some mechanism in symfony which will allow me to do that? I was trying with listeners but could not create anything flexible and universal (I can have questions with checkboxes and some of those answer in one question can have additional fields other dont have to).