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
All checks were successful
Deploy to production / deploy (push) Successful in 33s
This commit is contained in:
@@ -72,6 +72,13 @@ function collectExerciseAuditWarnings(lessonTitle, exerciseData, exerciseNumber)
|
|||||||
const answers = Array.isArray(answerData.answers) ? answerData.answers : [];
|
const answers = Array.isArray(answerData.answers) ? answerData.answers : [];
|
||||||
if (!text || !answers.length) return warnings;
|
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 hints = [];
|
||||||
const hintRegex = /\(([^)]+)\)/g;
|
const hintRegex = /\(([^)]+)\)/g;
|
||||||
let match = hintRegex.exec(text);
|
let match = hintRegex.exec(text);
|
||||||
@@ -3789,14 +3796,14 @@ const BISAYA_EXERCISES = {
|
|||||||
instruction: 'Fülle die Lücken mit den richtigen Bisaya-Wörtern.',
|
instruction: 'Fülle die Lücken mit den richtigen Bisaya-Wörtern.',
|
||||||
questionData: {
|
questionData: {
|
||||||
type: 'gap_fill',
|
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
|
gaps: 2
|
||||||
},
|
},
|
||||||
answerData: {
|
answerData: {
|
||||||
type: 'gap_fill',
|
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
|
exerciseTypeId: 4, // transformation
|
||||||
|
|||||||
Reference in New Issue
Block a user