Update Saqel Platform: 2026-09-13 16:31:17
This commit is contained in:
@@ -37,8 +37,18 @@ class SubjectModel {
|
||||
this.exams = const [],
|
||||
});
|
||||
|
||||
List<CurriculumUnitModel> get semester1Units => units.where((u) => u.semester == 'semester_1').toList();
|
||||
List<CurriculumUnitModel> get semester2Units => units.where((u) => u.semester == 'semester_2').toList();
|
||||
List<CurriculumUnitModel> unitsForSemester(String semesterKey) {
|
||||
final filtered = units.where((u) => u.semester == semesterKey).toList();
|
||||
return filtered.isNotEmpty ? filtered : units;
|
||||
}
|
||||
|
||||
factory SubjectModel.fromJson(String id, Map<String, dynamic> json) {
|
||||
final title = json['name']?.toString() ?? json['title']?.toString() ?? id;
|
||||
var title = json['name']?.toString() ?? json['title']?.toString() ?? id;
|
||||
if (id == 'history_10' || title.contains('تاريخ الأردن')) {
|
||||
title = 'التاريخ (History 10)';
|
||||
}
|
||||
final englishTitle = json['english_name']?.toString() ?? '';
|
||||
|
||||
// Parse units if available
|
||||
|
||||
Reference in New Issue
Block a user