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
TypeExampleAusgabenumber

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

Image Modified

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

Image Added

Anchor
text
text

Text input

text


basic


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

Image Modified

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

Image Added

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

Image Modified

checkbox
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": "

checkbox

radio",
        "label": "

Druckprüfung

Vielleicht",
        "value": 3,
        "variable": "result",
        "deselectable": false,
        "color": "

result1

#0069d9"
      },
      {
        "type": "

checkbox

radio",
        "label": "

Temperaturprüfung

Weiß nicht",
        "value": 4,
        "variable": 

"result2

"result",
        "deselectable": false,
        "color": "#5a6268"
      }
    ]
  }
]

Image Removed

Image Added

Anchor
checkbox
checkbox

Checkbox input

checkboxbasic
date

[
  {
    "

id

inputTemplate": "

druck

",
    "

inputTemplate

inputs": [
      {
        "type": "checkbox",
        "label": "Druckprüfung",

    

        "

inputs

variable": 

[

"result1"
      },
      {
        "type": "

date

checkbox",
        "label": "

Druckprüfung

Temperaturprüfung",
        "variable": "

result

result2"
      }
    ]
  }
]

Image Removed

Image Added

range
advanced

[
  {
    "inputTemplate": "

Druck

1: {result1} 2: {

druck

result2}",
    "inputs": [
      {
        "type": "

range

checkbox",
        "label": "Druckprüfung",
        "variable": "result1",
        "style": "

druck

background-color: rgb(217, 83, 79); color: white;"
      },
      {
        "type": "checkbox",
        "

min

label": 

10

"Temperaturprüfung",
        "

max

variable": 

350

"result2",
        "

step

style": 

10

"background-color: rgb(92, 184, 92); color: white;"
      }
    ]
  }
]

Image Removed

Image Added

Anchor
date
date

Date input

datebasic
textarea

[
  {
    "inputTemplate": "

Beschreibung

",
    "inputs": [
      {
        "type": 

"textarea

"date",
        "label": "Druckprüfung",
        "variable": "result"
      }
    ]
  }
]

Image Removed

Image Added

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

Image Removed

Detailed

Image Added

Anchor
range
range

Range input

rangebasic

...

[
  {
    "inputTemplate": "Druck: {druck}",
    "inputs": [
      {
        "type": "

number

range",
        "variable": "

targetPreasure

druck",
        "

label

min": 10,
        "max"

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": 

350,
        "step": 10
      }
    ]
  }
]

Image Added

Anchor
textarea
textarea

Textarea input

"background-color: lightblue;" // custom style 
textarea


basic

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


      }
    ]
  }
]

Image Removed

Image Added

...

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

Image Added

Anchor
picture
picture

Picture input

"Bezeichnung
picturebasic

[
  {
    "inputTemplate"

: "Foto",
    "inputs": [
      {
        "

style

type":

"color: red

 "picture",
        "variable": "photo"
      }
    ]
  }
]

Image Removed

Image Added

radio

Combined inputs

A question type can not only be of one input type. You can combine them as you wishTODO: iconvisible, deselectable not working - check color

[
  {
    "inputTemplate": "Kesseldruck {druck} bar",
    "inputs": [
      {
        "type": "

radio

number",
        "

label

min": 1,
        "

Ja

max": 20,
        "

value

variable": 

1,
        "variable

"druck"
      }
    ]
  },
  {
    "inputTemplate": "

result

Kesseltemperatur {temperature} °C",
    "inputs": [
      {
        "

iconVisible

type": 

false

"number",
        "

color

variable": "

btn-primary

temperature"
      }
    ]
  },

      

  {

        

    "

type

inputTemplate": "

radio

I.O.? {resultIO}",

        

    "

label

inputs": 

"Nein",

[
      {
        "

value

type": 

2

"radio",
        "

variable

label": "

result

Ja",
        "

deselectable

value": 

false

1,
        "

color

variable": "

btn-secondary

resultIO"
      },
      {
        "type": "radio",
        "label": "

Vielleicht

Nein",
        "value": 

3

2,
        "variable": 

"result",
        "deselectable": false,
        "color": "btn-success"
      },
       

"resultIO"
      }
    ]
  }
]

