refactor(bisaya-course): enhance pedagogy logic for German lessons
All checks were successful
Deploy to production / deploy (push) Successful in 2m57s

- Updated the `getGermanForBisayaLessonPedagogy` function to include lesson titles for improved didactic mode determination, specifically adding support for 'contrast_training'.
- Modified multiple scripts to utilize the updated pedagogy function, ensuring consistent application of the new logic across various course phases.
- Enhanced the VocabService to recognize and handle 'contrast_training' as a didactic mode, improving lesson management and user experience.
- Updated UI components to reflect the new didactic mode, ensuring clarity in lesson presentation.
This commit is contained in:
Torsten Schulz (local)
2026-04-01 15:52:53 +02:00
parent 10fc78e81d
commit 3ff8e4fc40
8 changed files with 63 additions and 8 deletions

View File

@@ -106,7 +106,7 @@ async function createGermanForBisayaCourse(ownerHashedId) {
for (const lessonData of ALL_GERMAN_FOR_BISAYA_LESSONS) {
const didactics = ALL_GERMAN_FOR_BISAYA_DIDACTICS[lessonData.title] || {};
const pedagogy = getGermanForBisayaLessonPedagogy(lessonData.num, lessonData.type);
const pedagogy = getGermanForBisayaLessonPedagogy(lessonData.num, lessonData.type, lessonData.title);
await VocabCourseLesson.create({
courseId: course.id,

View File

@@ -37,7 +37,7 @@ async function extendGermanForBisayaPhase3() {
if (existing) continue;
const didactics = GERMAN_FOR_BISAYA_PHASE3_DIDACTICS[lessonData.title] || {};
const pedagogy = getGermanForBisayaLessonPedagogy(lessonData.num, lessonData.type);
const pedagogy = getGermanForBisayaLessonPedagogy(lessonData.num, lessonData.type, lessonData.title);
await VocabCourseLesson.create({
courseId: course.id,

View File

@@ -37,7 +37,7 @@ async function extendGermanForBisayaPhase4() {
if (existing) continue;
const didactics = GERMAN_FOR_BISAYA_PHASE4_DIDACTICS[lessonData.title] || {};
const pedagogy = getGermanForBisayaLessonPedagogy(lessonData.num, lessonData.type);
const pedagogy = getGermanForBisayaLessonPedagogy(lessonData.num, lessonData.type, lessonData.title);
await VocabCourseLesson.create({
courseId: course.id,

View File

@@ -37,7 +37,7 @@ async function extendGermanForBisayaPhase5() {
if (existing) continue;
const didactics = GERMAN_FOR_BISAYA_PHASE5_DIDACTICS[lessonData.title] || {};
const pedagogy = getGermanForBisayaLessonPedagogy(lessonData.num, lessonData.type);
const pedagogy = getGermanForBisayaLessonPedagogy(lessonData.num, lessonData.type, lessonData.title);
await VocabCourseLesson.create({
courseId: course.id,

View File

@@ -1,14 +1,37 @@
export function getGermanForBisayaLessonPedagogy(lessonNumber, lessonType) {
function isContrastTrainingLesson(lessonType, lessonTitle = '') {
const normalizedType = String(lessonType || '').toLowerCase();
if (normalizedType !== 'grammar') {
return false;
}
const title = String(lessonTitle || '').toLowerCase();
return [
'kontrast',
'fehlertraining',
' / ',
'nicht / kein',
'der / die / das',
'wo / wohin',
'du / sie',
'haben / sein',
'ich bin / ich habe',
'ich bin / ich heiße / ich komme'
].some((marker) => title.includes(marker));
}
export function getGermanForBisayaLessonPedagogy(lessonNumber, lessonType, lessonTitle = '') {
const phaseLabel = lessonNumber <= 60 ? 'quickstart' : lessonNumber <= 120 ? 'daily_life' : 'stabilization';
const blockNumber = Math.ceil(lessonNumber / 10);
let didacticMode = 'core_input';
if (lessonType === 'conversation') didacticMode = 'guided_dialogue';
if (lessonType === 'grammar') didacticMode = 'pattern_drill';
if (isContrastTrainingLesson(lessonType, lessonTitle)) didacticMode = 'contrast_training';
if (lessonType === 'review') didacticMode = 'intensive_review';
if (lessonType === 'culture') didacticMode = 'real_life_scenario';
const difficultyWeight =
didacticMode === 'contrast_training' ? 3 :
lessonType === 'grammar' ? 3 :
lessonType === 'review' ? 2 :
lessonType === 'conversation' ? 2 :
@@ -16,6 +39,7 @@ export function getGermanForBisayaLessonPedagogy(lessonNumber, lessonType) {
const newUnitTarget =
lessonType === 'review' ? 2 :
didacticMode === 'contrast_training' ? 3 :
lessonType === 'grammar' ? 4 :
phaseLabel === 'quickstart' ? 6 :
phaseLabel === 'daily_life' ? 5 :
@@ -23,6 +47,7 @@ export function getGermanForBisayaLessonPedagogy(lessonNumber, lessonType) {
const reviewWeight =
lessonType === 'review' ? 90 :
didacticMode === 'contrast_training' ? 70 :
lessonType === 'grammar' ? 60 :
lessonType === 'vocab' ? 55 :
lessonType === 'culture' ? 20 :

View File

@@ -620,11 +620,32 @@ export default class VocabService {
}
_inferLessonDidacticMode(plainLesson) {
if (plainLesson.didacticMode) {
return plainLesson.didacticMode;
}
const lessonType = String(plainLesson.lessonType || '').toLowerCase();
const title = String(plainLesson.title || '').toLowerCase();
const storedMode = String(plainLesson.didacticMode || '').trim();
const isContrastTraining = lessonType === 'grammar' && [
'kontrast',
'fehlertraining',
' / ',
'nicht / kein',
'der / die / das',
'wo / wohin',
'du / sie',
'haben / sein',
'ich bin / ich habe',
'ich bin / ich heiße / ich komme'
].some((marker) => title.includes(marker));
if (storedMode && storedMode !== 'pattern_drill') {
return storedMode;
}
if (isContrastTraining) {
return 'contrast_training';
}
if (storedMode) {
return storedMode;
}
if (title.includes('abschluss') || title.includes('prüfung') || title.includes('test')) {
return 'checkpoint';
}
@@ -648,6 +669,7 @@ export default class VocabService {
return plainLesson.difficultyWeight;
}
switch (didacticMode) {
case 'contrast_training':
case 'pattern_drill':
return 3;
case 'guided_dialogue':
@@ -666,6 +688,8 @@ export default class VocabService {
return plainLesson.newUnitTarget;
}
switch (didacticMode) {
case 'contrast_training':
return 3;
case 'core_input':
return 8;
case 'guided_dialogue':
@@ -692,6 +716,8 @@ export default class VocabService {
return 90;
case 'checkpoint':
return 70;
case 'contrast_training':
return 70;
case 'pattern_drill':
return 55;
case 'real_life_scenario':