Repository navigation
Store what the learner answered in wrong exercise attempts - #898
Merged
Merged
Conversation
The outcome code ("WWC") says an attempt was wrong, not what was answered.
exercise_wrong_answer keeps the typed text (or the option picked), one row
per wrong attempt, so a word the learner keeps confusing with another
meaning can be told apart from one they just forget.
/report_exercise_outcome takes an optional wrong_answers JSON list; older
clients send none and nothing changes for them. A malformed list is dropped
rather than refused, so the outcome is never lost.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
ArchLens - No architecturally relevant changes to the existing views |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The outcome code (
WWC) says an attempt was wrong, not what was answered. To tell a word the learner keeps confusing with another meaning (har det dårligt answered as "feel sad") from one they just forget, we need the answers.exercise_wrong_answer(exercise_id,attempt_i,answer), one row per wrong attempt.ON DELETE CASCADEfromexercise, so account deletion and merge need no change (merge repointsexercise.user_word_id; the rows follow their exercise)./report_exercise_outcometakes an optionalwrong_answersform field: a JSON list of strings, the typed text or the option picked. Old clients send none. A malformed value is dropped, never refused, so the outcome is not lost. Blank answers skipped, max 20 per exercise, cut at 255 chars.Migration:
tools/migrations/26-10-23--add_exercise_wrong_answer.sql(new table, no rebuild). Deploy order: migration → API → web (web PR to follow).Not run on a local MySQL (no docker on this machine); the sqlite tests do not enforce FKs, so the cascade itself is untested.
🤖 Generated with Claude Code