From efdaf87464a38783991da85bbe398910407560be Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Wed, 26 Aug 2026 14:05:40 +0200 Subject: [PATCH] feat(vocab): refine vocabulary filtering to exclude invalid exercise pairs --- frontend/src/views/social/VocabLessonView.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/social/VocabLessonView.vue b/frontend/src/views/social/VocabLessonView.vue index ef290dc..355180b 100755 --- a/frontend/src/views/social/VocabLessonView.vue +++ b/frontend/src/views/social/VocabLessonView.vue @@ -3663,7 +3663,13 @@ export default { _buildMixedPool() { if (!this.previousVocab || this.previousVocab.length === 0) return []; const currentKeys = new Set(this.trainableLessonVocab.map(v => this.getVocabKey(v))); - const filtered = this.previousVocab.filter(v => !currentKeys.has(this.getVocabKey(v))); + // Older generated exercises can contain a single word paired with a full + // sentence (e.g. "Haus" → "Naa ko sa balay"). Such pairs are neither + // valid vocabulary cards nor valid review questions. + const filtered = this.previousVocab.filter((v) => ( + this.isTrainableLessonVocabPair(v?.learning, v?.reference) + && !currentKeys.has(this.getVocabKey(v)) + )); const filteredByKey = new Map(filtered.map((v) => [this.getVocabKey(v), v])); const weakMap = new Map();