- Introduced a comprehensive set of survival phrases in Bisaya, including multiple choice and gap fill exercises to enhance language learning. - Added detailed explanations for each phrase to aid understanding and context for learners. - Structured content into two parts for better organization and accessibility, ensuring a progressive learning experience. - Updated existing exercises to include new vocabulary and improve user engagement with practical language use.
583 lines
19 KiB
JavaScript
583 lines
19 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Script zum Erstellen von sprachspezifischem Content für Bisaya-Kurse
|
|
*
|
|
* Verwendung:
|
|
* node backend/scripts/create-bisaya-course-content.js
|
|
*
|
|
* Erstellt Grammatik-Übungen für alle Lektionen in Bisaya-Kursen basierend auf dem Thema der Lektion.
|
|
*/
|
|
|
|
import { sequelize } from '../utils/sequelize.js';
|
|
import VocabCourseLesson from '../models/community/vocab_course_lesson.js';
|
|
import VocabGrammarExercise from '../models/community/vocab_grammar_exercise.js';
|
|
import VocabCourse from '../models/community/vocab_course.js';
|
|
import User from '../models/community/user.js';
|
|
|
|
// Bisaya-spezifische Übungen basierend auf Lektionsthemen
|
|
const BISAYA_EXERCISES = {
|
|
// Lektion 1: Begrüßungen & Höflichkeit
|
|
'Begrüßungen & Höflichkeit': [
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: 'Wie sagt man "Wie geht es dir?" auf Bisaya?',
|
|
instruction: 'Wähle die richtige Begrüßung aus.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Wie sagt man "Wie geht es dir?" auf Bisaya?',
|
|
options: ['Kumusta ka?', 'Maayo', 'Salamat', 'Palihug']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: '"Kumusta ka?" ist die Standard-Begrüßung auf Bisaya, ähnlich wie "Wie geht es dir?"'
|
|
},
|
|
{
|
|
exerciseTypeId: 1, // gap_fill
|
|
title: 'Begrüßungen vervollständigen',
|
|
instruction: 'Fülle die Lücken mit den richtigen Bisaya-Wörtern.',
|
|
questionData: {
|
|
type: 'gap_fill',
|
|
text: 'Kumusta ka? Maayo {gap}. Salamat {gap} palihug.',
|
|
gaps: 2
|
|
},
|
|
answerData: {
|
|
type: 'gap_fill',
|
|
answers: ['ko', 'ug']
|
|
},
|
|
explanation: '"Maayo ko" bedeutet "Mir geht es gut" und "ug" verbindet die Wörter.'
|
|
},
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: 'Was bedeutet "Salamat"?',
|
|
instruction: 'Wähle die richtige Übersetzung.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Was bedeutet "Salamat"?',
|
|
options: ['Danke', 'Bitte', 'Entschuldigung', 'Auf Wiedersehen']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: '"Salamat" bedeutet "Danke" auf Bisaya.'
|
|
}
|
|
],
|
|
|
|
// Lektion 15: Zeitformen - Grundlagen
|
|
'Zeitformen - Grundlagen': [
|
|
{
|
|
exerciseTypeId: 4, // transformation
|
|
title: 'Vergangenheit verstehen',
|
|
instruction: 'Was bedeutet "Ni-kaon ko"?',
|
|
questionData: {
|
|
type: 'transformation',
|
|
text: 'Ni-kaon ko',
|
|
sourceLanguage: 'Bisaya',
|
|
targetLanguage: 'Deutsch'
|
|
},
|
|
answerData: {
|
|
type: 'transformation',
|
|
correct: 'Ich habe gegessen',
|
|
alternatives: ['I ate', 'I have eaten']
|
|
},
|
|
explanation: 'Das Präfix "Ni-" zeigt die Vergangenheit an. "Ni-kaon ko" bedeutet "Ich habe gegessen".'
|
|
},
|
|
{
|
|
exerciseTypeId: 4, // transformation
|
|
title: 'Zukunft verstehen',
|
|
instruction: 'Was bedeutet "Mo-kaon ko"?',
|
|
questionData: {
|
|
type: 'transformation',
|
|
text: 'Mo-kaon ko',
|
|
sourceLanguage: 'Bisaya',
|
|
targetLanguage: 'Deutsch'
|
|
},
|
|
answerData: {
|
|
type: 'transformation',
|
|
correct: 'Ich werde essen',
|
|
alternatives: ['I will eat', 'I am going to eat']
|
|
},
|
|
explanation: 'Das Präfix "Mo-" zeigt die Zukunft an. "Mo-kaon ko" bedeutet "Ich werde essen".'
|
|
},
|
|
{
|
|
exerciseTypeId: 1, // gap_fill
|
|
title: 'Zeitformen erkennen',
|
|
instruction: 'Setze die richtigen Präfixe ein.',
|
|
questionData: {
|
|
type: 'gap_fill',
|
|
text: '{gap}-kaon ko (Vergangenheit) | {gap}-kaon ko (Zukunft)',
|
|
gaps: 2
|
|
},
|
|
answerData: {
|
|
type: 'gap_fill',
|
|
answers: ['Ni', 'Mo']
|
|
},
|
|
explanation: 'Ni- für Vergangenheit, Mo- für Zukunft.'
|
|
}
|
|
],
|
|
|
|
// Lektion 25: Höflichkeitsformen
|
|
'Höflichkeitsformen': [
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: 'Wie sagt man "Bitte langsam"?',
|
|
instruction: 'Wähle die höfliche Form aus.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Wie sagt man "Bitte langsam" auf Bisaya?',
|
|
options: ['Hinay-hinay lang', 'Palihug', 'Salamat', 'Maayo']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: '"Hinay-hinay lang" bedeutet "Bitte langsam" und ist sehr höflich.'
|
|
},
|
|
{
|
|
exerciseTypeId: 1, // gap_fill
|
|
title: 'Höfliche Sätze vervollständigen',
|
|
instruction: 'Fülle die Lücken mit höflichen Wörtern.',
|
|
questionData: {
|
|
type: 'gap_fill',
|
|
text: '{gap} lang, wala ko kasabot. {gap} ka mubalik?',
|
|
gaps: 2
|
|
},
|
|
answerData: {
|
|
type: 'gap_fill',
|
|
answers: ['Hinay-hinay', 'Palihug']
|
|
},
|
|
explanation: '"Hinay-hinay lang" = "Bitte langsam", "Palihug" = "Bitte".'
|
|
},
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: 'Was bedeutet "Palihug"?',
|
|
instruction: 'Wähle die richtige Übersetzung.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Was bedeutet "Palihug"?',
|
|
options: ['Bitte', 'Danke', 'Entschuldigung', 'Gern geschehen']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: '"Palihug" bedeutet "Bitte" auf Bisaya und wird für höfliche Bitten verwendet.'
|
|
}
|
|
],
|
|
|
|
// Lektion: Überlebenssätze
|
|
'Überlebenssätze': [
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: 'Wie sagt man "Ich verstehe nicht"?',
|
|
instruction: 'Wähle die richtige Übersetzung.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Wie sagt man "Ich verstehe nicht" auf Bisaya?',
|
|
options: ['Wala ko kasabot', 'Palihug', 'Salamat', 'Maayo']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: '"Wala ko kasabot" bedeutet "Ich verstehe nicht" - sehr wichtig für Anfänger!'
|
|
},
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: 'Wie sagt man "Kannst du das wiederholen?"?',
|
|
instruction: 'Wähle die richtige Bitte aus.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Wie sagt man "Kannst du das wiederholen?" auf Bisaya?',
|
|
options: ['Palihug ka mubalik?', 'Salamat', 'Maayo', 'Kumusta ka?']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: '"Palihug ka mubalik?" bedeutet "Bitte kannst du wiederholen?" - essentiell für das Lernen!'
|
|
},
|
|
{
|
|
exerciseTypeId: 1, // gap_fill
|
|
title: 'Überlebenssätze vervollständigen',
|
|
instruction: 'Fülle die Lücken mit den richtigen Bisaya-Wörtern.',
|
|
questionData: {
|
|
type: 'gap_fill',
|
|
text: '{gap} ko kasabot. {gap} ka mubalik? {gap} lang.',
|
|
gaps: 3
|
|
},
|
|
answerData: {
|
|
type: 'gap_fill',
|
|
answers: ['Wala', 'Palihug', 'Hinay-hinay']
|
|
},
|
|
explanation: '"Wala ko kasabot" = "Ich verstehe nicht", "Palihug ka mubalik?" = "Bitte wiederholen", "Hinay-hinay lang" = "Bitte langsam".'
|
|
},
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: 'Wie sagt man "Wo ist...?"?',
|
|
instruction: 'Wähle die richtige Frage aus.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Wie sagt man "Wo ist die Toilette?" auf Bisaya?',
|
|
options: ['Asa ang CR?', 'Kumusta ka?', 'Salamat', 'Maayo']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: '"Asa ang CR?" bedeutet "Wo ist die Toilette?" - "Asa" = "Wo", "CR" = "Comfort Room" (Toilette).'
|
|
},
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: 'Wie sagt man "Wie viel kostet das?"?',
|
|
instruction: 'Wähle die richtige Frage aus.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Wie sagt man "Wie viel kostet das?" auf Bisaya?',
|
|
options: ['Tagpila ni?', 'Asa ni?', 'Unsa ni?', 'Kinsa ni?']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: '"Tagpila ni?" bedeutet "Wie viel kostet das?" - sehr nützlich beim Einkaufen!'
|
|
},
|
|
{
|
|
exerciseTypeId: 1, // gap_fill
|
|
title: 'Wichtige Fragen bilden',
|
|
instruction: 'Fülle die Lücken mit den richtigen Fragewörtern.',
|
|
questionData: {
|
|
type: 'gap_fill',
|
|
text: '{gap} ang CR? (Wo ist die Toilette?) | {gap} ni? (Wie viel kostet das?) | {gap} ni? (Was ist das?)',
|
|
gaps: 3
|
|
},
|
|
answerData: {
|
|
type: 'gap_fill',
|
|
answers: ['Asa', 'Tagpila', 'Unsa']
|
|
},
|
|
explanation: '"Asa" = "Wo", "Tagpila" = "Wie viel", "Unsa" = "Was".'
|
|
},
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: 'Wie sagt man "Entschuldigung"?',
|
|
instruction: 'Wähle die richtige Entschuldigung aus.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Wie sagt man "Entschuldigung" auf Bisaya?',
|
|
options: ['Pasensya', 'Salamat', 'Palihug', 'Maayo']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: '"Pasensya" bedeutet "Entschuldigung" oder "Entschuldige bitte" - wichtig für höfliche Kommunikation.'
|
|
},
|
|
{
|
|
exerciseTypeId: 4, // transformation
|
|
title: 'Überlebenssätze übersetzen',
|
|
instruction: 'Übersetze den Satz ins Bisaya.',
|
|
questionData: {
|
|
type: 'transformation',
|
|
text: 'Ich spreche kein Bisaya',
|
|
sourceLanguage: 'Deutsch',
|
|
targetLanguage: 'Bisaya'
|
|
},
|
|
answerData: {
|
|
type: 'transformation',
|
|
correct: 'Dili ko mag-Bisaya',
|
|
alternatives: ['Wala ko mag-Bisaya', 'Dili ko makasabot Bisaya']
|
|
},
|
|
explanation: '"Dili ko mag-Bisaya" bedeutet "Ich spreche kein Bisaya" - nützlich, um zu erklären, dass du noch lernst.'
|
|
}
|
|
],
|
|
|
|
// Auch für "Überlebenssätze - Teil 1" und "Überlebenssätze - Teil 2"
|
|
'Überlebenssätze - Teil 1': [
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: 'Wie sagt man "Ich verstehe nicht"?',
|
|
instruction: 'Wähle die richtige Übersetzung.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Wie sagt man "Ich verstehe nicht" auf Bisaya?',
|
|
options: ['Wala ko kasabot', 'Palihug', 'Salamat', 'Maayo']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: '"Wala ko kasabot" bedeutet "Ich verstehe nicht" - sehr wichtig für Anfänger!'
|
|
},
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: 'Wie sagt man "Kannst du das wiederholen?"?',
|
|
instruction: 'Wähle die richtige Bitte aus.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Wie sagt man "Kannst du das wiederholen?" auf Bisaya?',
|
|
options: ['Palihug ka mubalik?', 'Salamat', 'Maayo', 'Kumusta ka?']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: '"Palihug ka mubalik?" bedeutet "Bitte kannst du wiederholen?" - essentiell für das Lernen!'
|
|
},
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: 'Wie sagt man "Wo ist...?"?',
|
|
instruction: 'Wähle die richtige Frage aus.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Wie sagt man "Wo ist die Toilette?" auf Bisaya?',
|
|
options: ['Asa ang CR?', 'Kumusta ka?', 'Salamat', 'Maayo']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: '"Asa ang CR?" bedeutet "Wo ist die Toilette?" - "Asa" = "Wo", "CR" = "Comfort Room" (Toilette).'
|
|
},
|
|
{
|
|
exerciseTypeId: 1, // gap_fill
|
|
title: 'Überlebenssätze vervollständigen',
|
|
instruction: 'Fülle die Lücken mit den richtigen Bisaya-Wörtern.',
|
|
questionData: {
|
|
type: 'gap_fill',
|
|
text: '{gap} ko kasabot. {gap} ka mubalik?',
|
|
gaps: 2
|
|
},
|
|
answerData: {
|
|
type: 'gap_fill',
|
|
answers: ['Wala', 'Palihug']
|
|
},
|
|
explanation: '"Wala ko kasabot" = "Ich verstehe nicht", "Palihug ka mubalik?" = "Bitte wiederholen".'
|
|
}
|
|
],
|
|
|
|
'Überlebenssätze - Teil 2': [
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: 'Wie sagt man "Wie viel kostet das?"?',
|
|
instruction: 'Wähle die richtige Frage aus.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Wie sagt man "Wie viel kostet das?" auf Bisaya?',
|
|
options: ['Tagpila ni?', 'Asa ni?', 'Unsa ni?', 'Kinsa ni?']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: '"Tagpila ni?" bedeutet "Wie viel kostet das?" - sehr nützlich beim Einkaufen!'
|
|
},
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: 'Wie sagt man "Entschuldigung"?',
|
|
instruction: 'Wähle die richtige Entschuldigung aus.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Wie sagt man "Entschuldigung" auf Bisaya?',
|
|
options: ['Pasensya', 'Salamat', 'Palihug', 'Maayo']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: '"Pasensya" bedeutet "Entschuldigung" oder "Entschuldige bitte" - wichtig für höfliche Kommunikation.'
|
|
},
|
|
{
|
|
exerciseTypeId: 1, // gap_fill
|
|
title: 'Wichtige Fragen bilden',
|
|
instruction: 'Fülle die Lücken mit den richtigen Fragewörtern.',
|
|
questionData: {
|
|
type: 'gap_fill',
|
|
text: '{gap} ni? (Wie viel kostet das?) | {gap} ni? (Was ist das?) | {gap} lang (Bitte langsam)',
|
|
gaps: 3
|
|
},
|
|
answerData: {
|
|
type: 'gap_fill',
|
|
answers: ['Tagpila', 'Unsa', 'Hinay-hinay']
|
|
},
|
|
explanation: '"Tagpila" = "Wie viel", "Unsa" = "Was", "Hinay-hinay lang" = "Bitte langsam".'
|
|
},
|
|
{
|
|
exerciseTypeId: 4, // transformation
|
|
title: 'Überlebenssätze übersetzen',
|
|
instruction: 'Übersetze den Satz ins Bisaya.',
|
|
questionData: {
|
|
type: 'transformation',
|
|
text: 'Ich spreche kein Bisaya',
|
|
sourceLanguage: 'Deutsch',
|
|
targetLanguage: 'Bisaya'
|
|
},
|
|
answerData: {
|
|
type: 'transformation',
|
|
correct: 'Dili ko mag-Bisaya',
|
|
alternatives: ['Wala ko mag-Bisaya', 'Dili ko makasabot Bisaya']
|
|
},
|
|
explanation: '"Dili ko mag-Bisaya" bedeutet "Ich spreche kein Bisaya" - nützlich, um zu erklären, dass du noch lernst.'
|
|
}
|
|
]
|
|
};
|
|
|
|
async function findOrCreateSystemUser() {
|
|
let systemUser = await User.findOne({
|
|
where: {
|
|
username: 'system'
|
|
}
|
|
});
|
|
|
|
if (!systemUser) {
|
|
systemUser = await User.findOne({
|
|
where: {
|
|
username: 'admin'
|
|
}
|
|
});
|
|
}
|
|
|
|
if (!systemUser) {
|
|
console.error('❌ System-Benutzer nicht gefunden.');
|
|
throw new Error('System user not found');
|
|
}
|
|
|
|
return systemUser;
|
|
}
|
|
|
|
function getExercisesForLesson(lessonTitle) {
|
|
// Suche nach exaktem Titel
|
|
if (BISAYA_EXERCISES[lessonTitle]) {
|
|
return BISAYA_EXERCISES[lessonTitle];
|
|
}
|
|
|
|
// Fallback: Suche nach Teilstring
|
|
for (const [key, exercises] of Object.entries(BISAYA_EXERCISES)) {
|
|
if (lessonTitle.includes(key) || key.includes(lessonTitle)) {
|
|
return exercises;
|
|
}
|
|
}
|
|
|
|
// Standard-Übungen für unbekannte Lektionen
|
|
return [
|
|
{
|
|
exerciseTypeId: 2, // multiple_choice
|
|
title: `${lessonTitle} - Übung 1`,
|
|
instruction: 'Wähle die richtige Antwort aus.',
|
|
questionData: {
|
|
type: 'multiple_choice',
|
|
question: 'Was ist die richtige Übersetzung?',
|
|
options: ['Option A', 'Option B', 'Option C', 'Option D']
|
|
},
|
|
answerData: {
|
|
type: 'multiple_choice',
|
|
correctAnswer: 0
|
|
},
|
|
explanation: 'Dies ist eine Beispiel-Übung. Bitte füge sprachspezifische Inhalte hinzu.'
|
|
}
|
|
];
|
|
}
|
|
|
|
async function createBisayaCourseContent() {
|
|
await sequelize.authenticate();
|
|
console.log('Datenbankverbindung erfolgreich hergestellt.\n');
|
|
|
|
const systemUser = await findOrCreateSystemUser();
|
|
console.log(`Verwende System-Benutzer: ${systemUser.username} (ID: ${systemUser.id})\n`);
|
|
|
|
// Finde alle Bisaya-Kurse
|
|
const [bisayaLanguage] = await sequelize.query(
|
|
`SELECT id FROM community.vocab_language WHERE name = 'Bisaya' LIMIT 1`,
|
|
{
|
|
type: sequelize.QueryTypes.SELECT
|
|
}
|
|
);
|
|
|
|
if (!bisayaLanguage) {
|
|
console.error('❌ Bisaya-Sprache nicht gefunden.');
|
|
return;
|
|
}
|
|
|
|
const courses = await sequelize.query(
|
|
`SELECT id, title FROM community.vocab_course WHERE language_id = :languageId`,
|
|
{
|
|
replacements: { languageId: bisayaLanguage.id },
|
|
type: sequelize.QueryTypes.SELECT
|
|
}
|
|
);
|
|
|
|
console.log(`Gefunden: ${courses.length} Bisaya-Kurse\n`);
|
|
|
|
let totalExercisesAdded = 0;
|
|
let totalLessonsProcessed = 0;
|
|
|
|
for (const course of courses) {
|
|
console.log(`📚 Kurs: ${course.title} (ID: ${course.id})`);
|
|
|
|
const lessons = await VocabCourseLesson.findAll({
|
|
where: { courseId: course.id },
|
|
order: [['lessonNumber', 'ASC']]
|
|
});
|
|
|
|
console.log(` ${lessons.length} Lektionen gefunden\n`);
|
|
|
|
for (const lesson of lessons) {
|
|
// Prüfe, ob bereits Übungen existieren
|
|
const existingCount = await VocabGrammarExercise.count({
|
|
where: { lessonId: lesson.id }
|
|
});
|
|
|
|
if (existingCount > 0) {
|
|
console.log(` ⏭️ Lektion ${lesson.lessonNumber}: "${lesson.title}" - bereits ${existingCount} Übung(en) vorhanden`);
|
|
continue;
|
|
}
|
|
|
|
// Hole Übungen für diese Lektion
|
|
const exercises = getExercisesForLesson(lesson.title);
|
|
|
|
if (exercises.length === 0) {
|
|
console.log(` ⚠️ Lektion ${lesson.lessonNumber}: "${lesson.title}" - keine Übungen definiert`);
|
|
continue;
|
|
}
|
|
|
|
// Erstelle Übungen
|
|
let exerciseNumber = 1;
|
|
for (const exerciseData of exercises) {
|
|
await VocabGrammarExercise.create({
|
|
lessonId: lesson.id,
|
|
exerciseTypeId: exerciseData.exerciseTypeId,
|
|
exerciseNumber: exerciseNumber++,
|
|
title: exerciseData.title,
|
|
instruction: exerciseData.instruction,
|
|
questionData: JSON.stringify(exerciseData.questionData),
|
|
answerData: JSON.stringify(exerciseData.answerData),
|
|
explanation: exerciseData.explanation,
|
|
createdByUserId: course.ownerUserId || systemUser.id
|
|
});
|
|
totalExercisesAdded++;
|
|
}
|
|
|
|
console.log(` ✅ Lektion ${lesson.lessonNumber}: "${lesson.title}" - ${exercises.length} Übung(en) erstellt`);
|
|
totalLessonsProcessed++;
|
|
}
|
|
|
|
console.log('');
|
|
}
|
|
|
|
console.log(`\n🎉 Zusammenfassung:`);
|
|
console.log(` ${totalLessonsProcessed} Lektionen bearbeitet`);
|
|
console.log(` ${totalExercisesAdded} Grammatik-Übungen erstellt`);
|
|
}
|
|
|
|
createBisayaCourseContent()
|
|
.then(() => {
|
|
sequelize.close();
|
|
process.exit(0);
|
|
})
|
|
.catch((error) => {
|
|
console.error('❌ Fehler:', error);
|
|
sequelize.close();
|
|
process.exit(1);
|
|
});
|