Repository navigation
List a shared answer once in the Match and Associate response pools - #6330
Conversation
| ...state.value.distractors.map(choice => ({ content: choice.content, isCorrect: false })), | ||
| ]); | ||
| // Kolibri's pool shows each choice of the response match set once. | ||
| const poolChoices = computed(() => { |
There was a problem hiding this comment.
Same here: let's give buildMatchInteractionXML and this pool one helper in match/parse.js for the answers fold, so the pool keeps listing what the response match set holds.
There was a problem hiding this comment.
Done in 2ce52b1ad: resolveMatchAnswers(rows, claim) in match/parse.js returns the folded answers and each row's resolved answer ids; the build passes its shared id claimer, poolChoices uses the default one.
There was a problem hiding this comment.
Do we really need this module at all? Could we just embed the hasRichTextContent logic into richTextComparisonKey and have richTextComparisonKey return an empty string if it does not have rich text content? With this, I think we could also just move hasRichTextContent to the tiptap module, along with the toText method. Given that we should not move the QTISanitizer to the TipTapModule, I think the only method we actually use from QTISanitizer, the stripTags method, could be just another utility function in the TipTapEditor's comparisonKey.js module, and get rid of the QTISanitizer class.
This way, the code is more readable, as "choiceKey" is not as readable as "richTextComparisonKey" when used in the interaction modules.
There was a problem hiding this comment.
Done in 45e1d7bb4:
hasRichTextContent,toTextandstripTagsmoved toTipTapEditor/utils/comparisonKey.js;richTextComparisonKeyreturns''when there is no content.utils/richText.js,QTISanitizerand its spec deleted; nothing else used the class. Its spec's script/style cases moved tohasRichTextContent.spec.js.choiceKeycall sites (4) now callrichTextComparisonKey.- Searched for the same pairing,
hasRichTextContentandrichTextComparisonKeyon one choice: thereadhelpers in associate, match and gapMatchvalidation.jsmatched (3); they now derivefilledfrom the key. Choice and ordering validation skip blanks before keying, so I left them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4238bc4 to
2a3f6e9
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AlexVelezLl
left a comment
There was a problem hiding this comment.
Code changes look good. Manual QA checks out! LGTM!
|
Quick check on rtibblesbot's work on this PR: react 👍 helpful · 😕 mixed · 👎 not helpful. Reply with anything specific. |
Summary
richTextComparisonKeyreturns''for blank content and hostshasRichTextContent;utils/richText.jsandQTISanitizerare gone.References
Fixes #6324. First seen: #6168.
Reviewer guidance
Suggested review: Light-touch code review, then manual QA.
contentcuration/contentcuration/frontend/shared/views/QTIEditor/components/EditableChipList/index.vue,contentcuration/contentcuration/frontend/shared/views/QTIEditor/composables/useInlineChoiceInteraction.js,contentcuration/contentcuration/frontend/shared/views/QTIEditor/interactions/associate/Editor.vue,contentcuration/contentcuration/frontend/shared/views/QTIEditor/interactions/associate/parse.js,contentcuration/contentcuration/frontend/shared/views/QTIEditor/interactions/associate/validation.js….Manual QA. QA team: Match and Associate response pools now list a shared answer once. Blank errors changed in all question types.
Use a new exercise. Tick Show answers.
x^2. Give "Row C" an image and "Row D" only spaces. Add the distractorx^2. Row D shows "Answer cannot be blank". The distractor shows "Distractors cannot repeat another item". The pool showsx^2once, green.x^2and a third an image. Add that image as a distractor. In a fourth pair, type only spaces in one item. The distractor shows the repeat error. The pool showsx^2once and two blank chips.Look out for:
QA cannot open Gap Match questions in the editor yet.
Evidence
Match: shared formula, image and space-only answers
x^2repeat error; formula and image rows passx^2once in green, image green, blank chip, distractor not greenx^2, image, "Four" green; "Wrong" notAssociate: reused formula, blank pair, image distractor
x^2onces2-associate-reopen.webm
Multiple Choice, Ordering, Text entry and hints
More captures (32)
Earlier round — Asia → Europe folds back to one chip:
s2-05-refold-asia-to-europe.webm
AI usage
Claude Code planned and implemented the fold and tests; verified with the QTIEditor Jest suite and pre-commit.
Written by rtibblesbot, an LLM-based coding agent.
🟢 Updating PR
Last updated: 2026-10-26 22:02 UTC