-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PYXForm should fail if a choiceList has two or more choices sharing the same value. #23
Comments
At one point we did something like this in koboform but there were cases where people want to be able to have multiple labels represented as the same value, and now I think a rule like this would be restrictive. Would it help to pass back a warning if duplicate values are used? |
Yes, if there is any way to get a warning back, that would be great. I haven't been following how pyxform deals with external itemsets. If it wraps everything into a single zip, if the zip contained a warnings file, that would, I think, be helpful. Or if it produces multiple files, adding a warnings file for these sorts of things would be useful. |
This is coming back and leading to a number of reported issues when users accidentally make bad forms. I suggest we have a settings that protects the cases where duplicate choices are intended, and then we automatically reject forms with duplicate choice values.
I'm proposing that if this setting is not present, this form would get rejected. |
- Fix failing tests related to the change in /meta/instanceID binding More info: XLSForm/pyxform#94 - Fix failing test related to a change in the PyXform error raised when an invalid XML tag is found. More info: XLSForm/pyxform#22 - Fix failing tests related to the 'allow_duplicate_choice' setting not being present. More info: XLSForm/pyxform#23
- Duplicate choice values are no longer allowed in PyXForm. More info: XLSForm/pyxform#23 - Rename new_cascading_select.xls to duplicate_choice_form.xls
- Fix failing tests related to the change in /meta/instanceID binding More info: XLSForm/pyxform#94 - Fix failing test related to a change in the PyXform error raised when an invalid XML tag is found. More info: XLSForm/pyxform#22 - Fix failing tests related to the 'allow_duplicate_choice' setting not being present. More info: XLSForm/pyxform#23
- Duplicate choice values are no longer allowed in PyXForm. More info: XLSForm/pyxform#23 - Rename new_cascading_select.xls to duplicate_choice_form.xls
- Duplicate choice values are no longer allowed in PyXForm. More info: XLSForm/pyxform#23 - Rename new_cascading_select.xls to duplicate_choice_form.xls
- Fix failing tests related to the change in /meta/instanceID binding More info: XLSForm/pyxform#94 - Fix failing test related to a change in the PyXform error raised when an invalid XML tag is found. More info: XLSForm/pyxform#22 - Fix failing tests related to the 'allow_duplicate_choice' setting not being present. More info: XLSForm/pyxform#23
- Duplicate choice values are no longer allowed in PyXForm. More info: XLSForm/pyxform#23 - Rename new_cascading_select.xls to duplicate_choice_form.xls
- Duplicate choice values are no longer allowed in PyXForm. More info: XLSForm/pyxform#23 - Rename new_cascading_select.xls to duplicate_choice_form.xls
- Duplicate choice values are no longer allowed in PyXForm. More info: XLSForm/pyxform#23 - Rename new_cascading_select.xls to duplicate_choice_form.xls - Replace choice_filter.xls file with choice_filter.xlsx; Duplicate of choice_filter.xls with allow_duplicate_choices setting
- Duplicate choice values are no longer allowed in PyXForm. More info: XLSForm/pyxform#23 - Rename new_cascading_select.xls to duplicate_choice_form.xls - Replace choice_filter.xls file with choice_filter.xlsx; Duplicate of choice_filter.xls with allow_duplicate_choices setting
- Fix failing tests related to the change in /meta/instanceID binding More info: XLSForm/pyxform#94 - Fix failing test related to a change in the PyXform error raised when an invalid XML tag is found. More info: XLSForm/pyxform#22 - Fix failing tests related to the 'allow_duplicate_choice' setting not being present. More info: XLSForm/pyxform#23
- Duplicate choice values are no longer allowed in PyXForm. More info: XLSForm/pyxform#23 - Rename new_cascading_select.xls to duplicate_choice_form.xls - Replace choice_filter.xls file with choice_filter.xlsx; Duplicate of choice_filter.xls with allow_duplicate_choices setting
- Fix failing tests related to the change in /meta/instanceID binding More info: XLSForm/pyxform#94 - Fix failing test related to a change in the PyXform error raised when an invalid XML tag is found. More info: XLSForm/pyxform#22 - Fix failing tests related to the 'allow_duplicate_choice' setting not being present. More info: XLSForm/pyxform#23
- Duplicate choice values are no longer allowed in PyXForm. More info: XLSForm/pyxform#23 - Rename new_cascading_select.xls to duplicate_choice_form.xls - Replace choice_filter.xls file with choice_filter.xlsx; Duplicate of choice_filter.xls with allow_duplicate_choices setting
- Fix failing tests related to the change in /meta/instanceID binding More info: XLSForm/pyxform#94 - Fix failing test related to a change in the PyXform error raised when an invalid XML tag is found. More info: XLSForm/pyxform#22 - Fix failing tests related to the 'allow_duplicate_choice' setting not being present. More info: XLSForm/pyxform#23
- Duplicate choice values are no longer allowed in PyXForm. More info: XLSForm/pyxform#23 - Rename new_cascading_select.xls to duplicate_choice_form.xls - Replace choice_filter.xls file with choice_filter.xlsx; Duplicate of choice_filter.xls with allow_duplicate_choices setting
* Recognize select questions from the question elements themselves instead of checking the bind type; see XLSForm/pyxform#168 * Recognize new error message when a group name matches the form name See XLSForm/pyxform#510 * Set `allow_choice_duplicates` to `yes` in cascade test XLSForms See XLSForm/pyxform#23; XLSForm/pyxform#373 (comment) * Update tests to use `default_name` instead of relying on the XLSForm file name See XLSForm/pyxform#130 * Update expected XML in tests to match new pyxform behavior: * `<model>` becomes `<model odk:xforms-version="1.0.0">` * See XLSForm/pyxform#393 * The bind type for `select` and `select1` becomes `string` * See XLSForm/pyxform#168 * `calculate="concat('uuid:', uuid())"` becomes `jr:preload="uid"` * See XLSForm/pyxform#94 This squashed set of changes includes work from #699. Thanks to @duvld for that contribution.
* Recognize select questions from the question elements themselves instead of checking the bind type; see XLSForm/pyxform#168 * Recognize new error message when a group name matches the form name See XLSForm/pyxform#510 * Set `allow_choice_duplicates` to `yes` in cascade test XLSForms See XLSForm/pyxform#23; XLSForm/pyxform#373 (comment) * Update tests to use `default_name` instead of relying on the XLSForm file name See XLSForm/pyxform#130 * Update expected XML in tests to match new pyxform behavior: * `<model>` becomes `<model odk:xforms-version="1.0.0">` * See XLSForm/pyxform#393 * The bind type for `select` and `select1` becomes `string` * See XLSForm/pyxform#168 * `calculate="concat('uuid:', uuid())"` becomes `jr:preload="uid"` * See XLSForm/pyxform#94 This squashed set of changes includes work from #699. Thanks to @duvld for that contribution.
When processing the XLSX file, it would be helpful if the conversion failed if a user has entered two rows in the choices sheet for a given choice list that have the same value.
The use case is someone copy-and-pasting a series of answers:
listA val1 Yes
listA val2 No
listA val2 Maybe
and not noticing that val2 is repeated twice (Maybe should be val3).
If we want to support the current mechanism where this is allowed, we should probably have
a settings tab flag that allows for duplicated choice values.
The text was updated successfully, but these errors were encountered: