Skip to content

Warn when a choice question has only one option - #6310

Open
AlexVelezLl wants to merge 2 commits into
learningequality:unstablefrom
AlexVelezLl:issue-6167-single-choice-warning
Open

AlexVelezLl wants to merge 2 commits into
learningequality:unstablefrom
AlexVelezLl:issue-6167-single-choice-warning

Conversation

@AlexVelezLl

@AlexVelezLl AlexVelezLl commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Single choice and multiple select questions with only one option now show a warning, since this is often an authoring mistake, while still being valid because one-option questions have legitimate uses (e.g. "check to confirm…")
  • The warning only shows when the question has no validation errors, so it doesn't pile on top of required-field messages
image

References

Closes #6167

Reviewer guidance

  • In an exercise, create a Single choice question with a prompt and one option marked correct → the warning shows above the answers and the question isn't marked incomplete
  • Leave the prompt empty or the option blank → only the errors show, not the warning
  • Add a second option → the warning goes away
  • Repeat with Multiple select

AI usage

I used Claude Code to implement the warning and tests from the decision in the issue thread, survey existing warning styles across Studio/Kolibri/KDS, and pick the callout style. I reviewed the changes, asked for the warning to be hidden while errors are shown, and had the tests reworked so each one fails when its condition is removed.

🤖 Generated with Claude Code

@AlexVelezLl
AlexVelezLl marked this pull request as ready for review October 9, 2026 13:07
@AlexVelezLl
AlexVelezLl requested review from a team, leq-bot and rtibblesbot and removed request for leq-bot October 9, 2026 13:07
@rtibblesbot

rtibblesbot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Waiting for changes

Last updated: 2026-10-09 19:23 UTC

@rtibblesbot rtibblesbot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #6310 matches the issue's decision: one-option single choice and multiple select warn rather than block. Ordering is unchanged.

CI passes. Manual QA passed for single choice, multiple select, add/delete transitions, warning vs. error stacking, type switching, view mode, every editor's error rendering, and RTL/narrow widths. No new axe violations.

  • blocking: --palette-gray-v800 is undefined (inline).
  • suggestion: warning icon contrast (inline).
  • suggestion: live region announcement (inline).
  • suggestion: test assertions match on text alone (inline).

Written by rtibblesbot, an LLM-based coding agent.

@rtibblesbot rtibblesbot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #6310: manual QA found one new blocking issue. Icon contrast is still open. The other 3 prior findings are resolved.

CI passes. Axe found no new violations.

  • blocking: the warning isn't announced when it replaces an error (inline).
  • suggestion: the drag-sort order announcement overwrites the warning (inline).
  • suggestion: icon contrast is still under 3:1 (inline).
Prior-finding status

RESOLVED — ValidationMessage/index.vue:77 — --palette-gray-v800 doesn't exist
UNADDRESSED — ValidationMessage/index.vue:11 — warning icon contrast below 3:1
RESOLVED — ValidationMessage/index.vue:41 — screen readers may not announce the warning
RESOLVED — choice/tests/Editor.spec.js:488 — assertions would pass if rendered as an error


Written by rtibblesbot, an LLM-based coding agent.

@rtibblesbot rtibblesbot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #6310: the single choice warning is still overwritten when an option is deleted down to one (blocking, see inline). The other 5 prior findings are resolved or acknowledged.

CI pending. Manual QA: the warning renders correctly in every scenario. It is announced on toggling the correct answer and on opening a saved item.

Prior-finding status

RESOLVED — ValidationMessage/index.vue — --palette-gray-v800 doesn't exist
ACKNOWLEDGED — ValidationMessage/index.vue:11 — warning icon contrast under 3:1
RESOLVED — ValidationMessage/index.vue — screen readers may not announce this warning
RESOLVED — Editor.spec.js:490 — assertions would pass if rendered as an error
RESOLVED — ValidationMessage/index.vue — warning never announced when the last error is cleared
UNADDRESSED — ValidationMessage/index.vue:46 — warning lost when an option is deleted


Written by rtibblesbot, an LLM-based coding agent.

AlexVelezLl and others added 2 commits October 9, 2026 12:49
Removing a row whose control has focus (e.g. deleting it) only drops
focus; it isn't the user leaving the list. Announcing the order then
overwrites whatever the removal itself announced in the same polite
live region.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Single choice and multiple select questions with one option stay valid
(e.g. "check to confirm…"), but now show a warning since this is often
an authoring mistake. The warning only shows when there are no
validation errors, and is announced through the KDS live region.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@AlexVelezLl
AlexVelezLl force-pushed the issue-6167-single-choice-warning branch from 07765e1 to b99b1ab Compare October 9, 2026 17:49

@rtibblesbot rtibblesbot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #6310: no new findings. All 8 prior findings are resolved or acknowledged. CI passes. Manual QA passed.

Prior-finding status

RESOLVED — ValidationMessage/index.vue — --palette-gray-v800 doesn't exist
ACKNOWLEDGED — ValidationMessage/index.vue — warning icon contrast ~1.4:1
RESOLVED — ValidationMessage/index.vue — screen readers may not announce the warning
RESOLVED — choice/tests/Editor.spec.js:501 — assertions would pass if rendered as an error
RESOLVED — ValidationMessage/index.vue — warning not announced when "Choose a correct answer" is the last error cleared
RESOLVED — ValidationMessage/index.vue:43 — warning lost when an option is deleted with its Delete button
ACKNOWLEDGED — ValidationMessage/index.vue:11 — warning icon contrast still under 3:1 (maintainer accepted trade-off)
RESOLVED — ValidationMessage/index.vue — drag-sort order announcement overwrites the warning on delete


Written by rtibblesbot, an LLM-based coding agent.

@AlexVelezLl
AlexVelezLl requested a review from rtibbles October 9, 2026 19:42
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.

[QTI] - Inconsistent validation for the number of answer options

2 participants