Refactor lesson types and update review handling
All checks were successful
Deploy to production / deploy (push) Successful in 2m22s

- Changed lesson type from 'review' to 'weekly_review' in multiple lesson definitions across phase 3 and phase 4 extensions.
- Updated the logic in the vocabService to accommodate 'weekly_review' in various methods, ensuring proper handling of weekly review lessons.
- Modified the VocabLessonView component to recognize 'weekly_review' as a valid lesson type for calculations and access checks.
- Enhanced the didactics update script to include 'weekly_review' in the lesson type checks.
- Adjusted the create scripts to reflect the new lesson type for weekly reviews.
This commit is contained in:
Torsten Schulz (local)
2026-05-27 11:34:03 +02:00
parent 664a7b3530
commit d441b4fa31
9 changed files with 131 additions and 67 deletions

View File

@@ -41,6 +41,10 @@ export const LEGACY_DIDACTICS_TITLE_MAP = {
'Kulturelle Tipps & Tricks': 'Kultur: Höflichkeit, Familie, Alltag'
};
function isWeeklyReviewTitle(title) {
return /^Woche \d+ - (?:Wiederholung|Intensivwiederholung)(?:\s|$)/.test(String(title || '').trim());
}
export const LESSON_DIDACTICS = {
'Begrüßungen & Höflichkeit': {
learningGoals: [
@@ -535,9 +539,13 @@ async function updateBisayaDidactics() {
};
const didactics = resolveDidacticsForLesson(lessonLike);
const pedagogy = getBisayaLessonPedagogy(lessonLike.lessonNumber);
if (!didactics && !pedagogy) continue;
const weeklyReview = isWeeklyReviewTitle(row.title);
if (!didactics && !pedagogy && !weeklyReview) continue;
const patch = {};
if (weeklyReview) {
patch.lessonType = 'weekly_review';
}
if (didactics) {
patch.learningGoals = didactics.learningGoals || [];
patch.corePatterns = didactics.corePatterns || [];