Skip to main content

Question

Question#

A question is the basic essence of a survey


AttributeTypeDescriptionNullable
idStringIdentifierfalse
templateIdStringIdentifier of templatefalse
originalIdStringIdentifier of the question that was before (put when deleting or updating)true
deletedBooleanQuestion activityfalse
tenantStringClient nametrue
nameStringQuestion namefalse
typeObjectQuestion type, see available types here false
conditionsList of objectsSetting the visibility of the question depending on the answer to another question true
calculatedBooleanAn indication that the question can be calculated false
requiredBooleanSign of the obligatory answer to the questionfalse
orderNumIntegerQuestion order number in templatefalse
updateAtDate and time at ISO formatDate and time of the last updatetrue
hintObjectQuestion hinttrue
needCommentBooleanSign the user can leave a commentfalse
commentRequiredList of integersSign the user is obliged to leave a commenttrue
enableCustomAnswerBooleanSign the user can add his answer (text) false
Example:
[
{
"id": "6080093d6ff4fb63493e3123",
"templateId": "606ac4f65b784e60cb88cb5b",
"originalId": "608008536ff4fb63493e3120",
"deleted": false,
"tenant": "",
"name": "Sample",
"type": {
"typeName": "NUMBER",
"grades": [],
"multiple": false,
"possibleAnswers": []
},
"conditions": [],
"calculated": false,
"required": true,
"orderNum": 0,
"updateAt": "2021-04-21T11:15:09.411",
"needComment": true,
"commentRequired": false,
"enableCustomAnswer": false
}
]

Hint#

tip

To add a hint use this request


AttributeTypeDescriptionNullable
textHintStringHint by texttrue
urlHintList of objectsHint with filetrue
Example:
{
"hint": {
"textHint": "Your text",
"urlHint": [
{
"name": "file.png",
"uid": "c430809a-fa7a-48a4-8bdb-d52b770948f0",
"url": "/files/s1/c/4/c430809a-fa7a-48a4-8bdb-d52b770948f0.png",
"size": 120963,
"contentType": "image/png"
}
]
}
}

Available types#

TypedescriptionExample as json
TEXT

Specify text value

Click to expandExample:
{
"type": {
"typeName": "TEXT",
"grades": [],
"multiple": false,
"possibleAnswers": []
}
}
NUMBER

Specify a numeric value
Additional optional fields:
minCountAnswer - the minimum number available to the user for a response
maxCountAnswer - the maximum number available to the user for a response

Click to expandExample:
[
{
"type": {
"typeName": "NUMBER",
"grades": [],
"minCountAnswer": 1,
"maxCountAnswer": 10,
"multiple": false,
"possibleAnswers": []
}
}
]
DATE

Date picker

Click to expandExample:
{
"type": {
"typeName": "DATE",
"grades": [],
"multiple": false,
"possibleAnswers": []
}
}
DATE_TIME

Date and time picker

Click to expandExample:
{
"type": {
"typeName": "DATE_TIME",
"grades": [],
"multiple": false,
"possibleAnswers": []
}
}
SELECT

Choose one of possible answers:
Additional required fields:
possibleAnswers - available answer options

If your template has grades (withGrades is true)
you cat set grade for possible answer

Click to expandExample:
[
{
"type": {
"typeName": "SELECT",
"grades": [],
"multiple": false,
"possibleAnswers": [
{
"id": "608133db7eb7af765469e6a7",
"value": "option 1",
"grade": 10
},
{
"id": "608133db7eb7af765469e6a8",
"value": "option 2",
"grade": 5
}
]
}
}
]
MULTI_SELECT

Choose many of possible answers:
Additional required fields:
possibleAnswers - available answer options

Additional optional fields:
minCountAnswer - the minimum number of answer that can be chosen
maxCountAnswer - the maximum number of answer that can be chosen

Click to expandExample:
[
{
"type": {
"typeName": "MULTI_SELECT",
"grades": [],
"multiple": false,
"minCountAnswer": 1,
"maxCountAnswer": 2,
"possibleAnswers": [
{
"id": "608133ff7eb7af765469e6aa",
"value": "option 1"
},
{
"id": "608133ff7eb7af765469e6ab",
"value": "option 2"
},
{
"id": "608133ff7eb7af765469e6ac",
"value": "option 3"
}
]
}
}
]
FILE

Answer is uploaded files
Additional optional fields:
minCountAnswer - the minimum number of files you need to attach
maxCountAnswer - maximum number of files that can be attached

Click to expandExample:
[
{
"type": {
"typeName": "FILE",
"grades": [],
"multiple": false,
"minCountAnswer": 1,
"maxCountAnswer": 2,
"possibleAnswers": []
}
}
]
REF

Answer is value from catalog
Additional required fields:
schemaId - id of catalog schema

Click to expandExample:
[
{
"type": {
"typeName": "REF",
"grades": [],
"multiple": true,
"schemaId": 1,
"possibleAnswers": []
}
}
]

Display conditions#

Hidden questions: It is possible to hide some of the questions in the template. They will be visible to the user when choosing a specific answer to a question of the SELECT type.

To create a hidden question: Add a conditions object to the new question with the question id (Select) and the answer option, which should display the "hidden" question

Example:
[
{
"conditions": [
{
"number": 0,
"questionId": "608133db7eb7af765469e6a6",
"hasAnswerValues": [
{
"id": "608133db7eb7af765469e6a7",
"value": "option 1"
}
]
}
]
}
]
Click to full example

In this example, the visibility of the second question depends on the answer to the first question. The second question will be displayed only if the user during the passage selects 'first answer to the question' in the first question

Example:
[
{
"id": "60816d307eb7af765469e6c0",
"templateId": "60816cf17eb7af765469e6bf",
"deleted": false,
"tenant": "",
"name": "Base question",
"type": {
"typeName": "SELECT",
"grades": [],
"multiple": false,
"possibleAnswers": [
{
"id": "60816d307eb7af765469e6c1",
"value": "first answer to the question"
},
{
"id": "60816d307eb7af765469e6c2",
"value": "second answer to the question"
}
]
},
"conditions": [],
"calculated": false,
"required": false,
"orderNum": 0,
"updateAt": "2021-04-22T12:33:51.224",
"needComment": false,
"commentRequired": false,
"enableCustomAnswer": false
},
{
"id": "60816d607eb7af765469e6c4",
"templateId": "60816cf17eb7af765469e6bf",
"deleted": false,
"tenant": "",
"name": "Question depends from Base question answer",
"type": {
"typeName": "NUMBER",
"grades": [],
"multiple": false,
"minCountAnswer": 0,
"maxCountAnswer": 10,
"possibleAnswers": []
},
"conditions": [
{
"number": 0,
"questionId": "60816d307eb7af765469e6c0",
"hasAnswerValues": [
{
"id": "60816d307eb7af765469e6c1",
"value": "first answer to the question\n"
}
]
}
],
"calculated": false,
"required": false,
"orderNum": 1,
"updateAt": "2021-04-22T12:34:39.299",
"needComment": false,
"commentRequired": false,
"enableCustomAnswer": false
}
]