Skip to content

feat(lstsv)!: write allowprev=Y and showxquestions=N as survey settings by default (#240) - #242

Merged
jstet merged 1 commit into
mainfrom
feat/default-settings-240
Nov 4, 2026
Merged

jstet merged 1 commit into
mainfrom
feat/default-settings-240

Conversation

@jstet

@jstet jstet commented Nov 4, 2026

Copy link
Copy Markdown
Member

Closes #240.

Implements option 2 of #240. This is proposed, not decided: the maintainer decides at review whether default-on is wanted.

LimeSurvey's own defaults (allowprev=N, showxquestions=Y) are poor for surveys built from XLSForms: no Previous button, and a "This survey contains 74 questions" line that counts hidden and filtered questions. formtransform now writes allowprev=Y and showxquestions=N as S rows unless the form sets them with limesurvey_allowprev / limesurvey_showxquestions (#228).

  • The defaults live in the registry (convention:surveySettings defaults, next to shownoanswer=N); src/generated is regenerated by codegen.
  • A settings column wins, including allowprev=N / showxquestions=Y.
  • New option surveySettingDefaults (default true) and CLI flag --no-setting-defaults leave both out, so LimeSurvey's defaults apply. shownoanswer keeps its own switch (--show-no-answer).
  • The way back (limesurveySettingColumns) skips all three defaults, as it already did for shownoanswer=N, so forms without the columns round-trip unchanged.
  • DDI is unaffected: it is built from the settings sheet, not from the TSV.
  • README "LimeSurvey survey settings", the lstsv2xlsform README, the convention text and the skill syntax reference are updated.

Before / After S rows

Before:

class name text
S language de
S format A
S shownoanswer N

After:

class name text
S language de
S format A
S shownoanswer N
S allowprev Y
S showxquestions N

Behaviour change

Every TSV gains these two S rows, so existing forms behave differently once re-imported into LimeSurvey (Previous button on, question count off). Blessed snapshots (registry/entities, tests/fixtures/surveys) changed only by those two rows. To keep the old output, pass --no-setting-defaults or surveySettingDefaults: false, or set the columns in the form.

Tests

  • npm test: 1777 passed (108 files); new cases cover defaults present, override Y/N wins, defaults off via option and CLI flag, round trip leaving the defaults out, DDI free of the defaults.
  • npm run validate: passes.

🤖 Generated with Claude Code

…gs by default (#240)

Without limesurvey_allowprev / limesurvey_showxquestions columns, the TSV now
carries S allowprev=Y and S showxquestions=N next to shownoanswer=N. A column
overrides them; --no-setting-defaults (surveySettingDefaults: false) turns
them off. The way back skips all three defaults, so forms round-trip as
authored. DDI is unaffected. Snapshots re-blessed: only the two S rows added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jstet
jstet force-pushed the feat/default-settings-240 branch from 04a755c to 989cc33 Compare November 4, 2026 20:08
@jstet
jstet merged commit 3130849 into main Nov 4, 2026
@jstet jstet mentioned this pull request Nov 4, 2026
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: default allowprev=Y and showxquestions=N?

1 participant