Update Saqel Platform: 2026-09-08 18:19:28
This commit is contained in:
@@ -38,18 +38,28 @@ class TeacherLessonAuditModel {
|
||||
});
|
||||
|
||||
factory TeacherLessonAuditModel.fromJson(Map<String, dynamic> json) {
|
||||
final durationSeconds = (json['duration_seconds'] as num?)?.toDouble() ?? 0;
|
||||
final readiness = (json['pedagogical_readiness_score'] as num?)?.toInt();
|
||||
final visual = (json['visual_clarity_score'] as num?)?.toInt();
|
||||
final decisionValue = json['decision']?.toString() ?? 'pending';
|
||||
return TeacherLessonAuditModel(
|
||||
lessonTitle: json['lesson_title'] ?? '',
|
||||
subject: json['subject'] ?? 'الفيزياء',
|
||||
durationMinutes: (json['duration_minutes'] as num?)?.toDouble() ?? 22.5,
|
||||
durationGatePassed: json['duration_gate_passed'] ?? true,
|
||||
subject: json['subject'] ?? '',
|
||||
durationMinutes: (json['duration_minutes'] as num?)?.toDouble() ??
|
||||
durationSeconds / 60,
|
||||
durationGatePassed: json['duration_gate_passed'] ??
|
||||
(durationSeconds > 0 && durationSeconds <= 1500),
|
||||
durationWarning: json['duration_warning'],
|
||||
qualityScore: json['quality_score'] ?? 92,
|
||||
approvalStatus: json['approval_status'] ?? 'approved_for_broadcast',
|
||||
curriculumAlignment: json['curriculum_alignment'] ?? '96% تطابق مع مخرجات المنهاج الوزاري',
|
||||
audioClarity: json['audio_clarity'] ?? '95% نقاء صوتي ممتاز',
|
||||
socraticStopsCount: json['socratic_stops_count'] ?? 3,
|
||||
decision: json['decision'] ?? 'الحصة معتمدة ومؤهلة للبث المشفر والعرض للبيع خارج الثقافة العسكرية 🚀',
|
||||
qualityScore: (json['quality_score'] as num?)?.toInt() ?? readiness ?? 0,
|
||||
approvalStatus: json['approval_status'] ?? decisionValue,
|
||||
curriculumAlignment:
|
||||
json['curriculum_alignment'] ?? 'بانتظار تحليل الملف الفعلي',
|
||||
audioClarity: json['audio_clarity'] ??
|
||||
(visual == null
|
||||
? 'تم التحقق من وجود مسار صوت فعلي'
|
||||
: 'وضوح الصورة $visual%، وتم التحقق من وجود الصوت'),
|
||||
socraticStopsCount: (json['socratic_stops_count'] as num?)?.toInt() ?? 0,
|
||||
decision: json['report'] ?? json['reason'] ?? decisionValue,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -176,10 +186,11 @@ class TeacherProfileModel {
|
||||
factory TeacherProfileModel.fromJson(Map<String, dynamic> json) {
|
||||
final user = json['user'] as Map<String, dynamic>? ?? {};
|
||||
final profile = json['profile'] as Map<String, dynamic>? ?? {};
|
||||
|
||||
|
||||
List<String> grades = [];
|
||||
if (profile['grades_taught'] is List) {
|
||||
grades = (profile['grades_taught'] as List).map((e) => e.toString()).toList();
|
||||
grades =
|
||||
(profile['grades_taught'] as List).map((e) => e.toString()).toList();
|
||||
} else if (profile['grades_taught'] is String) {
|
||||
grades = [profile['grades_taught'].toString()];
|
||||
}
|
||||
@@ -191,7 +202,8 @@ class TeacherProfileModel {
|
||||
id: user['id'] is int ? user['id'] : 1,
|
||||
uuid: user['uuid']?.toString() ?? '',
|
||||
name: user['full_name']?.toString() ?? 'حساب معلم غير مكتمل',
|
||||
specialization: profile['specialization']?.toString() ?? 'بانتظار استكمال التخصص',
|
||||
specialization:
|
||||
profile['specialization']?.toString() ?? 'بانتظار استكمال التخصص',
|
||||
schoolName: profile['school_name']?.toString() ?? '',
|
||||
gradesTaught: grades,
|
||||
bio: profile['bio']?.toString() ?? '',
|
||||
@@ -248,7 +260,9 @@ class ChatConversationModel {
|
||||
|
||||
factory ChatConversationModel.fromJson(Map<String, dynamic> json) {
|
||||
return ChatConversationModel(
|
||||
userId: json['user_id'] is int ? json['user_id'] : int.tryParse(json['user_id']?.toString() ?? '0') ?? 0,
|
||||
userId: json['user_id'] is int
|
||||
? json['user_id']
|
||||
: int.tryParse(json['user_id']?.toString() ?? '0') ?? 0,
|
||||
userUuid: json['user_uuid']?.toString() ?? '',
|
||||
fullName: json['full_name']?.toString() ?? 'طالب صَقِل',
|
||||
role: json['role']?.toString() ?? 'student',
|
||||
@@ -288,11 +302,17 @@ class ChatMessageModel {
|
||||
|
||||
factory ChatMessageModel.fromJson(Map<String, dynamic> json) {
|
||||
return ChatMessageModel(
|
||||
id: json['id'] is int ? json['id'] : int.tryParse(json['id']?.toString() ?? '0') ?? 0,
|
||||
id: json['id'] is int
|
||||
? json['id']
|
||||
: int.tryParse(json['id']?.toString() ?? '0') ?? 0,
|
||||
uuid: json['uuid']?.toString() ?? '',
|
||||
isMine: json['is_mine'] ?? false,
|
||||
senderId: json['sender_id'] is int ? json['sender_id'] : int.tryParse(json['sender_id']?.toString() ?? '0') ?? 0,
|
||||
receiverId: json['receiver_id'] is int ? json['receiver_id'] : int.tryParse(json['receiver_id']?.toString() ?? '0') ?? 0,
|
||||
senderId: json['sender_id'] is int
|
||||
? json['sender_id']
|
||||
: int.tryParse(json['sender_id']?.toString() ?? '0') ?? 0,
|
||||
receiverId: json['receiver_id'] is int
|
||||
? json['receiver_id']
|
||||
: int.tryParse(json['receiver_id']?.toString() ?? '0') ?? 0,
|
||||
message: json['message']?.toString() ?? '',
|
||||
messageType: json['message_type']?.toString() ?? 'text',
|
||||
mediaUrl: json['media_url']?.toString(),
|
||||
|
||||
Reference in New Issue
Block a user