-
Notifications
You must be signed in to change notification settings - Fork 152
Choices have reference to the last parent in the event two or more questions use the same choices #749
Copy link
Copy link
Open
Description
The generated XML is as expected but if you traverse the Survey object and request a choice parent on the first occurrence, it will point to the last question. In the example below, the questions fruita and fruitz use the same choices. With the current implementation, fruita.children[0].parent == fruitz instead of fruita.
| survey |
| | type | name | label |
| | begin group | a | Group A |
| | select one fruits | fruita | Fruit A |
| | select one fruity | fruity | Fruit Y |
| | end group | | |
| | begin group | b | Group B |
| | select one fruits | fruitz | Fruit Z |
| | select_multiple fruity | fruitb | Fruit B |
| | end group | | |
| choices |
| | list name | name | label |
| | fruits | orange | Orange |
| | fruits | mango | Mango |
| | fruity | orange | Orange |
| | fruity | mango | Mango |
Note: when using choices as export headers, you may refer to the choice's parent's name to create a context-specific header, for example, fruita/orange, fruita/mango. We do this in some places in onadata hence the reason it became an issue for us.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels