Repository navigation
Conversation
A `choices` list with `group` is a paper question: submission-registry registers it as a `radio` member and grades it from one `answer`. The renderer picked its control type from the authored `mode` instead, so a spec carrying `mode: 'multi'` rendered checkbox rows whose second pick could never be recorded (the shared answer holds one label), together with a "pick any that apply" hint and data-choice-mode="multi". Derive the presented mode from the same rule the registry uses: `group` forces single-select. Radio inputs, radiogroup role, single hint, the submitted `mode` and the data attribute now all agree; lists without a group keep their checkboxes and local multi-select. Tests: 2 new red->green cases (live paper context and export/panel context without block state) plus a regression guard for local multi-select.
This branch has not been deployed
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.
Problem
A
choiceslist withgroupis a paper question:src/client/submission-registry.ts:74-87registers it as aradiomember and grades it from oneanswer(theGenuiChoices.answertype isnumber | string). The renderer, however, picks its control type from the authoredmode(src/client/blocks/choices.tsx):So
mode: 'multi'+grouprenders checkbox rows whose second pick can never be recorded — the shared answer stores a single label — plus a "pick any that apply" hint anddata-choice-mode="multi".Repro (jsdom component test):
Fix
Derive the presented mode from the same rule the registry uses: a grouped list is single-select.
single = group !== undefined || mode === 'single'now drives the input type/name, the container role, the hint, the submittedmodeanddata-choice-mode. Lists without agroupkeep checkboxes and local multi-select unchanged.I did not make this a validation error: rejecting the spec sends the whole fence back to a code block, while the node degrades safely to the single-select it is actually graded as. Supporting multi-select paper questions would be a feature change to the registry/grading contract, not a fix. (The only observable DOM change is that
data-choice-modenow reflects the presented mode rather than the authored one; nothing in the repo consumes it.)Tests
tests/genui-choices.spec.tsx:mode: 'multi'rendersradio/radio,role="radiogroup", anddata-choice-mode="single"(red on base);answersprovider) — the rule keys ongroup, not on the live registry (red on base);groupstill renders checkboxes (regression guard).npx vitest run tests/genui-choices.spec.tsx-> 16 passed; full suite 2109 passed / 152 files;npx tsc -p tsconfig.json --noEmitclean.