Esempio n. 1
0
//============================================================================================
if (!isset($_GET['page'])) {
    $default_date_range = unserialize(EXAMS_AND_PROCTOR_DEFAULT_DATE_FILTER_RANGE);
    if (!empty($_GET['start']) && !empty($_GET['end'])) {
        $startDate = \DateTime::createFromFormat('Y-m-d', urldecode($_GET['start']));
        $endDate = \DateTime::createFromFormat('Y-m-d', urldecode($_GET['end']));
    }
    if (!$startDate) {
        $startDate = new \DateTime($default_date_range['start']);
    }
    if (!$endDate) {
        $endDate = new \DateTime($default_date_range['end']);
    }
    $startDate = $startDate->format('Y-m-d');
    $endDate = $endDate->format('Y-m-d');
    $notices = $model->fetchNOEs($SESSION->user_id, $startDate, $endDate);
    $count_exams_due_48_hours = 0;
    $count_exams_no_files = 0;
    $count_exams_no_control_sheet = 0;
    if (!empty($notices)) {
        $noe_teach_methods = unserialize(PROFESSOR_POSSIBLE_NOE_TEACH_METHODS);
        foreach ($notices as $c) {
            $students_confirmed_at_as = $model->fetchCountStudentsConfirmedAtAS($c['exam_request_id'], $c['course_code'], $c['course_section'], $c['session']);
            //If the user has asked for rows that only has AS students, then there should be more than zero AS students for the NOE
            //Or the user wants to regular unfiltered view
            if (empty($_GET['mode']) || $_GET['mode'] === "as_only" && $students_confirmed_at_as > 0) {
                $quick_stat_1_changed = false;
                $quick_stat_2_changed = false;
                $quick_stat_3_changed = false;
                //If requests do exist, get each of these requests
                if (!(FACULTY_ALERTS_SHOW_ONLY_FOR_NOE_TEACH_METHODS && !in_array($c['teaching_method'], $noe_teach_methods))) {
Esempio n. 2
0
    $render = true;
    $thisPage = "notice-exam";
    $default_date_range = unserialize(EXAMS_AND_PROCTOR_DEFAULT_DATE_FILTER_RANGE);
    if (!empty($_GET['start']) && !empty($_GET['end'])) {
        $startDate = \DateTime::createFromFormat('Y-m-d', urldecode($_GET['start']));
        $endDate = \DateTime::createFromFormat('Y-m-d', urldecode($_GET['end']));
    }
    if (!$startDate) {
        $startDate = new \DateTime($default_date_range['start']);
    }
    if (!$endDate) {
        $endDate = new \DateTime($default_date_range['end']);
    }
    $startDate = $startDate->format('Y-m-d');
    $endDate = $endDate->format('Y-m-d');
    $notices = $noes->fetchNOEs($startDate, $endDate);
    if ($_GET['mode'] === "as_only") {
        //If the user has requested that only NOE's with AS confirmations, we need to filter out those that don't
        $notices = array_filter($notices, function ($n) use($noes) {
            return $noes->fetchCountStudentsConfirmedAtAS($n['exam_request_id'], $n['course_code'], $n['course_section'], $n['session']) > 0;
        });
    }
    $l10n->addResource(__DIR__ . '/l10n/notice-of-examination.json');
    $viewFile = 'views/notice-of-examination.php';
} elseif ($_GET['page'] === "add-notice-of-exam") {
    $noe_id = $noes->addNOE($_POST, $SESSION->first_name . " " . $SESSION->last_name, $SESSION->user_name, $SESSION->user_id);
    $loggers['audit']->info("NOE {$noe_id} added");
    echo $noe_id;
    //Need to borrow prof module functions to trigger reminder emails professor and students
    $professor = new \Ventus\Professor\RequestForm($dbo);
    $professor->reminderToAccessServiceStudents(null, $noe_id);