Skip to content

Tell QTI answers apart by their formulas and images - #6302

Open
rtibblesbot wants to merge 1 commit into
learningequality:unstablefrom
rtibblesbot:issue-6301-3fcad5
Open

rtibblesbot wants to merge 1 commit into
learningequality:unstablefrom
rtibblesbot:issue-6301-3fcad5

Conversation

@rtibblesbot

@rtibblesbot rtibblesbot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Answers are compared on text plus each formula and image in position, not text alone.
  • Match and associate no longer merge such answers on save.
  • Choice and ordering no longer flag them as duplicates.
  • Markup-only differences (e.g. bold) still count as duplicates.

References

Fixes #6301. Reported in: #6297 (review comment).

Reviewer guidance

Questions:

  • Is keying an image on src, alt, width, height and alignment the right rule, or should src alone decide?
  • Should x² solve and solve x² count as different answers, as they do now?

Manual QA — regression most likely in Match questions, where a save can merge answers.

Requires: an editable channel, a new exercise on its Questions tab, and two different images.

  1. Match answers that differ by formula
    • In a Match question, make the row answers x^2 is it and y^3 is it.
    • Close and open the exercise again.
    • Each row keeps its own formula. Response pool (shuffled) shows both answers.
  2. Match rows that share one answer
    • Give two rows the same answer is it x^2. Close and open the exercise again.
    • Both rows show "is it x²" under Correct matches.
  3. Choice options with formulas
    • Add a Single Choice question with options Solve x^2 for x and Solve y^3 for x. No error shows.
    • Change y^3 to x^2. Both options show "Duplicate answer options are not allowed".
    • Add options x^2 solve and solve x^2. No error shows. Is it correct that these are different answers?
  4. Choice options with images
    • Add a Multiple Choice question with three options "Shape": image A, image B, image A.
    • Options 1 and 3 show the duplicate error. Option 2 does not.

Look out for:

  • In Ordering and Associate questions, give items the same text with different formulas. Look out for a duplicate error, or a lost item after you open the exercise again.

Evidence

Single choice options with formulas

s1-duplicate-formula-toggle.webm

Multiple choice options with images

Step Screenshot
Same text, red image flagged; blue image option not flagged Same text, red image flagged; blue image option not flagged

Markup and formula position

Step Screenshot
Bold and plain "Mercury" flagged; "x² solve" and "solve x²" not flagged Bold and plain "Mercury" flagged; "x² solve" and "solve x²" not flagged

Ordering items with formulas

Step Screenshot
After reopen: "Value x²" and "Value y³" keep their order, no duplicate message After reopen: "Value x²" and "Value y³" keep their order, no duplicate message

Match answers that differ by formula

Step Screenshot
After reopen: Bat keeps "x² is it", Eagle keeps "y³ is it" After reopen: Bat keeps "x² is it", Eagle keeps "y³ is it"
Preview pool lists "y³ is it" and "x² is it" Preview pool lists "y³ is it" and "x² is it"

Match rows sharing one answer

Step Screenshot
Bat and Eagle both map to "is it x²" Bat and Eagle both map to "is it x²"
More captures (17)
Step Screenshot
Single choice: distinct formulas, no error Single choice: distinct formulas, no error
Single choice: identical formulas flagged Single choice: identical formulas flagged
Multiple choice reopened: flags unchanged Multiple choice reopened: flags unchanged
Ordering: shared text, different formulas and images, no error Ordering: shared text, different formulas and images, no error
Ordering: exact duplicate item flagged Ordering: exact duplicate item flagged
Match: editing formula answers Match: editing formula answers
Match reopened: both rows keep shared answer Match reopened: both rows keep shared answer
Associate: formula and image pairs, no duplicate error Associate: formula and image pairs, no duplicate error
Associate: same-image distractor flagged Associate: same-image distractor flagged
Associate: show answers highlights paired chips Associate: show answers highlights paired chips
Associate reopened: pairs persist Associate reopened: pairs persist
Saved choice question reopened: no duplicates Saved choice question reopened: no duplicates
Saved associate question reopened: no duplicates Saved associate question reopened: no duplicates
Saved match question reopened: no duplicates Saved match question reopened: no duplicates
Match pool after adding a formula Match pool after adding a formula
Match pool unchanged after whitespace edit Match pool unchanged after whitespace edit
Associate pool unchanged after whitespace edit Associate pool unchanged after whitespace edit

AI usage

Used Claude Code to write the fix and its tests from the issue. Verified with the QTIEditor and TipTapEditor Jest suites and pre-commit.


Written by rtibblesbot, an LLM-based coding agent.

@rtibblesbot

🟡 Waiting for feedback

Last updated: 2026-10-07 21:51 UTC

@rtibblesbot
rtibblesbot marked this pull request as ready for review October 7, 2026 21:23
@rtibblesbot
rtibblesbot requested review from a team and leq-bot October 7, 2026 21:23
Answers differing only in a formula or image no longer merge in match/associate or flag as duplicates.

Closes learningequality#6301

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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] Answers that differ only in a formula or image are treated as the same answer

1 participant