getStatTrackExerciseInfoByExeId($exe_id); if (!empty($exercise_stat_info) && isset($exercise_stat_info['exe_exo_id'])) { if ($exercise_stat_info['status'] == 'incomplete') { $objExercise->read($exercise_stat_info['exe_exo_id']); } else { header("Location: overview.php?exerciseId=".$exercise_stat_info['exe_exo_id']); exit; } } else { api_not_allowed(true); } } $gradebook = ''; if (isset($_SESSION['gradebook'])) { $gradebook = $_SESSION['gradebook']; } if (!empty($gradebook) && $gradebook == 'view') { $interbreadcrumb[] = array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('ToolGradebook')); } $nameTools = get_lang('Exercice'); $interbreadcrumb[] = array("url" => "exercice.php?gradebook=$gradebook", "name" => get_lang('Exercices')); 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 '
'; echo ''.Display::return_icon('back.png', get_lang('GoBackToQuestionList'), array(), 32).''; echo ''.Display::return_icon('edit.png', get_lang('ModifyExercise'), array(), 32).''; echo '
'; } $feedback_type = $objExercise->feedback_type; $exercise_stat_info = $objExercise->getStatTrackExerciseInfoByExeId($exe_id); if (!empty($exercise_stat_info['data_tracking'])) { $question_list = explode(',', $exercise_stat_info['data_tracking']); } $learnpath_id = $exercise_stat_info['orig_lp_id']; $learnpath_item_id = $exercise_stat_info['orig_lp_item_id']; $learnpath_item_view_id = $exercise_stat_info['orig_lp_item_view_id']; if ($origin == 'learnpath') { ?>
selectAttempts() > 0) { $attempt_count = get_attempt_count(api_get_user_id(), $objExercise->id, $learnpath_id, $learnpath_item_id, $learnpath_item_view_id); if ($attempt_count >= $objExercise->selectAttempts()) { 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; } } Display::display_normal_message(get_lang('Saved').'
', false); // Display questions. $objExercise->displayQuestionListByAttempt($exe_id, true); // If is not valid. /* $session_control_key = ExerciseLib::get_session_time_control_key($objExercise->id, $learnpath_id, $learnpath_item_id); if (isset($session_control_key) && !ExerciseLib::exercise_time_control_is_valid($objExercise->id, $learnpath_id, $learnpath_item_id)) { $TBL_TRACK_ATTEMPT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); $sql_fraud = "UPDATE $TBL_TRACK_ATTEMPT SET answer = 0, marks = 0, position = 0 WHERE exe_id = $exe_id "; Database::query($sql_fraud); }*/ // 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 '
'; echo $objExercise->returnEndButtonHTML(); if (api_is_allowed_to_session_edit()) { Session::erase('objExercise'); Session::erase('exe_id'); Session::erase('categoryList'); Session::erase('question_list_flatten'); } Display::display_footer(); } else { $lp_mode = $_SESSION['lp_mode']; $url = api_get_path(WEB_CODE_PATH).'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 (api_is_allowed_to_session_edit()) { Session::erase('objExercise'); Session::erase('exe_id'); Session::erase('categoryList'); } // Record the results in the learning path, using the SCORM interface (API) echo ""; echo ''; echo ''; }