learningequality / learningequality/studio
[RTE] Emit update:interaction only when the built interaction content changes
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— theprops.modewatcher 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.vueis the reference shape after #6113.
The Change
- Each editor should emit
update:interactiononly in edit mode, and only when the rebuiltbodyXml/responseDeclarationsdiffer 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:interactionon mount. - None of the three emit when
modechanges without a content change. - None of the three emit when a state change rebuilds identical
bodyXmlandresponseDeclarations. - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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