Skip to content

Flag repeated Associate pairs and show chip-list errors once - #6361

Open
rtibblesbot wants to merge 2 commits into
learningequality:unstablefrom
rtibblesbot:issue-6316-d6caa1
Open

rtibblesbot wants to merge 2 commits into
learningequality:unstablefrom
rtibblesbot:issue-6316-d6caa1

Conversation

@rtibblesbot

@rtibblesbot rtibblesbot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Associate: repeated pairs, in either order, are flagged under each row.
  • Chip lists: each message shows once below the box; each flagged chip gets an error icon.
  • Duplicate-distractor message now reads "Distractors cannot match an existing item or distractor".

References

Fixes #6316. Decisions: #6316 (comment)

Reviewer guidance

Suggested review: Full code review, then manual QA once the reviewer sets Needs QA.

  • User-visible files changed: contentcuration/contentcuration/frontend/shared/views/QTIEditor/components/ClickableRegion/index.vue, contentcuration/contentcuration/frontend/shared/views/QTIEditor/components/EditableChipList/index.vue, contentcuration/contentcuration/frontend/shared/views/QTIEditor/constants.js, contentcuration/contentcuration/frontend/shared/views/QTIEditor/interactions/associate/Editor.vue, contentcuration/contentcuration/frontend/shared/views/QTIEditor/interactions/associate/validation.js….
  • Decide whether chip-list errors should be announced through the per-chip watch on KDS's assertive live region. A shared role="alert" message stays silent when a third chip gains a message that is already shown.
  • Confirm that saved Associate questions which already repeat a pair should turn incomplete when reopened, with no migration and no notice.
  • With a screen reader, check that a chip gaining a message is announced once and that a focused flagged chip reads the message. Also check that a Match row's prompt card stretching to the answers message looks like the approved POC.

New exercise in an editable channel > Questions tab > "New question".

  1. Flagged distractor chip
    • "Response type" "Associate". Pair 1 Kenya / Nairobi. Add distractor Kenya, click "Save". Chip gets red border and error icon; "Distractors cannot match an existing item or distractor" shows below the box.
    • Click the Kenya chip. Editor opens with no error icon.
    • Type Lima; "Save" does not move. Click "Save". Chip closes, message goes.
    • Click "Add distractor", type Peru, click the × next to the editor. No chip added.
  2. Repeated pairs
    • Add pair 2 Nairobi / Kenya. Both rows show "Pairs cannot repeat another pair"; question shows "Incomplete".
    • Reload. "Incomplete" stays.
    • Change pair 2 to Kenya / Lagos. Both rows clear.
  3. Other chip lists
    • "Match": add Mammal twice to one row. Message shows once, below that row.
    • "Gap match": add distractor Red twice. Message shows once.

Look out for:

  • Screen reader on a flagged chip: message read once per chip, or not read.
  • 480px width and Arabic: misplaced message or error icon in chip lists.

Open questions:

  • Chip-list messages are not role="alert"; a chip gaining an error is announced once via the KDS live region.
  • Saved Associate questions with repeated pairs become incomplete, with no migration or notice.
State Screenshot
Associate: repeated pair, repeated distractors Associate editor with a repeated pair and repeated distractors
Associate, RTL Associate editor in RTL
Match: repeated answers in a row, repeated distractors Match editor with repeated answers and distractors

axe (WCAG 2.2 AA): only color-contrast on the unchanged "Add pair/row/distractor" button text.

Evidence

Associate distractors: edit, save and discard a flagged chip

Step Screenshot
Before the fix: after Save, the edited chip reopens instead of closing Before the fix: after Save, the edited chip reopens instead of closing
Tokyo distractor flagged: red border, error icon, one message below the box Tokyo distractor flagged: red border, error icon, one message below the box
Flagged chip open: no error icon; message stays below the box, Save in place Flagged chip open: no error icon; message stays below the box, Save in place
After: new Tokyo draft saved as a flagged chip After: new Tokyo draft saved as a flagged chip
After add and remove: chips intact, one message After add and remove: chips intact, one message
associate-distractor-chip-save-discard-flow.webm
More captures (19)
Step Screenshot
Associate: repeated pair, same order Associate: repeated pair, same order
Associate: repeated pair, reversed Associate: repeated pair, reversed
Associate: item reused across different pairs stays valid Associate: item reused across different pairs stays valid
Associate: self-matched pair also repeated Associate: self-matched pair also repeated
Associate: two self-matched pairs Associate: two self-matched pairs
Associate distractors: duplicates flagged Associate distractors: duplicates flagged
Associate distractors: duplicates fixed Associate distractors: duplicates fixed
Associate distractors: keyboard, duplicate draft before Save Associate distractors: keyboard, duplicate draft before Save
Saved exercise: repeated pair and duplicate distractors Saved exercise: repeated pair and duplicate distractors
Saved exercise: fixed, after reload Saved exercise: fixed, after reload
Match: duplicate answers in a row flagged Match: duplicate answers in a row flagged
Match: duplicate answers flagged, narrow window Match: duplicate answers flagged, narrow window
Match: duplicate answers fixed Match: duplicate answers fixed
Match distractors: Bird and both Fish flagged Match distractors: Bird and both Fish flagged
Match distractors: cleared Match distractors: cleared
Gap match distractors: three flagged, one message Gap match distractors: three flagged, one message
Gap match distractors: flagged at 480px Gap match distractors: flagged at 480px
Gap match distractors: flagged in RTL Gap match distractors: flagged in RTL
Gap match distractors: cleared Gap match distractors: cleared

AI usage

Claude Code implemented the validation, EditableChipList changes and tests from the maintainer's decisions. Verified with the QTI editor Jest suite, pre-commit, screenshots and an axe audit.


Written by rtibblesbot, an LLM-based coding agent.

@rtibblesbot

🟡 Waiting for feedback

Last updated: 2026-10-30 22:30 UTC

rtibblesbot and others added 2 commits October 30, 2026 13:51
- A pair with the same two items as another, in either order, is now an error on both pairs
- Distractor message now reads "Distractors cannot match an existing item or distractor"

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- EditableChipList lists each distinct message once under the box instead of under every chip
- Flagged chips show an error icon and are described by their message via ClickableRegion's new ariaDescribedby

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rtibblesbot
rtibblesbot marked this pull request as ready for review October 30, 2026 22:30
@rtibblesbot
rtibblesbot requested review from a team and leq-bot October 30, 2026 22:30
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] - Validation issues for question of type 'Associate'

1 participant