Insert itemset declaration for range labels#836
Merged
lognaturel merged 1 commit intoXLSForm:masterfrom Apr 13, 2026
Merged
Conversation
2012dbf to
f812b73
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #835
Verified with Collect v2026.2.0 beta 1 using rangelabels.xlsx
Why is this the best possible solution? Were any other approaches considered?
In xls2json I ended up removing the
tick_labelsetparameter from the json representation and injecting an itemset usingadd_choices_info_to_question. That feels like a reasonable resulting json representation and a good way to reuse existing functionality.For the conversion to xform, I considered whether I should reuse functionality between
MultipleChoiceQuestionandRangeQuestion, maybe pulling out a mixin to represent having items. In the end I handled itemsets specifically for range because choices for selects are more complex. I think we may want to revisit this when we support reference geometry for geopoint/trace/shape which will also involve an itemset child.I introduced a
range_itemsettesting function. It just checks the itemset declaration and not the label and value children, that didn't feel necessary.What are the regression risks?
Limited to the
rangequestion type, probably really only around tick labels. Feels quite safe to me.Does this change require updates to documentation? If so, please file an issue here and include the link below.
No.
Before submitting this PR, please make sure you have:
testspython -m unittestand verified all tests passruff format pyxform testsandruff check pyxform teststo lint code