SEARCH RESULTS FOR 'proctor':
Line 20: use App\Models\ExamScheduleProctorModel;
Line 38: protected $scheduleProctorModel;
Line 56: $this->scheduleProctorModel = new ExamScheduleProctorModel();
Line 125: 'proctor_rules'      => 'permit_empty',
Line 147: 'proctor_rules'      => $this->request->getPost('proctor_rules'),
Line 204: 'proctor_rules'      => 'permit_empty',
Line 224: 'proctor_rules'      => $this->request->getPost('proctor_rules'),
Line 1839: public function printProctorRules($eventId)
Line 1849: $event['proctor_rules'] = !empty($event['proctor_rules']) ? $event['proctor_rules'] : ($schoolSettings['proctor_rules'] ?? '');
Line 1858: return view('exam_event/print/proctor_rules', $data);
Line 1937: // 5. MANAJEMEN PENGAWAS (PROCTORS)
Line 1939: public function proctor($eventId)
Line 1962: // Get current proctor assignments
Line 1963: $assignments = $this->scheduleProctorModel->getEventAssignmentsGrouped($eventId);
Line 1983: return view('exam_event/proctor', $data);
Line 1986: public function saveProctorSettings($eventId)
Line 1994: // Save proctors per room setting
Line 1995: $proctorsPerRoom = (int)$this->request->getPost('proctors_per_room');
Line 1996: if (!in_array($proctorsPerRoom, [1, 2])) {
Line 1997: $proctorsPerRoom = 1;
Line 1999: $this->eventModel->update($eventId, ['proctors_per_room' => $proctorsPerRoom]);
Line 2026: return redirect()->to("/exam-event/{$eventId}/proctor")->with('success', 'Pengaturan peran guru berhasil disimpan!');
Line 2029: public function generateProctors($eventId)
Line 2037: $proctorsPerRoom = $event['proctors_per_room'];
Line 2052: $assignedProctors = $this->eventTeacherModel
Line 2060: if (empty($assignedProctors)) {
Line 2065: $proctorDayCounts = [];
Line 2066: $proctorSessionCounts = [];
Line 2067: foreach ($assignedProctors as $p) {
Line 2068: $proctorDayCounts[$p['id']] = 0;
Line 2069: $proctorSessionCounts[$p['id']] = 0;
Line 2080: $this->scheduleProctorModel->where('exam_event_id', $eventId)->delete();
Line 2084: // Randomization & assignment logic (assigning proctors per room for the entire day)
Line 2105: // Assign Proctor 1
Line 2107: foreach ($assignedProctors as $ap) {
Line 2110: if ($maxDays > 0 && $proctorDayCounts[$ap['id']] >= $maxDays) {
Line 2120: usort($candidates1, function($a, $b) use ($proctorDayCounts, $proctorSessionCounts) {
Line 2121: $dayA = $proctorDayCounts[$a['id']];
Line 2122: $dayB = $proctorDayCounts[$b['id']];
Line 2126: $sessA = $proctorSessionCounts[$a['id']];
Line 2127: $sessB = $proctorSessionCounts[$b['id']];
Line 2134: $proctorDayCounts[$chosen1['id']]++;
Line 2135: $proctorSessionCounts[$chosen1['id']] += count($validSubjects);
Line 2138: // Assign Proctor 2 (if 2 proctors setting is active)
Line 2139: if ($proctorsPerRoom == 2) {
Line 2141: foreach ($assignedProctors as $ap) {
Line 2144: if ($maxDays > 0 && $proctorDayCounts[$ap['id']] >= $maxDays) {
Line 2154: usort($candidates2, function($a, $b) use ($proctorDayCounts, $proctorSessionCounts) {
Line 2155: $dayA = $proctorDayCounts[$a['id']];
Line 2156: $dayB = $proctorDayCounts[$b['id']];
Line 2160: $sessA = $proctorSessionCounts[$a['id']];
Line 2161: $sessB = $proctorSessionCounts[$b['id']];
Line 2168: $proctorDayCounts[$chosen2['id']]++;
Line 2169: $proctorSessionCounts[$chosen2['id']] += count($validSubjects);
Line 2188: $this->scheduleProctorModel->insertBatch($assignmentsToInsert);
Line 2191: return redirect()->to("/exam-event/{$eventId}/proctor/matrix")->with('success', 'Jadwal pengawas berhasil diacak secara otomatis!');
Line 2194: public function proctorMatrix($eventId)
Line 2217: // Get current proctor assignments
Line 2218: $assignments = $this->scheduleProctorModel->getEventAssignmentsGrouped($eventId);
Line 2230: if ($role === 'tidak_bertugas') continue; // only show active proctors/committee
Line 2242: $rawAssignments = $this->scheduleProctorModel->where('exam_event_id', $eventId)->findAll();
Line 2283: return view('exam_event/proctor_matrix', $data);
Line 2286: public function clearProctors($eventId)
Line 2294: $this->scheduleProctorModel->where('exam_event_id', $eventId)->delete();
Line 2296: return redirect()->to("/exam-event/{$eventId}/proctor")->with('success', 'Jadwal pengawas berhasil dibersihkan!');
Line 2299: public function printProctorSchedule($eventId)
Line 2327: // Get current proctor assignments
Line 2328: $assignments = $this->scheduleProctorModel->getEventAssignmentsGrouped($eventId);
Line 2341: foreach ($roomMap as $roomId => $proctors) {
Line 2342: if (!empty($proctors['teacher_id_1'])) {
Line 2343: $assignedTeacherIds[] = $proctors['teacher_id_1'];
Line 2345: if (!empty($proctors['teacher_id_2'])) {
Line 2346: $assignedTeacherIds[] = $proctors['teacher_id_2'];
Line 2383: return view('exam_event/print/proctor_schedule', $data);
Line 2386: public function printProctorAttendance($eventId)
Line 2414: // Get current proctor assignments
Line 2415: $assignments = $this->scheduleProctorModel->getEventAssignmentsGrouped($eventId);
Line 2435: $sessionProctors = [];
Line 2450: $sessionProctors[] = [
Line 2455: if ($event['proctors_per_room'] == 2) {
Line 2456: $sessionProctors[] = [
Line 2463: // Chunk proctors into pages so first page accommodates Kop, and subsequent pages don't repeat Kop.
Line 2465: $temp = $sessionProctors;
Line 2498: return view('exam_event/print/proctor_attendance', $data);
