From 5f13583e41ce2ef354158e8cd2ac7cc87bb7fae3 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Mon, 20 Apr 2026 09:39:48 +0200 Subject: [PATCH] feat(VocabLessonView, localization): add vocabulary review feature and update translations - Implemented a new vocabulary review section in VocabLessonView to display the last incorrect answer, including the asked vocabulary, user answer, and correct answer. - Added localization strings for the new review feature in Cebuano, German, English, Spanish, and French, enhancing user experience across multiple languages. - Updated the UI to visually differentiate the review section, improving clarity and usability during vocabulary training sessions. --- .../src/i18n/locales/ceb/socialnetwork.json | 3 + .../src/i18n/locales/de/socialnetwork.json | 3 + .../src/i18n/locales/en/socialnetwork.json | 3 + .../src/i18n/locales/es/socialnetwork.json | 3 + .../src/i18n/locales/fr/socialnetwork.json | 3 + frontend/src/views/social/VocabLessonView.vue | 60 +++++++++++++++++++ 6 files changed, 75 insertions(+) diff --git a/frontend/src/i18n/locales/ceb/socialnetwork.json b/frontend/src/i18n/locales/ceb/socialnetwork.json index fa5cfa4..c086571 100644 --- a/frontend/src/i18n/locales/ceb/socialnetwork.json +++ b/frontend/src/i18n/locales/ceb/socialnetwork.json @@ -594,6 +594,9 @@ "checkAnswer": "Susihi Answer", "correct": "Tama!", "wrong": "Sayop", + "trainerWrongReviewTitle": "Tan-awa pag-usab", + "trainerAskedVocab": "Gipangutana", + "trainerYourAnswer": "Imong answer", "explanation": "Pasabot", "learn": "Learn", "exercises": "Tsek sa kapitulo", diff --git a/frontend/src/i18n/locales/de/socialnetwork.json b/frontend/src/i18n/locales/de/socialnetwork.json index 6da3b49..814df01 100644 --- a/frontend/src/i18n/locales/de/socialnetwork.json +++ b/frontend/src/i18n/locales/de/socialnetwork.json @@ -576,6 +576,9 @@ "checkAnswer": "Antwort prüfen", "correct": "Richtig!", "wrong": "Falsch", + "trainerWrongReviewTitle": "Noch einmal ansehen", + "trainerAskedVocab": "Abgefragt", + "trainerYourAnswer": "Deine Antwort", "explanation": "Erklärung", "learn": "Lernen", "exercises": "Kapitel-Prüfung", diff --git a/frontend/src/i18n/locales/en/socialnetwork.json b/frontend/src/i18n/locales/en/socialnetwork.json index bd22c28..25a9262 100644 --- a/frontend/src/i18n/locales/en/socialnetwork.json +++ b/frontend/src/i18n/locales/en/socialnetwork.json @@ -576,6 +576,9 @@ "checkAnswer": "Check Answer", "correct": "Correct!", "wrong": "Wrong", + "trainerWrongReviewTitle": "Review this again", + "trainerAskedVocab": "Asked", + "trainerYourAnswer": "Your answer", "explanation": "Explanation", "learn": "Learn", "exercises": "Chapter Test", diff --git a/frontend/src/i18n/locales/es/socialnetwork.json b/frontend/src/i18n/locales/es/socialnetwork.json index 975f333..e1e04b1 100644 --- a/frontend/src/i18n/locales/es/socialnetwork.json +++ b/frontend/src/i18n/locales/es/socialnetwork.json @@ -560,6 +560,9 @@ "checkAnswer": "Comprobar respuesta", "correct": "¡Correcto!", "wrong": "Incorrecto", + "trainerWrongReviewTitle": "Repasar de nuevo", + "trainerAskedVocab": "Preguntado", + "trainerYourAnswer": "Tu respuesta", "explanation": "Explicación", "learn": "Aprender", "exercises": "Prueba del capítulo", diff --git a/frontend/src/i18n/locales/fr/socialnetwork.json b/frontend/src/i18n/locales/fr/socialnetwork.json index dea1ad8..1b65976 100644 --- a/frontend/src/i18n/locales/fr/socialnetwork.json +++ b/frontend/src/i18n/locales/fr/socialnetwork.json @@ -560,6 +560,9 @@ "checkAnswer": "Vérifier la réponse", "correct": "Correct!", "wrong": "Incorrect", + "trainerWrongReviewTitle": "À revoir", + "trainerAskedVocab": "Demandé", + "trainerYourAnswer": "Votre réponse", "explanation": "Explication", "learn": "Apprendre", "exercises": "Examen de chapitre", diff --git a/frontend/src/views/social/VocabLessonView.vue b/frontend/src/views/social/VocabLessonView.vue index 3272252..a22d679 100644 --- a/frontend/src/views/social/VocabLessonView.vue +++ b/frontend/src/views/social/VocabLessonView.vue @@ -320,6 +320,23 @@ {{ $t('socialnetwork.vocab.courses.checkAnswer') }} +
+ {{ $t('socialnetwork.vocab.courses.trainerWrongReviewTitle') }} +
+
+
{{ $t('socialnetwork.vocab.courses.trainerAskedVocab') }}
+
{{ vocabTrainerLastWrongReview.prompt }}
+
+
+
{{ $t('socialnetwork.vocab.courses.trainerYourAnswer') }}
+
{{ vocabTrainerLastWrongReview.userAnswer }}
+
+
+
{{ $t('socialnetwork.vocab.courses.correctAnswer') }}
+
{{ vocabTrainerLastWrongReview.answer }}
+
+
+
@@ -1085,6 +1102,7 @@ export default { vocabTrainerAnswered: false, vocabTrainerLastCorrect: false, vocabTrainerContinueTimer: null, + vocabTrainerLastWrongReview: null, vocabTrainerDirection: 'L2R', // L2R: learning->reference, R2L: reference->learning isCheckingLessonCompletion: false, // Flag um Endlosschleife zu verhindern isNavigatingToNext: false, // Flag um mehrfache Navigation zu verhindern @@ -3351,6 +3369,7 @@ export default { this.vocabTrainerReviewAttempts = 0; this.vocabTrainerStats = {}; this.vocabTrainerRepeatQueue = []; + this.vocabTrainerLastWrongReview = null; // Bereite Mixed-Pool aus alten Vokabeln vor (ohne Duplikate aus aktueller Lektion) this.vocabTrainerMixedPool = this._buildMixedPool(); this.vocabTrainerPhase = 'current'; @@ -3377,6 +3396,7 @@ export default { this.vocabTrainerAnswer = ''; this.vocabTrainerSelectedChoice = null; this.vocabTrainerAnswered = false; + this.vocabTrainerLastWrongReview = null; }, /** Erstellt den Mixed-Pool aus vorherigen Lektions-Vokabeln (ohne Duplikate der aktuellen Lektion) */ _buildMixedPool() { @@ -3945,10 +3965,16 @@ export default { } if (this.vocabTrainerLastCorrect) { + this.vocabTrainerLastWrongReview = null; this.vocabTrainerCorrect++; stats.correct++; this.resolveRepeatedVocab(this.currentVocabQuestion.vocab); } else { + this.vocabTrainerLastWrongReview = { + prompt: this.currentVocabQuestion.prompt, + userAnswer, + answer: this.currentVocabQuestion.answer + }; this.vocabTrainerWrong++; stats.wrong++; this.queueFailedVocab(this.currentVocabQuestion.vocab); @@ -5537,6 +5563,40 @@ export default { border: 1px solid #f5c6cb; } +.vocab-wrong-review { + margin: 12px 0 15px; + padding: 14px 16px; + border: 1px solid #ef9a9a; + border-radius: 6px; + background: #fff1f1; + color: #4a1f1f; +} + +.vocab-wrong-review strong { + display: block; + margin-bottom: 10px; +} + +.vocab-wrong-review dl { + display: grid; + gap: 8px; + margin: 0; +} + +.vocab-wrong-review dl > div { + display: grid; + grid-template-columns: minmax(120px, 0.3fr) 1fr; + gap: 10px; +} + +.vocab-wrong-review dt { + font-weight: 700; +} + +.vocab-wrong-review dd { + margin: 0; +} + .vocab-next { margin-top: 15px; }