Skip to content

feat(lstsv): fixed choices keep their position in a randomized list (#237) - #238

Merged
jstet merged 1 commit into
mainfrom
feat/fixed-choices-237
Nov 4, 2026
Merged

jstet merged 1 commit into
mainfrom
feat/fixed-choices-237

Conversation

@jstet

@jstet jstet commented Nov 4, 2026

Copy link
Copy Markdown
Member

Closes #237.

With parameters: randomize=true, LimeSurvey output pinned only exclusive options through keep_codes_order, so a non-exclusive "Sonstiges" was shuffled into the middle. An optional choices column fixed (yes, true or 1) now marks options that keep their position. Their codes go into keep_codes_order in list order, next to the exclusive ones (once each), on a select_multiple (subquestion_order) and a select_one (answer_order), including a select_one whose choice_filter is selected(${q}, name) on the same list.

  • fixed without randomize=true has no effect and no warning.
  • Reverse (lstsv2xlsform, and lstsv2ddi via the instrument): a keep_codes_order code that is not in exclude_all_others reads back as fixed=yes.
  • DDI: fixed is an ordinary non-lifted choice column, carried as cdl:choice_column (no new DDI field).
  • ODK/Kobo: pyxform ignores the extra column; the randomize-pinned warning now says "exclusive or fixed answer(s)".
  • Registered in convention:randomOrder (fixedColumn, fixedTrueValues); README, the lstsv2xlsform README and the generated skill syntax reference are updated.

Before (choices m_c3: abwes, sonst with fixed=yes, keine with exclusive=yes):

keep_codes_order = keine

After:

keep_codes_order = sonst;keine

Tests

  • Unit (randomOrder.test.ts, 8 new): select_multiple and select_one codes and order, dedupe with exclusive, filtered select_one on the same list, no effect without randomize, value spellings, round trip to fixed=yes, lstsv2ddi choice column.
  • pyxform oracle: a randomized form with a fixed column converts (1 new).
  • npm test: 108 files and 1773 tests pass. npm run validate is clean.

🤖 Generated with Claude Code

…237)

A choices column `fixed` (yes) adds a choice's code to keep_codes_order
next to the exclusive ones, on a select_one (answer_order) and a
select_multiple (subquestion_order). The reverse paths read a
keep_codes_order code that is not exclusive back as fixed=yes; DDI carries
it as a choice column. The randomize-pinned warning names fixed options too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jstet
jstet merged commit 0304b3d into main Nov 4, 2026
4 checks passed
@jstet
jstet deleted the feat/fixed-choices-237 branch November 4, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xlsform2lstsv: randomize=true can't keep "Sonstiges" at the end (only exclusive options are pinned)

1 participant