diff --git a/frontend/src/dialogues/socialnetwork/VocabPracticeDialog.vue b/frontend/src/dialogues/socialnetwork/VocabPracticeDialog.vue index 0ff426c..a596073 100644 --- a/frontend/src/dialogues/socialnetwork/VocabPracticeDialog.vue +++ b/frontend/src/dialogues/socialnetwork/VocabPracticeDialog.vue @@ -178,6 +178,7 @@ export default { // current question current: null, // { id, learning, reference } direction: 'L2R', // L2R: learning->reference, R2L: reference->learning + pendingRetry: null, // { id, direction } for immediate retry after wrong answers acceptableAnswers: [], submittedAnswer: '', lastWrongReview: null, @@ -378,6 +379,7 @@ export default { this.perId = {}; this.lastIds = []; this.lastWrongReview = null; + this.pendingRetry = null; this.pool = []; this.locked = false; this.resetQuestion(); @@ -659,6 +661,13 @@ export default { if (!nextId) return null; return items.find((it) => it.id === nextId) || null; } + if (this.pendingRetry?.id) { + const retryItem = items.find((it) => it.id === this.pendingRetry.id); + if (retryItem) { + return retryItem; + } + this.pendingRetry = null; + } const recent = new Set(this.lastIds); const underexposed = items .map((item) => { @@ -749,6 +758,7 @@ export default { if (isCorrect) { this.correctCount += 1; this.lastWrongReview = null; + this.pendingRetry = null; } else { this.wrongCount += 1; const answers = this.visibleCorrectAnswers.length > 0 @@ -759,6 +769,12 @@ export default { submittedAnswer: this.submittedAnswer, answers }; + if (!this.srsMode && this.current?.id) { + this.pendingRetry = { + id: this.current.id, + direction: this.direction + }; + } } if (!this.srsMode) { this.reportSrsReview(isCorrect); @@ -836,6 +852,7 @@ export default { } }, skip() { + this.pendingRetry = null; this.next(); }, next() { @@ -851,7 +868,11 @@ export default { this.resetQuestion(); return; } + const retryDirection = this.pendingRetry?.direction || null; this.resetQuestion(); + if (retryDirection) { + this.direction = retryDirection; + } this.current = this.pickNextItem(); if (!this.current) return; const prompt = this.currentPrompt;