Entity building issue

0
So, i have i situation where i've got an EvaluationForm entity connected to an Event entity where every user that participate to that Event should complete an EvaluationForm. This EvaluationForm has no attribute because ive created a Question entity for it to assign the Question for an Event. And now i have to store the Answer to every type of question and i dont know how to do it because i have more type of questions (free text, dropdown list, 5 point scale, numeric etc....). I dont know how to create this Answer entity and how to link to the question
asked
3 answers
1

Hi developerName,

 

Can you share your domain model.

 

You can create Answer entity with one answer attribute string type. Whenever question is being answered convert value into the string format for display purpose.

 

Thanks,

Mobin

answered
0

.Hi,

Could you not create a Question entity with a String attribute that stores the question you want to ask, e.g. "How would you rate this question on a scale of 1 to 10?"

 

Give it a QuestionType enumeration as well which has the different types of questions you want to capture, for example 'DropDown', 'Numeric', 'Open'. 

 

Based on the selected type, apply conditional visibility to fields used for capturing the answer?

 

By default, show no answer fields, but if I select 'DropDown' show the dropdown widget with my options, or if I select 'Open' show an AnswerTextField?

 

A numeric scale would just be an enum with the values you want and then use a radio button to capture the answer.

 

If you wanted to capture a number, then just use a text field with some validation to only allow values between say 1-10 and nothing els

 

Would probably want it to more customisable by having yet another entity associated to it so that you can dynamically add items to a drop down instead of using runtime values.

answered
0

Take a look at https://marketplace.mendix.com/link/component/234

or any other similar marketplace components

answered