feat(VocabPracticeDialog, localization): implement last wrong answer review feature
All checks were successful
Deploy to production / deploy (push) Successful in 1m49s
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:
@@ -45,17 +45,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</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 v-if="showSrsRatingButtons" class="srs-rating">
|
||||||
<div class="srs-rating__title">{{ $t('socialnetwork.vocab.practice.srsRateTitle') }}</div>
|
<div class="srs-rating__title">{{ $t('socialnetwork.vocab.practice.srsRateTitle') }}</div>
|
||||||
<button
|
<button
|
||||||
@@ -106,6 +95,22 @@
|
|||||||
{{ $t('socialnetwork.vocab.practice.skip') }}
|
{{ $t('socialnetwork.vocab.practice.skip') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -175,6 +180,7 @@ export default {
|
|||||||
direction: 'L2R', // L2R: learning->reference, R2L: reference->learning
|
direction: 'L2R', // L2R: learning->reference, R2L: reference->learning
|
||||||
acceptableAnswers: [],
|
acceptableAnswers: [],
|
||||||
submittedAnswer: '',
|
submittedAnswer: '',
|
||||||
|
lastWrongReview: null,
|
||||||
choiceOptions: [],
|
choiceOptions: [],
|
||||||
typedAnswer: '',
|
typedAnswer: '',
|
||||||
answered: false,
|
answered: false,
|
||||||
@@ -371,6 +377,7 @@ export default {
|
|||||||
this.wrongCount = 0;
|
this.wrongCount = 0;
|
||||||
this.perId = {};
|
this.perId = {};
|
||||||
this.lastIds = [];
|
this.lastIds = [];
|
||||||
|
this.lastWrongReview = null;
|
||||||
this.pool = [];
|
this.pool = [];
|
||||||
this.locked = false;
|
this.locked = false;
|
||||||
this.resetQuestion();
|
this.resetQuestion();
|
||||||
@@ -739,8 +746,20 @@ export default {
|
|||||||
markResult(isCorrect) {
|
markResult(isCorrect) {
|
||||||
this.answered = true;
|
this.answered = true;
|
||||||
this.lastCorrect = isCorrect;
|
this.lastCorrect = isCorrect;
|
||||||
if (isCorrect) this.correctCount += 1;
|
if (isCorrect) {
|
||||||
else this.wrongCount += 1;
|
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) {
|
if (!this.srsMode) {
|
||||||
this.reportSrsReview(isCorrect);
|
this.reportSrsReview(isCorrect);
|
||||||
}
|
}
|
||||||
@@ -977,10 +996,22 @@ export default {
|
|||||||
border: 1px solid #d33;
|
border: 1px solid #d33;
|
||||||
background: #fff8f8;
|
background: #fff8f8;
|
||||||
}
|
}
|
||||||
|
.solution-card--persistent {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
.solution-card ul {
|
.solution-card ul {
|
||||||
margin: 6px 0 0;
|
margin: 6px 0 0;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
|
.solution-row {
|
||||||
|
display: grid;
|
||||||
|
gap: 3px;
|
||||||
|
margin: 8px 0;
|
||||||
|
color: #5f554e;
|
||||||
|
}
|
||||||
|
.solution-row strong {
|
||||||
|
color: #2b2520;
|
||||||
|
}
|
||||||
.submitted-answer {
|
.submitted-answer {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 3px;
|
gap: 3px;
|
||||||
|
|||||||
@@ -796,6 +796,10 @@
|
|||||||
"correct": "Tama!",
|
"correct": "Tama!",
|
||||||
"wrong": "Sayop.",
|
"wrong": "Sayop.",
|
||||||
"acceptable": "Acceptable answers:",
|
"acceptable": "Acceptable answers:",
|
||||||
|
"correctSolutions": "Tama answer:",
|
||||||
|
"yourAnswer": "Imong answer:",
|
||||||
|
"wrongReviewTitle": "Previous wrong answer",
|
||||||
|
"askedVocab": "Gipangutana:",
|
||||||
"stats": "Stats",
|
"stats": "Stats",
|
||||||
"dueToday": "Due karon",
|
"dueToday": "Due karon",
|
||||||
"done": "Nahuman",
|
"done": "Nahuman",
|
||||||
|
|||||||
@@ -453,6 +453,8 @@
|
|||||||
"acceptable": "Mögliche richtige Übersetzungen:",
|
"acceptable": "Mögliche richtige Übersetzungen:",
|
||||||
"correctSolutions": "Richtige Antwort:",
|
"correctSolutions": "Richtige Antwort:",
|
||||||
"yourAnswer": "Deine Antwort:",
|
"yourAnswer": "Deine Antwort:",
|
||||||
|
"wrongReviewTitle": "Vorherige falsche Antwort",
|
||||||
|
"askedVocab": "Abgefragt:",
|
||||||
"stats": "Statistik",
|
"stats": "Statistik",
|
||||||
"dueToday": "Heute fällig",
|
"dueToday": "Heute fällig",
|
||||||
"done": "Erledigt",
|
"done": "Erledigt",
|
||||||
|
|||||||
@@ -453,6 +453,8 @@
|
|||||||
"acceptable": "Acceptable answers:",
|
"acceptable": "Acceptable answers:",
|
||||||
"correctSolutions": "Correct answer:",
|
"correctSolutions": "Correct answer:",
|
||||||
"yourAnswer": "Your answer:",
|
"yourAnswer": "Your answer:",
|
||||||
|
"wrongReviewTitle": "Previous wrong answer",
|
||||||
|
"askedVocab": "Asked:",
|
||||||
"stats": "Stats",
|
"stats": "Stats",
|
||||||
"dueToday": "Due today",
|
"dueToday": "Due today",
|
||||||
"done": "Done",
|
"done": "Done",
|
||||||
|
|||||||
@@ -451,6 +451,10 @@
|
|||||||
"correct": "¡Correcto!",
|
"correct": "¡Correcto!",
|
||||||
"wrong": "Incorrecto.",
|
"wrong": "Incorrecto.",
|
||||||
"acceptable": "Traducciones correctas posibles:",
|
"acceptable": "Traducciones correctas posibles:",
|
||||||
|
"correctSolutions": "Respuesta correcta:",
|
||||||
|
"yourAnswer": "Tu respuesta:",
|
||||||
|
"wrongReviewTitle": "Respuesta incorrecta anterior",
|
||||||
|
"askedVocab": "Preguntado:",
|
||||||
"stats": "Estadísticas",
|
"stats": "Estadísticas",
|
||||||
"success": "Éxito",
|
"success": "Éxito",
|
||||||
"fail": "Fallo"
|
"fail": "Fallo"
|
||||||
|
|||||||
@@ -451,6 +451,10 @@
|
|||||||
"correct": "Correct!",
|
"correct": "Correct!",
|
||||||
"wrong": "Incorrect.",
|
"wrong": "Incorrect.",
|
||||||
"acceptable": "Traductions correctes possibles :",
|
"acceptable": "Traductions correctes possibles :",
|
||||||
|
"correctSolutions": "Bonne réponse :",
|
||||||
|
"yourAnswer": "Votre réponse :",
|
||||||
|
"wrongReviewTitle": "Réponse incorrecte précédente",
|
||||||
|
"askedVocab": "Demandé :",
|
||||||
"stats": "statistiques",
|
"stats": "statistiques",
|
||||||
"success": "Succès",
|
"success": "Succès",
|
||||||
"fail": "échec"
|
"fail": "échec"
|
||||||
|
|||||||
Reference in New Issue
Block a user