0) { error_log('Entered exercise_result.php: '.print_r($_POST, 1)); } // general parameters passed via POST/GET if (empty($origin)) { if (!empty($_REQUEST['origin'])) { $origin = Security::remove_XSS($_REQUEST['origin']); } else { $origin = ''; } } if (empty($learnpath_id)) { if (!empty($_REQUEST['learnpath_id'])) { $learnpath_id = intval($_REQUEST['learnpath_id']); } else { $learnpath_id = 0; } } if (empty($learnpath_item_id)) { if (!empty($_REQUEST['learnpath_item_id'])) { $learnpath_item_id = intval($_REQUEST['learnpath_item_id']); } else { $learnpath_item_id = 0; } } if (empty($learnpath_item_view_id)) { if (!empty($_REQUEST['learnpath_item_view_id'])) { $learnpath_item_view_id = intval($_REQUEST['learnpath_item_view_id']); } else { $learnpath_item_view_id = 0; } } if (empty($exerciseId)) { if (!empty($_REQUEST['exerciseId'])) { $exerciseId = intval($_REQUEST['exerciseId']); } else { $exerciseId = 0; } } if (empty($objExercise)) { $exerciseInSession = Session::read('objExercise'); if (!empty($exerciseInSession)) { $objExercise = $exerciseInSession; } else { $objExercise = null; } } if (!$objExercise) { //Redirect to the exercise overview //Check if the exe_id exists header("Location: overview.php?exerciseId=".$exerciseId.'&'.api_get_cidreq()); exit; } $time_control = false; $clock_expired_time = ExerciseLib::get_session_time_control_key( $objExercise->id, $learnpath_id, $learnpath_item_id ); if ($objExercise->expired_time != 0 && !empty($clock_expired_time)) { $time_control = true; } if ($time_control) { // Get time left for expiring time $time_left = api_strtotime($clock_expired_time, 'UTC') - time(); $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/epiclock/stylesheet/jquery.epiclock.css'); $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/epiclock/renderers/minute/epiclock.minute.css'); $htmlHeadXtra[] = api_get_js('epiclock/javascript/jquery.dateformat.min.js'); $htmlHeadXtra[] = api_get_js('epiclock/javascript/jquery.epiclock.min.js'); $htmlHeadXtra[] = api_get_js('epiclock/renderers/minute/epiclock.minute.js'); $htmlHeadXtra[] = $objExercise->show_time_control_js($time_left); } if (isset($_SESSION['exe_id'])) { $exe_id = intval($_SESSION['exe_id']); } $exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id); if (!empty($exercise_stat_info['data_tracking'])) { $question_list = explode(',', $exercise_stat_info['data_tracking']); } if (empty($exercise_stat_info) || empty($question_list)) { api_not_allowed(); } $nameTools = get_lang('Exercises'); $interbreadcrumb[] = array("url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises')); if ($origin != 'learnpath') { //so we are not in learnpath tool Display::display_header($nameTools, get_lang('Exercise')); } else { Display::display_reduced_header(); } /* DISPLAY AND MAIN PROCESS */ // I'm in a preview mode as course admin. Display the action menu. if (api_is_course_admin() && $origin != 'learnpath') { echo '