feat(VocabPracticeDialog, localization): implement last wrong answer review feature
All checks were successful
Deploy to production / deploy (push) Successful in 1m49s

- Added a new section in VocabPracticeDialog to display the last incorrect answer, including the asked vocabulary, user answer, and correct solutions.
- Updated localization strings in Cebuano, German, English, Spanish, and French to support the new review feature, enhancing user experience across multiple languages.
- Improved UI layout for the review section to provide clearer feedback during vocabulary training sessions.
This commit is contained in:
Torsten Schulz (local)
2026-04-20 09:52:26 +02:00
parent 5f13583e41
commit 1500f01875
6 changed files with 60 additions and 13 deletions

View File

@@ -45,17 +45,6 @@
</div>
</div>
<div v-if="answered && !lastCorrect" class="solution-card">
<div v-if="submittedAnswer" class="submitted-answer">
<span>{{ $t('socialnetwork.vocab.practice.yourAnswer') }}</span>
<strong>{{ submittedAnswer }}</strong>
</div>
<div class="answersTitle">{{ $t('socialnetwork.vocab.practice.correctSolutions') }}</div>
<ul>
<li v-for="a in visibleCorrectAnswers" :key="a">{{ a }}</li>
</ul>
</div>
<div v-if="showSrsRatingButtons" class="srs-rating">
<div class="srs-rating__title">{{ $t('socialnetwork.vocab.practice.srsRateTitle') }}</div>
<button
@@ -106,6 +95,22 @@
{{ $t('socialnetwork.vocab.practice.skip') }}
</button>
</div>
<div v-if="lastWrongReview" class="solution-card solution-card--persistent">
<div class="answersTitle">{{ $t('socialnetwork.vocab.practice.wrongReviewTitle') }}</div>
<div class="solution-row">
<span>{{ $t('socialnetwork.vocab.practice.askedVocab') }}</span>
<strong>{{ lastWrongReview.prompt }}</strong>
</div>
<div v-if="lastWrongReview.submittedAnswer" class="solution-row">
<span>{{ $t('socialnetwork.vocab.practice.yourAnswer') }}</span>
<strong>{{ lastWrongReview.submittedAnswer }}</strong>
</div>
<div class="answersTitle">{{ $t('socialnetwork.vocab.practice.correctSolutions') }}</div>
<ul>
<li v-for="a in lastWrongReview.answers" :key="a">{{ a }}</li>
</ul>
</div>
</div>
</div>
@@ -175,6 +180,7 @@ export default {
direction: 'L2R', // L2R: learning->reference, R2L: reference->learning
acceptableAnswers: [],
submittedAnswer: '',
lastWrongReview: null,
choiceOptions: [],
typedAnswer: '',
answered: false,
@@ -371,6 +377,7 @@ export default {
this.wrongCount = 0;
this.perId = {};
this.lastIds = [];
this.lastWrongReview = null;
this.pool = [];
this.locked = false;
this.resetQuestion();
@@ -739,8 +746,20 @@ export default {
markResult(isCorrect) {
this.answered = true;
this.lastCorrect = isCorrect;
if (isCorrect) this.correctCount += 1;
else this.wrongCount += 1;
if (isCorrect) {
this.correctCount += 1;
this.lastWrongReview = null;
} else {
this.wrongCount += 1;
const answers = this.visibleCorrectAnswers.length > 0
? [...this.visibleCorrectAnswers]
: (this.acceptableAnswers || []).filter(Boolean);
this.lastWrongReview = {
prompt: this.currentPrompt,
submittedAnswer: this.submittedAnswer,
answers
};
}
if (!this.srsMode) {
this.reportSrsReview(isCorrect);
}
@@ -977,10 +996,22 @@ export default {
border: 1px solid #d33;
background: #fff8f8;
}
.solution-card--persistent {
margin-top: 12px;
}
.solution-card ul {
margin: 6px 0 0;
padding-left: 20px;
}
.solution-row {
display: grid;
gap: 3px;
margin: 8px 0;
color: #5f554e;
}
.solution-row strong {
color: #2b2520;
}
.submitted-answer {
display: grid;
gap: 3px;

View File

@@ -796,6 +796,10 @@
"correct": "Tama!",
"wrong": "Sayop.",
"acceptable": "Acceptable answers:",
"correctSolutions": "Tama answer:",
"yourAnswer": "Imong answer:",
"wrongReviewTitle": "Previous wrong answer",
"askedVocab": "Gipangutana:",
"stats": "Stats",
"dueToday": "Due karon",
"done": "Nahuman",

View File

@@ -453,6 +453,8 @@
"acceptable": "Mögliche richtige Übersetzungen:",
"correctSolutions": "Richtige Antwort:",
"yourAnswer": "Deine Antwort:",
"wrongReviewTitle": "Vorherige falsche Antwort",
"askedVocab": "Abgefragt:",
"stats": "Statistik",
"dueToday": "Heute fällig",
"done": "Erledigt",

View File

@@ -453,6 +453,8 @@
"acceptable": "Acceptable answers:",
"correctSolutions": "Correct answer:",
"yourAnswer": "Your answer:",
"wrongReviewTitle": "Previous wrong answer",
"askedVocab": "Asked:",
"stats": "Stats",
"dueToday": "Due today",
"done": "Done",

View File

@@ -451,6 +451,10 @@
"correct": "¡Correcto!",
"wrong": "Incorrecto.",
"acceptable": "Traducciones correctas posibles:",
"correctSolutions": "Respuesta correcta:",
"yourAnswer": "Tu respuesta:",
"wrongReviewTitle": "Respuesta incorrecta anterior",
"askedVocab": "Preguntado:",
"stats": "Estadísticas",
"success": "Éxito",
"fail": "Fallo"

View File

@@ -451,6 +451,10 @@
"correct": "Correct!",
"wrong": "Incorrect.",
"acceptable": "Traductions correctes possibles :",
"correctSolutions": "Bonne réponse :",
"yourAnswer": "Votre réponse :",
"wrongReviewTitle": "Réponse incorrecte précédente",
"askedVocab": "Demandé :",
"stats": "statistiques",
"success": "Succès",
"fail": "échec"