I made this quite some time ago.
I had a module where I would create the survey and could configurate (TemplateConfig) this would look like this:
Then a module called survey where I would publish my surveys to the people, this would look like this:
So I would create a survey in my TemplateConfig, there I would add questions and the people that should enter the survey. Then when I was done with creating and configuring the survey I would publish it. I must say I created this survey app quick and dirty in a day or so to showcase Mendix and some modules like the email, deeplink etc. So I wouldn't advice to copy this 1-1 but I think it offers a good start for you.
The questions can be created with the start question what kind of question do you want to add (make this an enum). From there on you can show the required fields when adding a question for example:
[edit] QuestionnaireHeader entity can be considered as a category. For example you can have a header called Personal where you add questions about age and so on. Then you can create another Header where you can add additional questions such as type of work, skills, years of work experience etc. By adding a sequence at the header and questions (see the entities) you can add sorting.
- Survey name
-- Header
--- Question
--- Question
--- Question
-- Header
--- Question
--- Question
--- Question
Use JSON Schema to JSON Form widget https://marketplace.mendix.com/link/component/207872