A question consists of question types. These types describe how a question should be rendered. The description is done in JSON format and is contained in the "Json" column of the QuestionType table.
Here the basic json format:
[
{
"inputTemplate": "TEMPLATE WITH PLACEHOLDER {VARIABLE_NAME}"
"inputs": [
{
"type": "TYPE",
"variable": "VARIABLE_NAME",
}
]
}
] |
Currently the following input types are supported:
| |||||||||
| number | basic | |
|---|---|---|
[ |
| |
| complete | ||
| [ { "inputTemplate": "", "inputs": [ { "type": "number", "variable": "targetPreasure", "label": "Druck: ", // instead of the inputTemplate a label can be set which is display above the input "decimalDigits": 2, // sets the number of decimal digits - default 0 "thousandSeperator": true, // controls if a thousand seperator should be shown - default false "style": "background-color: lightblue;" // custom style } ] } ] |
| |
| text | basic | |
|---|---|---|
[ |
| |
| complete | ||
| [ { "inputTemplate": "", "inputs": [ { "type": "text", "variable": "description", "label":"Bezeichnung: ", "style":"color: red" } ] } ] |
| |
Radio input
| radio | basic | |
|---|---|---|
[ |
| |
| advanced | ||
| [ { "inputTemplate": "", "inputs": [ { "type": "radio", "label": "Ja", "value": 1, "variable": "result", "iconVisible": false, "color": "btn-primary" }, { "type": "radio", "label": "Nein", "value": 2, "variable": "result", "deselectable": false, "color": "btn-secondary" }, { "type": "radio", "label": "Vielleicht", "value": 3, "variable": "result", "deselectable": false, "color": "btn-success" }, { "type": "radio", "label": "Weiß nicht", "value": 4, "variable": "result", "deselectable": false, "color": "btn-danger" } ] } ] |
| |
| checkbox | basic | |
|---|---|---|
[ |
| |
| advanced | ||
| [ { "inputTemplate": "1: {result1} 2: {result2}", "inputs": [ { "type": "checkbox", "label": "Druckprüfung", "variable": "result1", "color": "btn-success" }, { "type": "checkbox", "label": "Temperaturprüfung", "variable": "result2", "color": "btn-danger" } ] } ] |
| |
| date | basic | |
|---|---|---|
[ |
| |
| advanced | ||
| [ { "inputTemplate": "", "inputs": [ { "type": "date", "label": "Druckprüfung", "variable": "result", "customFormat": "YYYY/MM/DD", "useCurrent": true, "minDate": "2023/01/01", "maxDate": "2024/01/01" } ] } ] |
| |
| range | basic | |
|---|---|---|
[ |
| |
| textarea | basic | |
|---|---|---|
[ |
| |
| advanced | ||
| [ { "inputTemplate": "Beschreibung", "inputs": [ { "type": "textarea", "variable": "result", "rows":10, "placeholder": "placeholder..." } ] } ] |
| |
| picture | basic | |
|---|---|---|
[ |
| |