Create form based on a question bank?

0
Hello all, In our project one of our goals is to dynamically create a form based off a subset questions pulled from a larger pool of questions, based on the section (a number) that a question belongs to.  I am looking for advice on how best to accomplish this. Currently I have a button that begins the process of the form by calling a microflow. This microflow generates a list of all questions belonging to a certain section. From here, I am unsure of how to actually create and show the page of input widgets (based off of our list of questions) that make up our form.     Thanks in advance for any help!
asked
2 answers
1

You did see the Questionnaire (module) in the appstore? https://appstore.home.mendix.com/link/app/234/Mendix/Questionnaire-(module)

This will help creating the forms. I would use datasource microflows that retrieves random questions and then fill the right data fields before presenting them to the user.

Regards,

Ronald

 

 

answered
1

Hi Adam,

One way I've tackled a similar situation is to create Master records and transaction records. In this case, you would have an entity called "MasterQuestion" and then another entity called "Question". Master questions would be the questions that you setup in an administrative screen, and questions would be the questions that you display to a user. When you present the form to a user, you would retrieve a list of MasterQuestion, and then create a Question object for every master question. Then on the page you display to a user, you could use a listview to display all the questions. 

You would still have to figure out how to handle answers, whether you want to add an attribute on the question table for the answer, or setup answers similar to questions with MasterAnswer/Answer entites.

Also you would have to decide how you want to display the list of questions to the user, you could create a parent entity for Question, with a many to 1 association, then you can pass that parent entity to the page and display all questions using a listview over association. 

 

And like Ronald suggested, there is the questionnaire module in the app store. 

 

Hope this helps!

 

answered