Repository navigation
fix(lstsv): an optional select_multiple with a lower bound can be left empty (#217) - #244
Merged
Merged
Conversation
…t empty (#217) LimeSurvey enforces min_answers as `count(...) >= n` also on 0 ticks (em_manager_helper.php), while ODK skips the constraint on an empty answer. On a question that is not required the lower bound now goes into the guarded validation equation (`count(...) == 0 or (count(...) >= n)`) instead of min_answers; a bound of 1 or less only excludes the empty answer and is dropped. max_answers stays an attribute. A required question keeps min_answers. lstsv2xlsform drops the guard and reads the equation back as the same constraint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jstet
force-pushed
the
fix/min-answers-empty-217
branch
from
November 4, 2026 20:09
4b15133 to
e470f45
Compare
Merged
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.
Fixes #217.
LimeSurvey builds
min_answersas an unguardedcount(<subquestions>) >= n(em_manager_helper.php), so it also rejects an empty multiple choice, while ODK skips the constraint on an empty answer. #216 guarded the validation equation but not the lower bound moved tomin_answers(#186).On a question that is not
required, the lower bound of acount-selected(.)constraint now stays in the guarded validation equation instead ofmin_answers. A bound of 1 or less only excludes the empty answer, so it is dropped.max_answersstays an attribute (0 ticks satisfy it), and a required question keepsmin_answers.lstsv2xlsformdrops the guard again and reads the equation back as the samecount-selected(.)constraint (the term order may differ: upper bound first). TheselectionCount/emptyAnswerconvention rules and the README are updated.Before (optional,
count-selected(.) >= 2):After:
Tests
>=,>,=, with a max, with another term, bound of 1), required ones unchanged, round trip throughlstsv2xlsform. The property test now runs on a required question and its comment is corrected.npm run bless: no survey fixture snapshot changes (none has an optional select_multiple with a lower bound); only the generated conventions changed.npm test: 108 files and 1781 tests pass.npm run validateis clean.🤖 Generated with Claude Code