fix(vocabService): skip multi-word learning items in SRS item processing
All checks were successful
Deploy to production / deploy (push) Successful in 1m57s
All checks were successful
Deploy to production / deploy (push) Successful in 1m57s
This commit is contained in:
@@ -2672,6 +2672,11 @@ export default class VocabService {
|
|||||||
let maxNum = list.reduce((m, ex) => Math.max(m, Number(ex.exerciseNumber) || 0), 0);
|
let maxNum = list.reduce((m, ex) => Math.max(m, Number(ex.exerciseNumber) || 0), 0);
|
||||||
const augmentedRows = rows.map((r) => ({ ...r, allReferences }));
|
const augmentedRows = rows.map((r) => ({ ...r, allReferences }));
|
||||||
for (const row of augmentedRows) {
|
for (const row of augmentedRows) {
|
||||||
|
// Skip multi-word learning items (they are sentences, not single lexemes)
|
||||||
|
const learningText = String(row.learning || '').trim();
|
||||||
|
if (!learningText || learningText.split(/\s+/).length > 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (this._lexemePairCoveredByMultipleChoice(list, row.learning, row.reference)) {
|
if (this._lexemePairCoveredByMultipleChoice(list, row.learning, row.reference)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user