feat(bisaya-course): enhance lesson structure and didactics integration
All checks were successful
Deploy to production / deploy (push) Successful in 2m52s
All checks were successful
Deploy to production / deploy (push) Successful in 2m52s
- Added an auto-incrementing primary key to the UserHouse model for improved database management. - Integrated new didactics fragments from the Bisaya course plan, including relationship anchor didactics and lessons for enhanced curriculum depth. - Updated lesson retrieval logic to utilize planned lesson titles, improving the accuracy of didactics resolution. - Refactored course content generation scripts to incorporate new didactics, ensuring a comprehensive learning experience for users.
This commit is contained in:
@@ -13,6 +13,11 @@ import VocabCourseProgress from '../models/community/vocab_course_progress.js';
|
||||
import VocabGrammarExerciseProgress from '../models/community/vocab_grammar_exercise_progress.js';
|
||||
import { Op } from 'sequelize';
|
||||
import { getBisayaLessonPedagogy } from './bisaya-course-phase2-pedagogy.js';
|
||||
import {
|
||||
BISAYA_DIDACTICS_24_43,
|
||||
BISAYA_LESSONS_24_43_BY_NUMBER,
|
||||
BISAYA_RELATIONSHIP_ANCHOR_DIDACTICS
|
||||
} from './bisaya-course-plan-24-43.js';
|
||||
|
||||
const LESSON_DIDACTICS = {
|
||||
'Begrüßungen & Höflichkeit': {
|
||||
@@ -368,9 +373,19 @@ const LESSON_DIDACTICS = {
|
||||
'Von einzelnen Wörtern zu kurzen Sätzen übergehen.'
|
||||
],
|
||||
corePatterns: ['Kumusta', 'Salamat', 'Lami', 'Mingaw ko nimo']
|
||||
}
|
||||
},
|
||||
...BISAYA_RELATIONSHIP_ANCHOR_DIDACTICS,
|
||||
...BISAYA_DIDACTICS_24_43
|
||||
};
|
||||
|
||||
function resolveDidacticsForLesson(lesson) {
|
||||
const direct = LESSON_DIDACTICS[lesson.title];
|
||||
if (direct) return direct;
|
||||
const plannedTitle = BISAYA_LESSONS_24_43_BY_NUMBER[Number(lesson.lessonNumber)]?.title;
|
||||
if (plannedTitle && LESSON_DIDACTICS[plannedTitle]) return LESSON_DIDACTICS[plannedTitle];
|
||||
return null;
|
||||
}
|
||||
|
||||
async function resetBisayaProgress(courseIds) {
|
||||
if (courseIds.length === 0) return { lessonProgress: 0, exerciseProgress: 0 };
|
||||
|
||||
@@ -443,12 +458,24 @@ async function applyBisayaCourseRefresh() {
|
||||
});
|
||||
|
||||
for (const lesson of lessons) {
|
||||
const didactics = LESSON_DIDACTICS[lesson.title];
|
||||
const didactics = resolveDidacticsForLesson(lesson);
|
||||
const plannedLesson = BISAYA_LESSONS_24_43_BY_NUMBER[Number(lesson.lessonNumber)];
|
||||
const pedagogy = getBisayaLessonPedagogy(lesson.lessonNumber);
|
||||
if (!didactics && !pedagogy) continue;
|
||||
const normalizedDidactics = didactics || {};
|
||||
|
||||
await lesson.update({
|
||||
...(plannedLesson ? {
|
||||
title: plannedLesson.title,
|
||||
description: plannedLesson.desc,
|
||||
weekNumber: plannedLesson.week,
|
||||
dayNumber: plannedLesson.day,
|
||||
lessonType: plannedLesson.type,
|
||||
culturalNotes: plannedLesson.cultural,
|
||||
targetMinutes: plannedLesson.targetMin,
|
||||
targetScorePercent: plannedLesson.targetScore,
|
||||
requiresReview: plannedLesson.review
|
||||
} : {}),
|
||||
learningGoals: normalizedDidactics.learningGoals || [],
|
||||
corePatterns: normalizedDidactics.corePatterns || [],
|
||||
grammarFocus: normalizedDidactics.grammarFocus || [],
|
||||
|
||||
Reference in New Issue
Block a user