Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Fragentypen lassen sich aktuell noch nicht über die Webfrontends konfigurieren. Diese können aber bereits schon in der Datenbank gepflegt werden. Bei Fragen, dürfen Sie gerne Ihren Germanedge Ansprechpartner kontaktieren.

Question types:

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.

...

Currently the following input types are supported:

Anchor
number
number

Number input

numberbasic

[
  {
    "inputTemplate": "Soll: {targetPreasure} bar",
    "inputs": [
      {
        "type": "number",
        "variable": "targetPreasure"
      }
    ]
  }
]

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 
      }
    ]
  }
]

Anchor
text
text

Text input

text


basic


[
  {
    "inputTemplate": "Bezeichnung: {description}",
    "inputs": [
      {
        "type": "text",
        "variable": "description"
      }
    ]
  }
]

complete
[
  {
    "inputTemplate": "",
    "inputs": [
      {
        "type": "text",
        "variable": "description",
        "label":"Bezeichnung: ",
        "style":"color: red"
      }
    ]
  }
]

Anchor
radio
radio

Radio input

radio


basic

[
  {
    "inputTemplate": "",
    "inputs": [
      {
        "type": "radio",
        "label": "Ja",
        "value": true,
        "variable": "result"
      },
      {
        "type": "radio",
        "label": "Nein",
        "value": false,
        "variable": "result"
      }
    ]
  }
]

advanced

[
  {
    "inputTemplate": "",
    "inputs": [
      {
        "type": "radio",
        "label": "Ja",
        "value": 1,
        "variable": "result",
        "iconVisible": false,
        "color": "rgb(92, 184, 92)"
      },
      {
        "type": "radio",
        "label": "Nein",
        "value": 2,
        "variable": "result",
        "deselectable": false,
        "color": "rgb(217, 83, 79)"
      },
      {
        "type": "radio",
        "label": "Vielleicht",
        "value": 3,
        "variable": "result",
        "deselectable": false,
        "color": "#0069d9"
      },
      {
        "type": "radio",
        "label": "Weiß nicht",
        "value": 4,
        "variable": "result",
        "deselectable": false,
        "color": "#5a6268"
      }
    ]
  }
]

Anchor
checkbox
checkbox

Checkbox input

checkboxbasic

[
  {
    "inputTemplate": "",
    "inputs": [
      {
        "type": "checkbox",
        "label": "Druckprüfung",
        "variable": "result1"
      },
      {
        "type": "checkbox",
        "label": "Temperaturprüfung",
        "variable": "result2"
      }
    ]
  }
]

advanced

[
  {
    "inputTemplate": "1: {result1} 2: {result2}",
    "inputs": [
      {
        "type": "checkbox",
        "label": "Druckprüfung",
        "variable": "result1",
        "style": "background-color: rgb(217, 83, 79); color: white;"
      },
      {
        "type": "checkbox",
        "label": "Temperaturprüfung",
        "variable": "result2",
        "style": "background-color: rgb(92, 184, 92); color: white;"
      }
    ]
  }
]

Anchor
date
date

Date input

datebasic

[
  {
    "inputTemplate": "",
    "inputs": [
      {
        "type": "date",
        "label": "Druckprüfung",
        "variable": "result"
      }
    ]
  }
]

advanced
[
  {
    "inputTemplate": "",
    "inputs": [
      {
        "type": "date",
        "label": "Druckprüfung",
        "variable": "result",
        "customFormat": "YYYY/MM/DD",
        "useCurrent": true,
        "minDate": "2023/01/01",
        "maxDate": "2024/01/01"
      }
    ]
  }
]

Anchor
range
range

Range input

rangebasic

[
  {
    "inputTemplate": "Druck: {druck}",
    "inputs": [
      {
        "type": "range",
        "variable": "druck",
        "min": 10,
        "max": 350,
        "step": 10
      }
    ]
  }
]

Anchor
textarea
textarea

Textarea input

textarea


basic

[
  {
    "inputTemplate": "Beschreibung",
    "inputs": [
      {
        "type": "textarea",
        "variable": "result"
      }
    ]
  }
]

advanced
[
  {
    "inputTemplate": "Beschreibung",
    "inputs": [
      {
        "type": "textarea",
        "variable": "result",
        "rows":10,
        "placeholder": "placeholder..."
      }
    ]
  }
]

Anchor
picture
picture

Picture input

picturebasic

[
  {
    "inputTemplate": "Foto",
    "inputs": [
      {
        "type": "picture",
        "variable": "photo"
      }
    ]
  }
]

Combined inputs

A question type can not only be of one input type. You can combine them as you wish

[
  {
    "inputTemplate": "Kesseldruck {druck} bar",
    "inputs": [
      {
        "type": "number",
        "min": 1,
        "max": 20,
        "variable": "druck"
      }
    ]
  },
  {
    "inputTemplate": "Kesseltemperatur {temperature} °C",
    "inputs": [
      {
        "type": "number",
        "variable": "temperature"
      }
    ]
  },
  {
    "inputTemplate": "I.O.? {resultIO}",
    "inputs": [
      {
        "type": "radio",
        "label": "Ja",
        "value": 1,
        "variable": "resultIO"
      },
      {
        "type": "radio",
        "label": "Nein",
        "value": 2,
        "variable": "resultIO"
      }
    ]
  }
]

Limit Values

The question types number, range, and date can be provided with limit values.

...

Examples
[
  {
    "inputTemplate": "Kesseldruck {druck} bar",
    "inputs": [
      {
        "type": "number",
        "variable": "druck",
        "decimalDigits": 1,
        "thousandSeperator": true,
        "min_valid":100,
        "max_valid":300,
        "max_UV":null,
        "min_UV":null
      }
    ]
  }
]

"min_valid" and "max_valid" have values set and "max_UV" and "min_UV" is empty. Therefore 100 is used as the minimun limit value and 200 as the max limit value.

[
  {
    "inputTemplate": "Kesseldruck {druck} bar",
    "inputs": [
      {
        "type": "number",
        "variable": "druck",
        "decimalDigits": 1,
        "thousandSeperator": true,
        "min_valid": null,
        "max_valid": null,
        "max_UV": "Druck-max",
        "min_UV": "Druck-min"
      }
    ]
  }
]

In this example "min_valid" and "max_valid" are null, so it will be checked if the object or question has a UniversalFieldValue for the UniversalField "Druck-max" and "Druck-min". If yes, this values are used as limit values.
[
  {
    "inputTemplate": "Kesseldruck {druck} bar",
    "inputs": [
      {
        "type": "number",
        "variable": "druck",
        "decimalDigits": 1,
        "thousandSeperator": true,
        "min_valid":100,
        "max_valid":200,
        "max_UV": "Druck-max",
        "min_UV": "Druck-min"
      }
    ]
  }
]
Both the "_valid" fields and the "_UV" fields have values stored. In this case the values from the "_UV" fields have priority, except there are no UniversalFieldValues set on the object or question then 100 and 200 are used as fallback limit values.
[
  {
    "inputTemplate": "Kesseldruck {druck} bar",
    "inputs": [
      {
        "type": "number",
        "variable": "druck",
        "decimalDigits": 1,
        "thousandSeperator": true,
        "min_valid":null,
        "max_valid":200,
        "max_UV":null",
        "min_UV": "Druck-min"
      }
    ]
  }
]
In this case 200 is used as max limit value and the value of the UniversalField "Druck-min" is used as min limit value. If "Druck-min" is not set, then not min limit value is used.


Additional fields

Question types can have additional fields which will be shown if a condition is fullfilled.
The fields are stored inside the table dynamic fields:

...