fix(platform): grade-gate student app, isolate per-video resume & checkpoints, remove fake teachers, enhance arabic lab, clean flutter analyze

This commit is contained in:
Hamza-Ayed
2026-09-04 23:41:32 +03:00
parent ae00aa943e
commit e7bc20bc98
22 changed files with 291 additions and 316 deletions
@@ -224,20 +224,36 @@ class CurriculumLessonItemModel {
}
final filePath = json['file']?.toString();
// Default video availability: true for core Grade 10 subjects (Math, Physics, English) and explicitly tagged lessons
final bool isCoreTenthSubjectLesson = filePath != null && (
filePath.contains('math_10/semester_1') ||
filePath.contains('physics_10/semester_1') ||
filePath.contains('english_10/semester_1') ||
filePath.contains('lesson_01') ||
filePath.contains('lesson_1a')
final jsonId = json['id']?.toString();
// Stable, deterministic lesson ID (vital for persistent per-lesson progress tracking)
final stableId = (jsonId != null && jsonId.isNotEmpty)
? jsonId
: (filePath != null && filePath.isNotEmpty
? filePath.replaceAll(RegExp(r'[^a-zA-Z0-9_]'), '_')
: 'lesson_${(json['title']?.toString() ?? 'default').hashCode.abs()}');
// Video availability:
// 1. Explicitly false for introductory/project overviews
// 2. Physics & other subjects currently have no video -> false
// 3. Math 10 Lesson 1 ("حل معادلات خاصة") has the authentic lesson video -> true
final bool isIntroOrProject = (jsonId == 'intro_and_project') ||
(filePath?.contains('intro_and_project') ?? false) ||
((json['title']?.toString() ?? '').contains('مقدمة ومشروع'));
final bool isMath10Lesson1 = !isIntroOrProject && (
(filePath != null && filePath.contains('math_10/semester_1/unit_01/lesson_01')) ||
((json['title']?.toString() ?? '').contains('معادلاتٍ خاصّةٍ'))
);
final bool hasVideoExplicit = (json['has_video'] as bool?) ??
((json['video_url'] != null && json['video_url'].toString().isNotEmpty) || isCoreTenthSubjectLesson);
final bool hasVideoExplicit = !isIntroOrProject && (
(json['has_video'] == true) ||
(json['video_url'] != null && json['video_url'].toString().isNotEmpty) ||
isMath10Lesson1
);
return CurriculumLessonItemModel(
id: json['id']?.toString() ?? 'lesson_${DateTime.now().millisecondsSinceEpoch}',
id: stableId,
title: json['title']?.toString() ?? 'درس بدون عنوان',
outcomes: outs,
markdownFilePath: filePath,