Пример #1
0
// Are we in a staff single question testmode
$is_question_preview_mode = isset($_GET['q_id']);
/*
* Set the default colour scheme for this paper and allow current users' special settings to override
* $bgcolor, $fgcolor, $textsize, $marks_color, $themecolor, $labelcolor, $font, $unanswered_color are passed by reference!!
*/
$bgcolor = $fgcolor = $textsize = $marks_color = $themecolor = $labelcolor = $font = $unanswered_color = $dismiss_color = '';
$propertyObj->set_paper_colour_scheme($userObject, $bgcolor, $fgcolor, $textsize, $marks_color, $themecolor, $labelcolor, $font, $unanswered_color, $dismiss_color);
$original_paper_type = $paper_type;
//store the original paper type - needed to retrieve answers from the correct log and functionality related decisions
$attempt = 1;
//default attempt to 1 overwritten if the student is resit candidate
$modIDs = array_keys(Paper_utils::get_modules($property_id, $mysqli));
$current_address = NetworkUtils::get_client_address();
$moduleID = $propertyObj->get_modules();
if ($userObject->has_role('Staff') and check_staff_modules($moduleID, $userObject)) {
    // No further security checks.
} else {
    // Treat as student with extra security checks.
    // Check for additional password on the paper
    check_paper_password($password, $string, $mysqli);
    // Check time security
    check_datetime($start_date, $end_date, $string, $mysqli);
    // Check room security
    $low_bandwidth = check_labs($propertyObj->get_paper_type(), $propertyObj->get_labs(), $current_address, $propertyObj->get_password(), $string, $mysqli);
    // Get modules if the user is a student and the paper is not formative
    $attempt = check_modules($userObject, $modIDs, $calendar_year, $string, $mysqli);
    // Check for any metadata security restrictions
    check_metadata($property_id, $userObject, $modIDs, $string, $mysqli);
}
// Get lab info used in log metadata
Пример #2
0
}
$summative_exam_session_started = false;
$paper_scheduled = $propertyObj->get_start_date() !== null;
if ($propertyObj->get_exam_duration() != null and $propertyObj->get_paper_type() == '2') {
    // Has this lab had an end time set?
    $log_lab_end_time = new LogLabEndTime($lab_id, $propertyObj, $mysqli);
    $summative_exam_session_started = $log_lab_end_time->get_session_end_date_datetime();
}
if ($userObject->has_role(array('External Examiner'))) {
    // No further security checks.
    require_once '../classes/reviews.class.php';
    if (!ReviewUtils::is_external_on_paper($userObject->get_user_ID(), $paperID, $mysqli)) {
        $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email'));
        $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['accessdenied'], '/artwork/page_not_found.png', '#C00000', true, true);
    }
} elseif ($userObject->has_role('Staff') and check_staff_modules($moduleID, $userObject) or $userObject->has_role('SysCron')) {
    // No further security checks.
} else {
    $modIDs = array_keys($moduleID);
    if ($paper_type == 2) {
        $latex_needed = 0;
    }
    // Students get no feedback for summative exams so don't load the Latex library
    // Check for additional password on the paper
    check_paper_password($password, $string, $mysqli);
    // Check time security
    check_datetime($start_date, $end_date, $string, $mysqli);
    // Check room security
    $low_bandwidth = check_labs($paper_type, $labs, $current_address, $password, $string, $mysqli);
    // Get modules if the user is a student and the paper is not formative
    $attempt = check_modules($userObject, $modIDs, $calendar_year, $string, $mysqli);