Grouped Questions
Grouped Questions
A Grouped Question's response will depend on which API you are using:
Traversal API
A response with multiple nodes is refered to as "grouped questions". They are displayed on the screen at the same time; usually because they are relevant to each other. These could look something like this:
Figure 1: a group of two questions, displayed at the same time
{
"traversalId": "...",
"algoId": 4550,
"nodes": [
{
"nodeId": 532,
"assetId": 0,
"errors": [],
"displayText": null,
"title": null,
"explanation": null,
"data": null,
"questions": [
{
"nodeId": 532,
"questionId": 70,
"displayText": "What is your sex at birth?",
"title": null,
"answers": [
{
"nodeId": 532,
"questionId": 70,
"answerId": 88,
"controlType": "Radio",
"controlValue": null,
"controlChecked": false,
"displayText": "Male",
"explanation": "",
"data": {}
},
{
"nodeId": 532,
"questionId": 70,
"answerId": 89,
"controlType": "Radio",
"controlValue": null,
"controlChecked": false,
"displayText": "Female",
"explanation": "",
"data": {}
}
],
"explanation": "This refers to your sex at birth. Many problems relate specifically to genetically male and female organs.",
"data": {}
}
],
"isTable": false
},
{
"nodeId": 533,
"assetId": 0,
"errors": [],
"displayText": null,
"title": null,
"explanation": null,
"data": null,
"questions": [
{
"nodeId": 533,
"questionId": 19063,
"displayText": "How old are you?",
"title": null,
"answers": [
{
"nodeId": 533,
"questionId": 19063,
"answerId": 16309,
"controlType": "Number",
"controlValue": null,
"controlChecked": false,
"displayText": "years",
"explanation": "",
"data": {
"Properties": { "Align": "AnswerLeft", "NumericKeypad": "" }
}
}
],
"explanation": "",
"data": {}
}
],
"isTable": false
}
],
"assessmentType": 0,
"algoName": "Age & Gender",
"errors": [],
"previousDisabled": true,
"nextDisabled": false,
"language": "DEFAULT"
}
Chat Traversal API
The response for a grouped question on the Chat Traversal API will* only contain one question at a time. The next response will be the next question in the same group.
Step 1
For example, the first response for the above group (see Figure 1) will simply be the first question:
Figure 2a: first question of a group
{
"traversalId": "...",
"algoId": 4550,
"nodeId": 532,
"questions": [{
"algoId": 4550,
"nodeId": 532,
"questionId": 70,
"displayText": "What is your sex at birth?",
"title": null,
"answers": [{
"nodeId": 532,
"questionId": 70,
"answerId": 88,
"controlType": "Radio",
"controlValue": null,
"controlChecked": false,
"displayText": "Male",
"explanation": "",
"data": {}
}, {
"nodeId": 532,
"questionId": 70,
"answerId": 89,
"controlType": "Radio",
"controlValue": null,
"controlChecked": false,
"displayText": "Female",
"explanation": "",
"data": {}
}
],
"explanation": "This refers to your sex at birth. Many problems relate specifically to genetically male and female organs.",
"data": {}
}
],
"assessmentType": 0,
"errors": [],
"completed": false
}
Step 2
The second response, once the first has been answered, will be :
Figure 2b: second question of a group
{
"traversalId": "...",
"algoId": 4550,
"nodeId": 533,
"questions": [{
"algoId": 4550,
"nodeId": 533,
"questionId": 19063,
"displayText": "How old are you?",
"title": null,
"answers": [{
"nodeId": 533,
"questionId": 19063,
"answerId": 16309,
"controlType": "Number",
"controlValue": null,
"controlChecked": false,
"displayText": "years",
"explanation": "",
"data": {
"Properties": {
"Align": "AnswerLeft",
"NumericKeypad": ""
}
}
}
],
"explanation": "",
"data": {}
}
],
"assessmentType": 0,
"errors": [],
"completed": false
}
*Except in cases where footers (e.g. copyright, etc) and headers (e.g. titles) are present.