learningequality / learningequality/studio

[RTE] Emit update:interaction only when the built interaction content changes

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

Nobody has claimed this yet.

Dominant language
Python
Stars
191
Forks
307
Avg merge
5d 6h
Merged PRs (30d)
10

Description

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

Overview

Three QTI interaction editors emit update:interaction when they mount or switch into edit mode, even though nothing has changed. AssociateInteractionEditor.vue was changed in #6113 to emit only on a real content change; the others still push a rebuilt interaction block at the parent just for being opened.

Complexity: Low
Target branch: unstable

Context
  • ChoiceInteractionEditor.vue:382{ immediate: true }, no mode gate: emits on mount in any mode.
  • OrderingInteractionEditor.vue:309 — the props.mode watcher emits on entering edit mode.
  • TextEntryEditor.vue:338-350{ immediate: true }; gated on edit mode, still emits on mount.
  • All three watch a computed that rebuilds a fresh object on every state change, so an edit producing identical XML still emits.
  • AssociateInteractionEditor.vue is the reference shape after #6113.
The Change
  • Each editor should emit update:interaction only in edit mode, and only when the rebuilt bodyXml / responseDeclarations differ by value from what it last emitted.
  • Opening an editor, switching mode, or retyping identical content should produce no emit.
Acceptance Criteria
  • Choice, ordering, and text entry editors do not emit update:interaction on mount.
  • None of the three emit when mode changes without a content change.
  • None of the three emit when a state change rebuilds identical bodyXml and responseDeclarations.
  • Each still emits after an edit that changes the built XML.
  • Specs asserting emit-on-mount are updated, and the no-emit cases are covered by new tests.

AI usage

Written by Claude Code while addressing review feedback on #6113. The reviewer asked for this emit behaviour on the associate editor; I grepped the other interaction editors for the same pattern, confirmed each line reference above by reading the code, and filed this rather than widening that PR.

Contributor guide

Open the contributing guide

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.

Research direction

Start with AssociateInteractionEditor.vue as the reference from #6113, then inspect ChoiceInteractionEditor.vue:382, OrderingInteractionEditor.vue:309, and TextEntryEditor.vue:338-350. Update the related specs so mount, mode changes, and identical rebuilt content do not emit, while changed XML still does; confirm the existing emit-on-mount expectations are revised.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.