Expertsystemen

 

Custom input types

xxllnc Expertsystemen has some built-in input types, such as the Yes/No radio button or the Countries of the world drop-down menu. However, at some point you will want to use your own questions. To do so, you need to define your own input types.

To create your own input type, you will first need to decide how the user can answer. For example, will the user answer in a drop-down menu? A radio group? Second, you need to create your own input type. In the following section we will give an example of creating an input type.

Example

Let’s imagine you want to know what car brand the user has. You are only interested in three well-known brands, and the others don’t really matter. Therefore, a radio button with the options Audi, Mercedes, Volkswagen and Other will do. To make them, add a question (Actions > Question). In the question screen, select Radio group and click the add icon.

adding an input type in the question screen
adding an input type in the question screen

Doing so will cause the Data Types screen to appear. It will automatically create a new input type for you. The first thing you should do is give it a logical name. In this case, consider ‘car brands’ or something related. You can later reuse this data type, which is why you have to name it. Next, enter all options the user can enter in a separate field. You can add a field by pressing [Enter] or using the buttons to the right of the field. Your screen should now look like this:

editing the input type
editing the input type

If you press OK and run your model (click run icon or press [F9]) you can see your newly created input type in action!

If at any point you want to edit your input type, you can select the edit button edit icon next to the add add icon button and the edit screen will reappear.

Expert mode

For some questions, you might need some more options. In that case you can check the Expert mode box in the bottom left of the screen. This will show more options than the normal input type screen.

expert mode for the input type
expert mode for the input type
Required
will make the question required. That means a user can’t go to the next screen unless the question is answered.
Read only
will not allow the user to answer the question: it will be readable but not editable.
Base type
is the input type your own type is based on. For example, you can change this to a time or date. This is only possible when you create the input type for the first time, not while editing one (see advanced custom input types).

You can also change the key values of input type. This will assign another value to the question for xxllnc Expertsystemen. In other words, the user sees the value but the Studio uses the key. Using different values can be useful in some situations. Image that we want to apply a score to the choice of car someone has and that score determines to which node you go. You can give each car a numerical value and use a condition to check if the score is high enough.

Be aware that changing the key value can cause quite some confusion! This is especially important when you are not the only editor of the model.