require_once FS_PHP . '/footer-external.php'; } elseif ($_GET['page'] === "confirm-participation") { if (!isset($_POST['eid'])) { $loggers['audit']->error('Attempted to confirm exam participation at Access Service without NOE ID.'); header('Location: exam-requests.php'); die; } $count_pending_follow_ups = $dashboard->fetchCountPendingFollowUps($SESSION->student_num); $exam_still_awaiting_response = $model->verifyExamAwaitingResponse($SESSION->student_num, $_POST['eid']); if (!empty($exam_still_awaiting_response)) { $extra_time_allowed = null; $all_active_exam_accommodations = array(); //We must also check to see if the student has opted out $opted_out = \Ventus\Utilities\Functions::checkIfStudentHasOptedOut($SESSION->student_num, $exam_still_awaiting_response['course_code'], $exam_still_awaiting_response['course_section'], $exam_still_awaiting_response['session']); if (!$opted_out) { $all_active_exam_accommodations = $profile->fetchAllStudentActiveExamAndTranscriptionAccommodations($SESSION->student_num, $exam_still_awaiting_response['exam_date'], $exam_still_awaiting_response['course_code'], $exam_still_awaiting_response['course_section'], $exam_still_awaiting_response['session']); //Check all the possible allowed accommodations to see if the student has extra time foreach ($all_active_exam_accommodations as $a) { if ($a['type'] === "Extra time") { $extra_time_allowed = explode(" ", $a['name_en']); //Get the last bit of the name of the acc. resulting in the percentage value } } } $l10n->addResource(__DIR__ . '/l10n/header.json'); $l10n->addResource(__DIR__ . '/l10n/exam-confirm-participation.json'); $l10n->localizeArray($all_active_exam_accommodations, 'name'); require_once FS_PHP . '/header-external.php'; require_once 'views/exam-confirm-participation.php'; require_once FS_PHP . '/footer-external.php'; } else {
/** * Retrieves the exam/transcription accommodations for which a student has at the time of the exam * @param int $exam_request_id The request ID of the exam * @return array */ public function fetchAvailableAccommodations($exam_request_id) { global $SESSION; if (!ctype_digit($exam_request_id) && !is_int($exam_request_id)) { throw new \InvalidArgumentException('Invalid exam request ID'); } $sql = "SELECT e.official_evaluation_starttime, p.session, p.course_code, p.course_section\n FROM ventus_exam_requests AS e\n LEFT JOIN ventus_professor_exam_requests AS p\n ON e.professor_exam_request_id = p.exam_request_id\n WHERE e.request_id = :request_id\n AND p.deleted = 0;"; $result = $this->db->query($sql, array('request_id' => $exam_request_id))->fetch(); $profile = new StudentProfile($this->db); return $profile->fetchAllStudentActiveExamAndTranscriptionAccommodations($SESSION->student_num, $result['official_evaluation_starttime'], $result['course_code'], $result['course_section'], $result['session']); }