Update Saqel Platform: 2026-09-08 13:43:36

This commit is contained in:
Hamza-Ayed
2026-09-08 13:43:36 +03:00
parent 0f424062fe
commit bb37b31cab
76 changed files with 3617 additions and 3059 deletions
@@ -8,7 +8,7 @@ import '../../data/repositories/teacher_repository.dart';
* ==============================================================================
*
* إدارة الواجبات المدرسية وغرفة استفسارات الطلبة والبث الفوري عبر الويب سوكت:
* - محادثات حية ومباشرة مع الطلبة المسجلين (مثل سما حمزة)
* - محادثات حية ومباشرة مع الطلبة المسجلين
* - تسجيل وإرسال الردود الصوتية السقراطية (Socratic Voice Replies 🎙️)
* - بث مقاطع صوتية توجيهية لكافة طلبة الشعبة عبر الويب سوكت (0ms Broadcast).
*/
@@ -75,37 +75,26 @@ class TeacherQnACubit extends Cubit<TeacherQnAState> {
required String className,
required String dueDate,
}) {
final newHw = TeacherHomeworkModel(
id: 'hw-${DateTime.now().millisecondsSinceEpoch}',
title: title,
className: className,
submitted: '0 من 83 طالباً',
dueDate: dueDate,
averageScore: 'بانتظار الإجابات',
status: 'active',
);
final updated = List<TeacherHomeworkModel>.from(state.homeworks)..insert(0, newHw);
emit(state.copyWith(homeworks: updated));
throw StateError('إنشاء الواجبات ينتظر واجهة حفظ حقيقية على الخادم.');
}
Future<void> sendVoiceReply(String doubtId, {String? voiceText}) async {
final updated = state.doubts.map((doubt) {
if (doubt.id == doubtId) {
return doubt.copyWith(replied: true, voiceReply: true);
}
return doubt;
}).toList();
emit(state.copyWith(doubts: updated));
// Also send actual message to student via API
final targetIndex = state.doubts.indexWhere((doubt) => doubt.id == doubtId);
if (targetIndex < 0 || state.doubts[targetIndex].studentId <= 0) {
throw StateError('لا يوجد طالب حقيقي مرتبط بهذا الاستفسار.');
}
final target = state.doubts[targetIndex];
final replyText = voiceText?.trim() ?? '';
if (replyText.isEmpty) {
throw StateError('لا يمكن تسجيل رد صوتي دون ملف صوت حقيقي؛ أرسل رداً نصياً حالياً.');
}
await repository.sendMessage(
receiverId: 2, // Sama Hamza (Real Student)
message: voiceText ?? 'رد صوتي سقراطي: تم تسجيل وتوجيه المفاهيم المتعلقة بالسؤال.',
messageType: 'voice',
mediaUrl: 'https://saqel.intaleqapp.com/assets/audio/voice_reply_socratic.mp3',
receiverId: target.studentId,
message: replyText,
messageType: 'text',
);
final updated = state.doubts.map((doubt) => doubt.id == doubtId ? doubt.copyWith(replied: true, voiceReply: false) : doubt).toList();
emit(state.copyWith(doubts: updated));
}
Future<bool> broadcastAudioAnnouncement({