-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent duplicate answer_ids across different list collectors (#228)
- Loading branch information
1 parent
8181a3d
commit b012742
Showing
9 changed files
with
668 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
198 changes: 198 additions & 0 deletions
198
.../schemas/invalid/test_invalid_list_collector_with_duplicate_answer_id_used_elsewhere.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
{ | ||
"mime_type": "application/json/ons/eq", | ||
"language": "en", | ||
"schema_version": "0.0.1", | ||
"data_version": "0.0.3", | ||
"survey_id": "0", | ||
"title": "Test ListCollector", | ||
"theme": "default", | ||
"description": "A questionnaire to test ListCollector", | ||
"metadata": [ | ||
{ | ||
"name": "user_id", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "period_id", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "ru_name", | ||
"type": "string" | ||
} | ||
], | ||
"questionnaire_flow": { | ||
"type": "Linear", | ||
"options": { | ||
"summary": { | ||
"collapsible": false | ||
} | ||
} | ||
}, | ||
"sections": [ | ||
{ | ||
"id": "section", | ||
"groups": [ | ||
{ | ||
"id": "group", | ||
"title": "List", | ||
"blocks": [ | ||
{ | ||
"type": "Question", | ||
"id": "name-block", | ||
"question": { | ||
"description": ["Testing"], | ||
"answers": [ | ||
{ | ||
"id": "name-answer", | ||
"label": "What is your name?", | ||
"max_length": 20, | ||
"mandatory": false, | ||
"type": "TextField" | ||
} | ||
], | ||
"id": "name-question", | ||
"title": "Title", | ||
"type": "General" | ||
} | ||
}, | ||
{ | ||
"id": "list-collector", | ||
"type": "ListCollector", | ||
"for_list": "people", | ||
"question": { | ||
"id": "confirmation-question", | ||
"type": "General", | ||
"title": "Does anyone else live here?", | ||
"answers": [ | ||
{ | ||
"id": "anyone-else", | ||
"mandatory": true, | ||
"type": "Radio", | ||
"options": [ | ||
{ | ||
"label": "Yes", | ||
"value": "Yes", | ||
"action": { | ||
"type": "RedirectToListAddBlock" | ||
} | ||
}, | ||
{ | ||
"label": "No", | ||
"value": "No" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"add_block": { | ||
"id": "add-person", | ||
"type": "ListAddQuestion", | ||
"question": { | ||
"id": "add-question", | ||
"type": "General", | ||
"title": "What is the name of the person?", | ||
"answers": [ | ||
{ | ||
"id": "name-answer", | ||
"label": "First name", | ||
"mandatory": true, | ||
"type": "TextField" | ||
}, | ||
{ | ||
"id": "last-name", | ||
"label": "Last name", | ||
"mandatory": true, | ||
"type": "TextField" | ||
} | ||
] | ||
} | ||
}, | ||
"edit_block": { | ||
"id": "edit-person", | ||
"type": "ListEditQuestion", | ||
"question": { | ||
"id": "edit-question", | ||
"type": "General", | ||
"title": "What is the name of the person?", | ||
"answers": [ | ||
{ | ||
"id": "name-answer", | ||
"label": "First name", | ||
"mandatory": true, | ||
"type": "TextField" | ||
}, | ||
{ | ||
"id": "last-name", | ||
"label": "Last name", | ||
"mandatory": true, | ||
"type": "TextField" | ||
} | ||
] | ||
} | ||
}, | ||
"remove_block": { | ||
"id": "remove-person", | ||
"type": "ListRemoveQuestion", | ||
"question": { | ||
"id": "remove-question", | ||
"type": "General", | ||
"title": "Are you sure you want to remove this person?", | ||
"answers": [ | ||
{ | ||
"id": "name-answer", | ||
"mandatory": true, | ||
"type": "Radio", | ||
"options": [ | ||
{ | ||
"label": "Yes", | ||
"value": "Yes", | ||
"action": { | ||
"type": "RemoveListItemAndAnswers" | ||
} | ||
}, | ||
{ | ||
"label": "No", | ||
"value": "No" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"summary": { | ||
"title": "Household members", | ||
"item_title": { | ||
"text": "{person_name}", | ||
"placeholders": [ | ||
{ | ||
"placeholder": "person_name", | ||
"transforms": [ | ||
{ | ||
"arguments": { | ||
"delimiter": " ", | ||
"list_to_concatenate": [ | ||
{ | ||
"source": "answers", | ||
"identifier": "name-answer" | ||
}, | ||
{ | ||
"source": "answers", | ||
"identifier": "name-answer" | ||
} | ||
] | ||
}, | ||
"transform": "concatenate_list" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.