Questionnaire
This chapter describes the concept of a questionnaire, which is a set of questions that can be used to receive all kinds of different information from the user. It's often used in combination with a trip interface, for example when the user is signing off a stop or finishing a trip. It for example allows text, number, photo or sign on glass questions to be presented to the user, making it useful for obtaining every conceivable piece of information.
Question
A question is a single item in a questionnaire that can be used to collect or show information from or to the user.
A question is represented as a JSON object that contains the properties that define how the question should behave and look.
Name | Type | Description | Required | Default |
|---|---|---|---|---|
id | Int | The unique ID of the question. | true | |
required | Bool | Whether the question is required to be answered before the user can go to the next question. | false | true |
type | String | The type of the question. This determines how the question will be displayed and its behavior. | true | |
key | String | The key to the question. This is used to save the answer in the local database. | true | |
label | String | The label of the question. This is displayed to the user. | true | |
description | String | Description of the question. This is displayed to the user, for example, below the label. | false | |
answers | Array | An array of answer objects. | true |
Answer
A question contains one or more answers. Each answer is represented as an object in the answers array of questions. The answer object contains the properties that define how the answer should behave and look like.
The answer object is a JSON object that contains the following properties:
Name | Type | Description | Required |
|---|---|---|---|
id | int | The id of the question. | true |
nextQuestionId | int | The id of the next question to be shown after this question. | true |
label | string | The label of the answer. | false |
value | string | The value of the answer. | false |
Examples
This is a simple example of how a questionnaire could look like. It contains the question types Info, Text Box, Photo, Signature and License.