Display::display_warning_message(sprintf(get_lang('ReachedMaxAttempts'), $objExercise->selectTitle(), $objExercise->selectAttempts()), false); if ($origin != 'learnpath') { //we are not in learnpath tool Display::display_footer(); } exit; } } $total_score = 0; if (!empty($exercise_stat_info)) { $total_score = $exercise_stat_info['exe_result']; } $max_score = $objExercise->get_max_score(); Display::display_normal_message(get_lang('Saved') . '<br />', false); // Display and save questions ExerciseLib::display_question_list_by_attempt($objExercise, $exe_id, true); //Unset session for clock time ExerciseLib::exercise_time_control_delete($objExercise->id, $learnpath_id, $learnpath_item_id); ExerciseLib::delete_chat_exercise_session($exe_id); if ($origin != 'learnpath') { echo '<hr>'; echo Display::url(get_lang('ReturnToCourseHomepage'), api_get_course_url(), array('class' => 'btn btn-primary')); if (api_is_allowed_to_session_edit()) { Session::erase('objExercise'); Session::erase('exe_id'); } Display::display_footer(); } else { $lp_mode = Session::read('lp_mode'); $url = '../newscorm/lp_controller.php?cidReq=' . api_get_course_id() . '&action=view&lp_id=' . $learnpath_id . '&lp_item_id=' . $learnpath_item_id . '&exeId=' . $exercise_stat_info['exe_id'] . '&fb_type=' . $objExercise->feedback_type; $href = $lp_mode == 'fullscreen' ? ' window.opener.location.href="' . $url . '" ' : ' top.location.href="' . $url . '"';
if (empty($track_exercise_info)) { api_not_allowed($show_headers); } $exercise_id = $track_exercise_info['exe_exo_id']; $student_id = $track_exercise_info['exe_user_id']; $current_user_id = api_get_user_id(); $objExercise = new Exercise(); if (!empty($exercise_id)) { $objExercise->read($exercise_id); } // Only users can see their own results if (!$is_allowedToEdit) { if ($student_id != $current_user_id) { api_not_allowed($show_headers); } } $htmlHeadXtra[] = '<link rel="stylesheet" href="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/css/hotspot.css">'; $htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/js/hotspot.js"></script>'; if ($show_headers) { $interbreadcrumb[] = array("url" => "exercise.php?" . api_get_cidreq(), "name" => get_lang('Exercises')); $interbreadcrumb[] = array("url" => "#", "name" => get_lang('Result')); $this_section = SECTION_COURSES; Display::display_header(); } else { $htmlHeadXtra[] = "\n <style>\n body { background: none;}\n </style>\n "; Display::display_reduced_header(); } ExerciseLib::display_question_list_by_attempt($objExercise, $id, false); if ($show_headers) { Display::display_footer(); }