Ejemplo n.º 1
0
    $confirmed_requests = new \Ventus\Exams\Requests($dbo);
    $exam_details = $confirmed_requests->getExamRequestById($_POST['eid']);
    $confirmed_requests->examCancelledOther($exam_details[0]);
    header('location:exam-requests.php');
    die;
} elseif ($_GET['page'] === "withdraw-in-class") {
    $model->withdrawInClassParticipation($_POST['eid'], $SESSION->student_num);
    $loggers['audit']->info("Withdrew in-class participation for exam {$_POST['eid']}.");
    header('location:exam-requests.php');
    die;
} elseif ($_GET['page'] === "add-exam-request") {
    $applicable_files = $examFiles->fetchFilesForAllStudents($_POST['professor_exam_request_id']);
    $requests->confirmStudentParticipation($_POST, $SESSION->student_num);
    $loggers['audit']->info("Confirmed participation for NOE {$_POST['professor_exam_request_id']}.");
    foreach ($applicable_files as $file) {
        $examFiles->addStudentsToFile($file, array($SESSION->student_num));
    }
    echo $model->checkForExamConflict($SESSION->student_num, $_POST);
} elseif ($_GET['page'] === 'exam-accommodations') {
    $count_pending_follow_ups = $dashboard->fetchCountPendingFollowUps($SESSION->student_num);
    $_GET['request_id'] = intval($_GET['request_id']);
    $confirmed_accommodations = $model->fetchConfirmedAccommodationNames($_GET['request_id']);
    $confirmed_accommodation_ids = $model->fetchConfirmedAccommodations($_GET['request_id']);
    $exam = $model->getExamRequest((int) $SESSION->student_num, $_GET['request_id']);
    if (!empty($exam)) {
        $all_active_exam_accommodations = $profile->fetchAllStudentActiveExamAndTranscriptionAccommodations($SESSION->student_num, $exam['official_evaluation_starttime'], $exam['course_code'], $exam['course_section'], $exam['session']);
        $examDate = \DateTime::createFromFormat(DATETIME_MYSQL, $exam['official_evaluation_starttime']);
        $today = new \DateTime();
        $modifiable = $examDate->diff($today)->days >= STUDENT_ALLOWED_TO_EDIT_ACCOMMODATIONS_DAYS_BEFORE_EXAM;
        $l10n->addResource(__DIR__ . '/l10n/header.json');
        $l10n->addResource(__DIR__ . '/l10n/exam-modify-accommodations.json');
Ejemplo n.º 2
0
        $l10n->addResource(__DIR__ . '/l10n/header.json');
        $l10n->addResource(__DIR__ . '/l10n/request-documents.json');
        require_once FS_PHP . '/header-external.php';
        require_once 'views/request-documents.php';
        require_once FS_PHP . '/footer-external.php';
    } else {
        header('Location: list-courses.php');
        exit;
    }
} elseif ($_GET['page'] === "add") {
    $_POST['request_id'] = $_POST['rid'];
    try {
        $file_id = $examFiles->addFile($_POST, $_FILES['exam_file'], $SESSION->id);
        $loggers['audit']->info("File added to NOE {$_POST['request_id']}");
        if (!empty($_POST['student-list'])) {
            $examFiles->addStudentsToFile($file_id, explode(';', $_POST['student-list']));
        }
        if ($_POST['receipt_notification']) {
            $model->sendDocumentReceiptNotification($_POST['request_id'], $file_id);
            $loggers['audit']->info("Document received notification sent to professor for NOE {$_POST['request_id']}");
        }
    } catch (\InvalidArgumentException $e) {
        $loggers['audit']->warning("Error occurred with exam file upload: " . $e->getMessage());
    }
    echo '<form action="request-documents.php' . (!empty($_GET['source']) ? '?source=' . $_GET['source'] : null) . '" method="POST" id="return-form">
              <input type="hidden" name="cid" value="' . $_POST['cid'] . '">
              <input type="hidden" name="rid" value="' . $_POST['rid'] . '">
          </form>
          <script>
              document.getElementById("return-form").submit();
          </script>';