feat(ddi): every group a varGrp, variables in survey order (#152) - #157
Merged
Merged
Conversation
- A plain group is a `<varGrp type="section">` (the XSD's own type; `other` stays the semi-open pair's). It lists its direct `<var>`s in @var and its direct child groups (sections, grids, a select_multiple's multipleResp, an other pair's varGrp) in @vargrp. Label in `txt` per xml:lang and `concept`. A group with no variable under it has none. - A group's own `relevant` is its `universe` and `cdl:relevant` note (grids too). A variable's note now carries only its own condition; its universe still states its groups' conditions as well. - `<var>`s, and the data CSV columns with them, follow the survey instead of being bucketed by role. Variables carry their group chain (`Variable.groups`). lstsv2ddi turns every LimeSurvey group into a section, including the "Questions" group xlsform2lstsv wraps top-level questions in; the round-trip test ignores that one. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…owed (#152) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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 #152. Part 2 of #155.
What changes
<varGrp>.type="section", as agreed with qwacback;type="other"stays reserved for the semi-open pair.<var>s in@varand its direct child groups in@varGrp. Child groups are sections, grids, a select_multiple'smultipleResp, and an other pair'svarGrp.txt(one perxml:lang) and inconcept.@IDisVG_<path>and@nameis the group path, as grids already did.varGrp.relevantis now the section's (or grid's)<universe>plus acdl:relevantnote.cdl:relevantnote carries only its element's own condition. That's what the way back (DDI round trips: DDI → Instrument parser, ddi2xlsform, and a round-trip contract #154) needs.<universe>still states its groups' conditions too, so a reader sees who was asked.<var>s follow the survey instead of being bucketed as grids, then multi-selects, then pairs, then the rest. The data CSV columns (getDdiColumnNames) follow the same order, so header =<var>order still holds.Behaviour to be aware of
<var>order.sectiontoday (qwacback#37).lstsv2ddiRoundtrip.test.tsignores that one wrapper.Still open (#153)
postQTxthint move.Checks
tests/ts/unit/ddi/structure.test.ts, covering nesting, grids inside sections, empty groups, languages, and var and column order.KNOWN_INVALIDfixtures fail with the same errors as before.varGrp/@typelist now includessection, taken from the registry (type:begin_group).npm run validateand the drift check are clean.🤖 Generated with Claude Code