[QTI] A gap match question with min-associations reports no validation errors

Open
#6,467 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
18/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
frontend

Research direction

Start in contentcuration/contentcuration/frontend/shared/views/QTIEditor/validateItem.js around the isSupportedItem gate (lines ~156-159) and read interactions/gapMatch/Descriptor.js to see why min-associations is unsupported. Reproduce both cases with a Jest probe on unstable, then decide where rule validation should run for readable-but-unsupported items, keeping qti-gap-img and match-group reporting only unreadable interactions. Done means validateQtiItem returns EMPTY_ANSWER_CONTENT with min-associations="1" and isEditableItem is false. Note the issue header says it is not open for contribution and the fix is planned to land with #6309.

Written by the indexing model from the issue text.

Description

bug

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Target branch: unstable

Observed behavior

  • validateQtiItem returns [] for a gap match question that carries min-associations and has a gap with no answer. Without the attribute, the same question reports EMPTY_ANSWER_CONTENT.
  • isSupportedBody returns false for min-associations (gapMatch/Descriptor.js#L21-L27), so isSupportedItem is false and validateQtiItem reports only unreadable interactions (validateItem.js#L156-L159).
  • The editor reads this question in full: min-associations makes it read-only because the builder can't keep the count true, not because the body is unreadable.

Expected behavior

  • The question opens read-only and still reports the editor's rule errors, as a question with <qti-modal-feedback> does.

User-facing consequences

  • The exercise's completeness check reads the same result (shared/utils/validation.js#L466), so an imported gap match question with an unanswered gap counts as complete.

Steps to reproduce

  1. Call validateQtiItem on the item below: it returns [{ code: 'EMPTY_ANSWER_CONTENT', id: 'g' }].
    <qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" identifier="i" title="t" adaptive="false" time-dependent="false">
      <qti-response-declaration identifier="RESPONSE" cardinality="multiple" base-type="directedPair"/>
      <qti-item-body>
        <qti-gap-match-interaction response-identifier="RESPONSE" shuffle="true" max-associations="1">
          <qti-gap-text identifier="a" match-max="1">A</qti-gap-text>
          <p>x <qti-gap identifier="g"/></p>
        </qti-gap-match-interaction>
      </qti-item-body>
    </qti-assessment-item>
    
  2. Add min-associations="1" to <qti-gap-match-interaction> and call it again: it returns [].

Context

  • unstable at 2713cbf330, under Jest.
  • A site closed #6289's fix missed: an unsupported item skips its rule validation and counts as complete.
  • #6309 adds keepsItemContent read-only checks for min-associations on match and associate; this gate moves there.

Acceptance Criteria

  • validateQtiItem reports EMPTY_ANSWER_CONTENT for the item above with min-associations="1".
  • isEditableItem is false for that item.
  • A gap match question with <qti-gap-img> or match-group still reports only unreadable interactions.

AI usage

Claude Code found this while checking the plan for #6309, reproduced both results with a Jest probe on unstable, and drafted this issue.

Dominant language
JavaScript
Stars
214
Forks
327
Avg merge
17h 5m
Merged PRs (30d)
25

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from learningequality/studio

All issues in learningequality/studio

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.