예제 #1
0
    $noe_confirmed_dropped_students = $noes->fetchConfirmedDroppedStudents($_POST);
    foreach ($noe_confirmed_dropped_students as $ds) {
        $noe_students_array[] = array('student_num' => $ds['student_num'], 'last_name' => $ds['last_name'], 'first_name' => $ds['first_name'], 'email' => $ds['email'], 'startDate' => date("Y-m-d", strtotime($ds['startDate'])), 'endDate' => date("Y-m-d", strtotime($ds['endDate'])), 'status' => "droppedConfirmed:" . $ds['request_id']);
    }
    $noe_denied_dropped_students = $noes->fetchDeniedDroppedStudents($_POST);
    foreach ($noe_denied_dropped_students as $ds) {
        $date = date("Y-m-d", strtotime($ds['exam_date']));
        $noe_students_array[] = array('student_num' => $ds['student_num'], 'last_name' => $ds['last_name'], 'first_name' => $ds['first_name'], 'email' => $ds['email'], 'startDate' => $date, 'endDate' => $date, 'status' => "droppedDenied");
    }
    header('Content-Type: application/json; charset=utf-8');
    echo json_encode($noe_students_array);
    exit;
} elseif ($_GET['page'] === "add-file") {
    try {
        $file_id = $examFiles->addFile($_POST, $_FILES['exam_file'], $SESSION->user_id);
        $examFiles->addStudentsToFile($file_id, explode(';', $_POST['student_list']));
        $loggers['audit']->info("Document added to NOE {$_POST['request_id']}");
        //Trigger a notification to all professors in the course about the file receipt
        if (!empty($file_id)) {
            $faculty->sendDocumentReceiptNotification($_POST['request_id'], $file_id);
            $loggers['audit']->info("Document received notification sent for {$_POST['request_id']}");
        }
    } catch (\InvalidArgumentException $e) {
        $loggers['audit']->warning("Error occurred with exam file upload: " . $e->getMessage());
    }
    if (\Ventus\Utilities\Functions::checkIfStringIsDate($_GET['start']) && \Ventus\Utilities\Functions::checkIfStringIsDate($_GET['end']) && ctype_digit($_POST['request_id'])) {
        header("Location: notice-of-examination.php?start={$_GET['start']}&end={$_GET['end']}&mode={$_GET['mode']}&focus={$_POST['request_id']}");
    } else {
        header('Location: notice-of-examination.php');
    }
    die;
예제 #2
0
        foreach ($accommodations as $a) {
            if ($a['type'] === "Extra time") {
                $extra_time_allowed = explode(" ", $a['name']);
                //Get the last bit of the name of the acc. resulting in the percentage value
            }
        }
    }
    $l10n->addResource(__DIR__ . '/l10n/unconfirmed-request-details.json');
    $l10n->localizeArray($accommodations, 'name');
    $viewFile = 'views/unconfirmed-request-details.php';
} elseif ($_GET['page'] === 'add-exam-request') {
    $applicable_files = $examFiles->fetchFilesForAllStudents($_POST['professor_exam_request_id']);
    $confirmed_request_id = $model->confirmStudentParticipation($_POST, $_POST['student_num'], $SESSION->user_id);
    $loggers['audit']->info("Exam confirmed for student {$_POST['student_num']} for {$_POST['professor_exam_request_id']}");
    foreach ($applicable_files as $file) {
        $examFiles->addStudentsToFile($file, array($_POST['student_num']));
    }
    echo $confirmed_request_id;
} elseif ($_GET['page'] === "write-in-class") {
    $denied->confirmStudentParticipationInClass($_GET);
    $loggers['audit']->info("In-class participation confirmed for student {$_GET['student_num']} for {$_GET['professor_exam_request_id']}");
    if (ctype_digit($_GET['professor_exam_request_id']) && ctype_digit($_GET['student_num']) && \Ventus\Utilities\Functions::checkIfStringIsDate($_GET['exam_date'])) {
        header('Location: denied-requests.php?focus=' . $_GET['professor_exam_request_id'] . $_GET['student_num'] . '&start=' . $_GET['exam_date'] . '&end=' . $_GET['exam_date']);
    } else {
        header('Location: denied-requests.php');
    }
    die;
} elseif ($_GET['page'] === "export") {
    $l10n->addResource(FS_L10N . '/filenames.json');
    $l10n->addResource(__DIR__ . '/l10n/unconfirmed-requests.json');
    $requests = $model->getExamsAwaitingResponseForExport($_GET['start'], $_GET['end']);