Exemple #1
0
    check_paper_password($propertyObj->get_password(), $string, $mysqli);
    // Check time security
    check_datetime($propertyObj->get_start_date(), $propertyObj->get_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);
    // Check modules if the user is a student and the paper is not formative
    $attempt = check_modules($userObject, $modIDs, $propertyObj->get_calendar_year(), $string, $mysqli);
    // Check for any metadata security restrictions
    check_metadata($propertyObj->get_property_id(), $userObject, $modIDs, $string, $mysqli);
    $summative_exam_session_started = false;
}
$is_preview = (isset($_POST['mode']) and $_POST['mode'] == 'preview');
$paper_scheduled = $propertyObj->get_start_date() !== null;
if ($propertyObj->get_exam_duration() != null and $propertyObj->get_paper_type() == '2') {
    $log_lab_end_time = new LogLabEndTime($lab_id, $propertyObj, $mysqli);
    $summative_exam_session_started = $log_lab_end_time->get_session_end_date_datetime();
}
if (!$is_preview and time() > $propertyObj->get_end_date() and ($propertyObj->get_paper_type() == '1' or $propertyObj->get_paper_type() == '2' and $paper_scheduled and $summative_exam_session_started == false)) {
    $propertyObj->set_paper_type('_late');
}
$preview_q_id = isset($_GET['q_id']) ? $_GET['q_id'] : null;
$log_metadata = new LogMetadata($userObject->get_user_ID(), $propertyObj->get_property_id(), $mysqli);
if ($log_metadata->get_record() === false) {
    $notice->access_denied($mysqli, $string, $string['error_paper'], false);
}
$metadataid = $log_metadata->get_metadata_id();
if ($_GET['submitType'] == 'userSubmit') {
    $log_metadata->set_highest_screen($_POST['old_screen']);
}
try {
    $ret = record_marks($propertyObj->get_property_id(), $mysqli, $propertyObj->get_paper_type(), $metadataid, $preview_q_id);
 /**
  * @return int
  */
 public function get_session_end_datetime()
 {
     return $this->log_lab_end_time->get_session_end_date_datetime();
 }
Exemple #3
0
 $module_results->execute();
 $module_results->store_result();
 $module_results->bind_result($moduleID, $timed_exams);
 $modules = array();
 while ($module_results->fetch()) {
     $modules[] = $moduleID;
     $all_modules++;
     if ($timed_exams == true) {
         $timed_modules++;
     }
 }
 $allow_timing = $timed_modules == $all_modules;
 $exam_started = false;
 // Has 'Start' button been submitted
 $log_lab_end_time = new LogLabEndTime($lab_object->get_id(), $property_object, $mysqli);
 $end_datetime = $log_lab_end_time->get_session_end_date_datetime();
 if ($end_datetime == false) {
     $end_datetime = $log_lab_end_time->calculate_default_session_end_datetime();
 } else {
     $exam_started = true;
     $started_timestamp = $log_lab_end_time->get_started_timestamp();
     //$start_date = date($configObject->get('cfg_long_date_php') . ' ' . $configObject->get('cfg_long_time_php'), $started_timestamp);
     $start_date = date($configObject->get('cfg_long_time_php'), $started_timestamp);
 }
 $disptimezone = new DateTimeZone($property_object->get_timezone());
 if ($allow_timing and isset($_POST['start_exam_form'])) {
     $paper_id = (int) $_POST['paper_id'];
     // Does the submitted paperID correspond it to the currently iterated paper?
     if ($paper_id == (int) $property_id) {
         $invigilator_id = $userObject->get_user_ID();
         $end_datetime = $log_lab_end_time->save($invigilator_id);