oppia-android
oppia-android copied to clipboard
Fix #1468: Retain Drag and Drop state after an incorrect answer
Explanation
Fix #1468
This PR includes
- Utilized
explorationProgressController
to retrieve the 'wrongAnswerList' from ephemeralState's pendingState and use it to populate theDragDropInteractionContentViewModel
list. - When
wrongAnswerList
is available, corresponding content IDs and HTML values are applied. If not, the originalcontentIdHtmlMap
andSubtitledHtml
values are used as a fallback. - The
choiceItems
are set up as LiveData to ensure the UI can react to changes. - The
_choiceItems
are copied to_originalChoiceItems
for detecting arrangement box errors during submission when the answer has not changed. - Retains linked-merged / unlinked states based on the
wrongAnswerList
data
For UI-specific PRs only
Re-order Retain State
https://github.com/user-attachments/assets/38a6377b-a0f6-4415-98b5-0e0ad512167e
Group / Unlink Retain
https://github.com/user-attachments/assets/37a0a11c-866d-42e3-9d3a-76ba64d3769b
Espresso Tests
Essential Checklist
- [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
- [x] Any changes to scripts/assets files have their rationale included in the PR explanation.
- [x] The PR follows the style guide.
- [x] The PR does not contain any unnecessary code changes from Android Studio (reference).
- [x] The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
- [x] The PR is assigned to the appropriate reviewers (reference).