Update Saqel Platform: 2026-09-04 02:57:19

This commit is contained in:
Hamza-Ayed
2026-09-04 02:57:19 +03:00
parent 1fe97bf3eb
commit 882541a56a
17 changed files with 4002 additions and 206 deletions
@@ -335,4 +335,118 @@ class DirectorateSupervisorController
'correlated_anomalies'=> 0
]);
}
/**
* توليد الامتحان الموحد بنموذجين متوازيين (نموذج أ ونموذج ب)
* GET /api/unified-exams/dual-forms
*/
public function generateDualForms(Request $request, Response $response): void
{
$subject = (string)$request->getQuery('subject', 'الفيزياء');
$gradeLevel = (string)$request->getQuery('grade_level', 'الأول ثانوي');
$forms = \App\Services\UnifiedExamService::generateDualForms($subject, $gradeLevel);
$response->json([
'status' => 'success',
'data' => $forms
]);
}
/**
* كشف الشذوذ الإحصائي ومكافحة الغش في جلسة الامتحان الموحد
* POST /api/unified-exams/evaluate-integrity
*/
public function evaluateExamSessionIntegrity(Request $request, Response $response): void
{
$body = $request->getBody();
$submissions = $body['submissions'] ?? [];
if (empty($submissions)) {
// Default sample submissions demonstrating all 3 statistical anomalies
$submissions = [
[
'student_id' => 101,
'student_name' => 'سيف الدين خالد الرواشدة',
'seat_number' => 'قاعة 1 — مقعد 04',
'time_spent_seconds' => 195, // < 300s
'score' => 95,
'historical_average' => 50.0,
'answers' => [
1 => ['selected_option' => 0, 'is_correct' => true],
2 => ['selected_option' => 0, 'is_correct' => true],
]
],
[
'student_id' => 102,
'student_name' => 'عمر أحمد الحباشنة',
'seat_number' => 'قاعة 1 — مقعد 05',
'time_spent_seconds' => 720,
'score' => 92,
'historical_average' => 42.0, // Historical leap
'answers' => [
1 => ['selected_option' => 2, 'is_correct' => false], // identical error
2 => ['selected_option' => 1, 'is_correct' => false],
]
],
[
'student_id' => 103,
'student_name' => 'فيصل محمود الخريشا',
'seat_number' => 'قاعة 1 — مقعد 06',
'time_spent_seconds' => 740,
'score' => 88,
'historical_average' => 84.0,
'answers' => [
1 => ['selected_option' => 2, 'is_correct' => false], // identical error
2 => ['selected_option' => 1, 'is_correct' => false],
]
]
];
}
$result = \App\Services\UnifiedExamService::evaluateExamSessionIntegrity($submissions);
$response->json([
'status' => 'success',
'data' => $result
]);
}
/**
* إرسال ومضات التقارير الشهرية لأولياء الأمور عبر الواتساب وبوابة نبيه
* POST /api/parent-reports/dispatch
*/
public function dispatchParentReports(Request $request, Response $response): void
{
$body = $request->getBody();
$studentId = !empty($body['student_id']) ? (int)$body['student_id'] : null;
$schoolId = !empty($body['school_id']) ? (int)$body['school_id'] : 1;
if ($studentId) {
$res = \App\Services\ParentReportService::dispatchReportToGuardian($studentId);
} else {
$res = \App\Services\ParentReportService::dispatchBatchReports($schoolId);
}
$response->json($res);
}
/**
* استيراد كشف المدرسة وتشفير الأرقام الوطنية (AES-256-GCM)
* POST /api/school-roster/import
*/
public function importSchoolRoster(Request $request, Response $response): void
{
$body = $request->getBody();
$schoolId = !empty($body['school_id']) ? (int)$body['school_id'] : 1;
$records = $body['records'] ?? [];
if (empty($records)) {
$records = \App\Services\SchoolRosterService::getSampleRosterData();
}
$result = \App\Services\SchoolRosterService::importStudentRoster($schoolId, $records);
$response->json($result);
}
}