From 4abed5263e5acd5657cf256169ce92ac113b0dd7 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Thu, 21 May 2026 10:50:15 +0200 Subject: [PATCH] frontend: treat trailing parenthetical notes as optional in vocab matching --- frontend/src/views/social/VocabLessonView.vue | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/social/VocabLessonView.vue b/frontend/src/views/social/VocabLessonView.vue index 4f5e882..825ee24 100644 --- a/frontend/src/views/social/VocabLessonView.vue +++ b/frontend/src/views/social/VocabLessonView.vue @@ -4154,7 +4154,7 @@ export default { return text; }, normalizeVocab(s, options = {}) { - const { ignoreTrailingParentheticalNotes = false } = options; + const { ignoreTrailingParentheticalNotes = true } = options; const source = ignoreTrailingParentheticalNotes ? this.stripTrailingParentheticalNotes(s) : s; @@ -4250,15 +4250,13 @@ export default { userAnswer = this.vocabTrainerAnswer; } - const useTypingNormalization = this.vocabTrainerMode === 'typing'; - const normalizedUser = this.normalizeVocab(userAnswer, { - ignoreTrailingParentheticalNotes: useTypingNormalization - }); + // Treat parenthetical notes as optional for answer matching. + const normalizedUser = this.normalizeVocab(userAnswer); const rawAnswers = this.currentVocabQuestion.answers || [this.currentVocabQuestion.answer]; // Expand alternatives like "A / B" into separate acceptable answers const expandedAnswers = rawAnswers.flatMap(a => this.expandAnswerVariants(a)); const normalizedCorrectAnswers = expandedAnswers - .map(answer => this.normalizeVocab(answer, { ignoreTrailingParentheticalNotes: useTypingNormalization })); + .map(answer => this.normalizeVocab(answer)); this.vocabTrainerLastCorrect = normalizedCorrectAnswers.includes(normalizedUser); // Update Stats