feat: füge Überprüfung der Platzhalteranzahl in Gap-Fill-Übungen hinzu und aktualisiere Beispieltexte
All checks were successful
Deploy to production / deploy (push) Successful in 33s

This commit is contained in:
Torsten Schulz (local)
2026-05-27 10:43:21 +02:00
parent 2ca008806f
commit 664a7b3530

View File

@@ -72,6 +72,13 @@ function collectExerciseAuditWarnings(lessonTitle, exerciseData, exerciseNumber)
const answers = Array.isArray(answerData.answers) ? answerData.answers : [];
if (!text || !answers.length) return warnings;
const placeholderCount = (text.match(/\{\s*gap\s*\}/gi) || []).length;
if (placeholderCount !== answers.length) {
warnings.push(
`[${lessonTitle} #${exerciseNumber}] Gap-Fill enthält ${placeholderCount} sichtbare Lücke(n), aber ${answers.length} Antwort(en).`
);
}
const hints = [];
const hintRegex = /\(([^)]+)\)/g;
let match = hintRegex.exec(text);
@@ -3789,14 +3796,14 @@ const BISAYA_EXERCISES = {
instruction: 'Fülle die Lücken mit den richtigen Bisaya-Wörtern.',
questionData: {
type: 'gap_fill',
text: 'Unsa imong ginabuhat? (Was machst du?) - Nagtrabaho ko. (Ich arbeite.) | Kapoy ko. (Ich bin müde.)',
text: 'Unsa imong ginabuhat? (Was machst du?) - {gap} ko. (Ich arbeite.) | Kumusta ka? (Wie geht es dir?) - {gap} ko. (Ich bin müde.)',
gaps: 2
},
answerData: {
type: 'gap_fill',
answers: ['Nagtrabaho', 'ko']
answers: ['Nagtrabaho', 'Kapoy']
},
explanation: '"Nagtrabaho ko" = Ich arbeite, "Kapoy ko" = Ich bin müde.'
explanation: '"Nagtrabaho ko" antwortet auf die Tätigkeit; "Kapoy ko" beschreibt den Zustand.'
},
{
exerciseTypeId: 4, // transformation