I am creating a dynamic survey. I render one question in an RG. Based on Question type I show: text area (open question), radio buttons (yes/no), checkboxes (multi-select - rendered in sub-RG, based on answer options).
When I click on next the answer is saved to database in a ‘surveyresponse’ list and next question in shown.
In this process I am checking if answer is already given to decide if I should creates or update the
But the workflow steps in the onclick next button are growing rapidly with lots of conditions based on existence of surveyreponse and questiontype which causes to assign the answer based on different components like textarea, radio and multiple checkboxes.
I tried using a custom event for this, but in this I can’t access the components that holds the answers like textarea, radio and multiple checkboxes. Any thoughts on how to make this more efficient?