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

Overview
When an author changes a question's type in the QTI editor, their existing answers should carry over to the new type wherever that makes sense. If a change would drop content, the author should be warned in a modal and asked to confirm first. The old editor worked this way, and we should keep that behaviour so authors don't lose work silently.
Complexity: Medium
Target branch: unstable
Context
- QTI editor now: changing to a question type that uses a different interaction (e.g. single choice → numeric input) keeps only the prompt. Answers are dropped without any warning.
- Old editor, removed in d4b7026, converted the answers on a type change:
- To single choice: kept only one correct answer.
- To numeric input: kept only the numeric answers and marked them all correct.
- To true/false: replaced the answers with True/False.
- To free response: removed all answers.
- Old editor warning: when answers would change or be lost, it first opened a "Changing question type" confirmation dialog (e.g. "Switching to 'true or false' will remove all current answers. Continue?").
The Change
- Changing question type should keep as much of the author's content as the new type can hold: the prompt, answer text, and which answers are correct.
- If the change would drop or alter content (answers removed, correct answers reduced, non-numeric answers discarded), the editor should show a confirmation modal before switching. The modal says what will be lost, and the author can cancel.
- If nothing would be lost, the type should switch straight away with no modal.
- This covers all question types the QTI editor now offers, including the ones the old editor didn't have (text entry, ordering, matching).
Implementation details are still open. Which conversions to support, how each type maps to the others, and the modal wording will be decided before work starts.
How to Get There
- Open an exercise's Questions tab and edit a question.
- Add a few answers, marking one or more as correct.
- Change the question type from the type selector to one that uses a different interaction (e.g. single choice → numeric input).
Acceptance Criteria
General
Accessibility and i18n
Testing
References
- d4b7026, which removed the old editor; its parent commit has the old conversion logic and dialog strings
AI usage
I used Claude Code to find the old editor's type-change behaviour in git history, check what the QTI editor does today, and draft this issue. I reviewed and edited each section.
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
When an author changes a question's type in the QTI editor, their existing answers should carry over to the new type wherever that makes sense. If a change would drop content, the author should be warned in a modal and asked to confirm first. The old editor worked this way, and we should keep that behaviour so authors don't lose work silently.
Complexity: Medium
Target branch:
unstableContext
The Change
Implementation details are still open. Which conversions to support, how each type maps to the others, and the modal wording will be decided before work starts.
How to Get There
Acceptance Criteria
General
Accessibility and i18n
Testing
References
AI usage
I used Claude Code to find the old editor's type-change behaviour in git history, check what the QTI editor does today, and draft this issue. I reviewed and edited each section.