Image Added

Limit Values

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

The limit values can be maintained on the question type, on the question and on the asset. If no limit value is defined in the object, the limit value of the question is used.
If none is defined in the question, the the one from the question type is used.

So the input type inside the Json of the question type contains "min_valid", "max_valid", "max_UV" and "min_UV".
If "min_valid" or "max_valid" contains a value and "min_UV"/"max_UV" is null, then values of "min_valid"/"max_valid" are used.
On the other hand if "min_UV"/"max_UV" contains values, which are names of UniversalFields, then the values of this UniversalFields are used (when it exists).
The UniversalFields can be added to the object or the question as a UniversalFieldTab. If both have the same UniversalField, the one from the object has priority.

Examples
[
  {
    "inputTemplate": "Kesseldruck {druck} bar",
    "inputs": [
      {
        "type": "
radio
number",
        "
label
variable": "
Weiß nicht
druck",
        "
value
decimalDigits": 
4
1,
        "
variable
thousandSeperator": 
"result"
true,
        "min_valid":100,
        "
deselectable
max_valid":
 false
300,
        "
color
max_UV":
 "btn-danger"
null,
        "min_UV":null
      }
    ]
  }
]

Image Removed

...

"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.

Image Added

Image Added

Image Added

[
  {
    "inputTemplate": "

1: 

Kesseldruck {

result1} 2: {result2}

druck} bar",
    "inputs": [
      {
        "type": "

checkbox"

number",
        "variable": "druck",
        "decimalDigits": 1,
        "thousandSeperator": true,
        "

label

min_valid": 

"Druckprüfung"

null,
        "max_valid": null,
        "

variable

max_UV": "

result1

Druck-max",
        "

color

min_UV": "

btn

Druck-

success

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": 
"checkbox
"number",
        "variable": "druck",
        
"label
"decimalDigits": 1,
        "thousandSeperator": 
"Temperaturprüfung"
true,
        "min_valid":100,
        "max_valid":200,
        "
variable
max_UV": "
result2
Druck-max",
        "
color
min_UV": "
btn
Druck-
danger
min"
      }
    ]
  }
]

Image Removed

...

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.
[
  {
    "
id
inputTemplate": "
druck",
    "inputTemplate": ""
Kesseldruck {druck} bar",
    "inputs": [
      {
        "type": "
date
number",
        "
label
variable": "
Druckprüfung
druck",
        "
variable
decimalDigits": 
"result"
1,
        "
customFormat
thousandSeperator": 
"YYYY/MM/DD"
true,
        "min_valid":null,
        "
useCurrent
max_valid":
 true
200,
        "
minDate
max_UV":
 "2023/01/01"
null",
        "
maxDate
min_UV": "
2024/01/01
Druck-min"
      }
    ]
  }
]

Image Removed

...

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:
Image Added

The column Json contains the array of inputs, equals to them of the question types. In this example a input of type text for a comment and a picture input.

The conditions are stored inside of table condition and containing the condition as a "script":
Image Added
Inside the script you can use any variable name defined in the question type:

[
  {
    "id": "radios",
    "inputTemplate": "

...

",
    "inputs": [
      {
        "type": "

...

radio",
        "label": "Ja",
        "value": true,
        "variable": "result",
      },
      {
        "type": "radio",
        

...

"label": "Nein",
        "value":

...

 false,
        "

...

variable": "

...

result"
      }
    ]
  }
]

...

The DynamicField and Condition is linked to an question type over the table QuestionTypeDynamicFieldCondition.

In this example the dynamic fields are shown if the value of the variable result is false, say if the radio "Nein" is selected:

Image Added

...