require '../include/staff_auth.inc'; require_once '../include/errors.inc'; require_once '../classes/logmetadata.class.php'; require_once '../classes/userutils.class.php'; require_once '../classes/paperproperties.class.php'; $metadataID = check_var('metadataID', 'GET', true, false, true); $userID = check_var('userID', 'GET', true, false, true); $paperID = check_var('paperID', 'GET', true, false, true); $properties = PaperProperties::get_paper_properties_by_id($paperID, $mysqli, $string); if ($properties->get_paper_type() != '1') { // Only allow timer reset of Progress Test papers. $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email')); $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true); } $log_metadata = new LogMetadata($userID, $paperID, $mysqli); if ($log_metadata->get_record($metadataID) === false) { $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email')); $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true); } $dateObj = $log_metadata->get_start_datetime(); $user_details = UserUtils::get_user_details($userID, $mysqli); if ($user_details === false) { $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email')); $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true); } $name = $user_details['title'] . ' ' . $user_details['surname'] . ', ' . $user_details['first_names'] . ' (' . $user_details['student_id'] . ')'; $display_format = $configObject->get('cfg_long_date_php') . ' ' . $configObject->get('cfg_short_time_php'); $started = $dateObj->format($display_format); ?> <!DOCTYPE html> <html>
check_paper_password($password, $string, $mysqli, true); //Check this PC is registered for this exam $low_bandwidth = check_labs($test_type, $labs, $current_address, $password, $string, $mysqli); $attempt = check_modules($userObject, $modIDs, $calendar_year, $string, $mysqli); } $display_remaining_time = false; $remaining_minutes = ''; $remaining_seconds = ''; /* * BP If the duration is set then create a timer to calculate and display the remaining time */ $extra_time = null; $remaining_time = 0; $log_metadata = new LogMetadata($userObject->get_user_ID(), $propertyObj->get_property_id(), $mysqli); // $log_metadata->get_record will return true if this user has stared this exam. false otherwise $exam_started = $log_metadata->get_record('', false); if ($exam_duration !== null) { if ($test_type == '2') { $student_object['special_needs_percentage'] = $special_needs_percentage; $student_object['user_ID'] = $userObject->get_user_ID(); $log_lab_end_time = new LogLabEndTime($lab_id, $propertyObj, $mysqli); $log_extra_time = new LogExtraTime($log_lab_end_time, $student_object, $mysqli); $extra_time_secs = $log_extra_time->get_extra_time_secs(); $extra_time_mins = $extra_time_secs / 60; $summative_timer = new SummativeTimer($log_extra_time); $remaining_time = $summative_timer->calculate_remaining_time_secs(); if ($remaining_time !== false) { $display_remaining_time = true; if ($exam_started == false and $remaining_time == 0) { // Sanity check if we have not started the exam but time remaing is 0 // happens in summative exams if we have the start and end time set wider
// Check if paper can be released date wise if (!$propertyObj->is_question_fb_released()) { $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email')); $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true); } //lookup previous sessionid from log_metadata.started property_id if (isset($_GET['userid'])) { if ($userObject->has_role(array('SysAdmin', 'Admin', 'Staff'))) { $log_metadata = new LogMetadata($_GET['userid'], $paperID, $mysqli); } else { $notice->access_denied($mysqli, $string, $string['norights'], true, true); } } else { $log_metadata = new LogMetadata($userObject->get_user_ID(), $paperID, $mysqli); } $log_metadata->get_record(); $metadataid = $log_metadata->get_metadata_id(); if ($metadataid === null) { $notice->access_denied($mysqli, $string, $string['nottaken'], true, true); } $preview_q_id = isset($_GET['q_id']) ? $_GET['q_id'] : null; $moduleID = Paper_utils::get_modules($paperID, $mysqli); if ($userObject->has_role('Student')) { // Check for additional password on the paper check_paper_password($propertyObj->get_password(), $string, $mysqli, true); $display_correct_answer = 1; $display_question_mark = 1; $display_students_response = 1; $display_feedback = 1; } else { $display_correct_answer = $propertyObj->get_display_correct_answer();
if ($_POST['button_pressed'] == 'next') { $current_screen = $_POST['current_screen']; } elseif ($_POST['button_pressed'] == 'previous') { $current_screen = $_POST['current_screen'] - 2; } elseif ($_POST['button_pressed'] == 'jump_screen') { $current_screen = $_POST['jump_screen']; } elseif ($is_fire_alarm) { $current_screen = $_POST['current_screen']; } } // Set up new metadata record or get existing one. $log_metadata = new LogMetadata($userObject->get_user_ID(), $paperID, $mysqli); if ($is_preview_mode_first_launch == true or $is_first_launch and !$do_restart) { //in preview mode or for non-restartable papers always start a new session if we have relaunched the window $log_metadata->create_new_record($current_address, $userObject->get_grade(), $userObject->get_year(), $attempt, $lab_name); } elseif ($log_metadata->get_record() == false) { //load the data and check for no records //we have no log_metadata record so make one $log_metadata->create_new_record($current_address, $userObject->get_grade(), $userObject->get_year(), $attempt, $lab_name); } $metadataID = $log_metadata->get_metadata_id(); // Foramtive or Progressive papers that have a duration set should use the timer. if ($propertyObj->get_paper_type() == '0' || $propertyObj->get_paper_type() == '1') { if ($propertyObj->get_exam_duration() != null) { $allow_timing = true; } // Summative exams only allow timing if ALL the modules of the paper allow it. } else { if ($propertyObj->get_paper_type() == '2') { $allow_timing = module_utils::modules_allow_timing($modIDs, $mysqli); }
$hide_if_unanswered = 0; $is_exam_review_mode = true; } if (isset($_GET['userID'])) { if ($userObject->has_role(array('SysAdmin', 'Admin', 'Staff', 'External Examiner'))) { $log_metadata = new LogMetadata($_GET['userID'], $paperID, $mysqli); } else { // Student is hacking the userid parameter. $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email')); $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true); } } else { $log_metadata = new LogMetadata($userObject->get_user_ID(), $paperID, $mysqli); } if (isset($_GET['metadataID'])) { $log_metadata->get_record($_GET['metadataID']); $metadataid = $_GET['metadataID']; } else { $log_metadata->get_record(); $metadataid = $log_metadata->get_metadata_id(); } if (!$is_exam_review_mode and !$is_question_preview_mode and !$is_formative_review) { // Only update log metadata if we are ending an exam. $log_metadata->set_completed_to_now(); } require '../config/finish.inc'; ?> <!DOCTYPE html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" />