Summary
The Finish session → Redo Wrong flow can replace the active exercise while Exercise remains mounted. Its component-local answer and isCorrect signals may then retain the previous exercise's state.
Required changes
Ensure that selecting Redo Wrong cannot display or submit stale answer/result state for the next exercise. Either:
- reset the local exercise state whenever
props.exercise changes, or
- remount
Exercise using a stable exercise identity.
Rationale
The redo flow updates the exercise queue independently of handleNext(), which is currently the path that clears the local input and correctness state.
Affected area
src/components/solid/Exercise/Exercise.tsx
- Exercise session flow in
src/components/solid/Exercise/Exercises.tsx
Acceptance criteria
- After answering an exercise incorrectly, choosing Finish session → Redo Wrong clears the input and removes the previous correct/incorrect result before the next answer is checked.
- The next submission is evaluated against the newly active exercise.
- Existing normal next-exercise behavior remains unchanged.
Backlinks
Summary
The Finish session → Redo Wrong flow can replace the active exercise while
Exerciseremains mounted. Its component-localanswerandisCorrectsignals may then retain the previous exercise's state.Required changes
Ensure that selecting Redo Wrong cannot display or submit stale answer/result state for the next exercise. Either:
props.exercisechanges, orExerciseusing a stable exercise identity.Rationale
The redo flow updates the exercise queue independently of
handleNext(), which is currently the path that clears the local input and correctness state.Affected area
src/components/solid/Exercise/Exercise.tsxsrc/components/solid/Exercise/Exercises.tsxAcceptance criteria
Backlinks