'; //jQuery $htmlHeadXtra[] = ''; if (api_get_setting('show_glossary_in_extra_tools') == 'true') { $htmlHeadXtra[] = ''; //Glossary $htmlHeadXtra[] = ''; } //This library is necessary for the time control feature $htmlHeadXtra[] = ''; //jQuery if (!ereg("MSIE",$_SERVER["HTTP_USER_AGENT"])) { $htmlHeadXtra[] = ""; } /* ------------ ACCESS RIGHTS ------------ */ // notice for unauthorized people. api_protect_course_script(true); require_once api_get_path(LIBRARY_PATH) . 'text.lib.php'; $is_allowedToEdit = api_is_allowed_to_edit(null,true); $_configuration['live_exercise_tracking'] = true; $stat_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES); $exercice_attemp_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); $TBL_EXERCICE_QUESTION = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION); $TBL_EXERCICES = Database :: get_course_table(TABLE_QUIZ_TEST); $TBL_QUESTIONS = Database :: get_course_table(TABLE_QUIZ_QUESTION); $TBL_REPONSES = Database :: get_course_table(TABLE_QUIZ_ANSWER); // general parameters passed via POST/GET if (empty ($origin)) { $origin = $_REQUEST['origin']; } if (empty ($learnpath_id)) { $learnpath_id = Security::remove_XSS($_REQUEST['learnpath_id']); } if (empty ($learnpath_item_id)) { $learnpath_item_id = Security::remove_XSS($_REQUEST['learnpath_item_id']); } if (empty ($formSent)) { $formSent = $_REQUEST['formSent']; } if (empty ($exerciseResult)) { $exerciseResult = $_REQUEST['exerciseResult']; } if (empty ($exerciseResultCoordinates)) { $exerciseResultCoordinates = $_REQUEST['exerciseResultCoordinates']; } if (empty ($exerciseType)) { $exerciseType = $_REQUEST['exerciseType']; } if (empty ($exerciseId)) { $exerciseId = Database::escape_string(intval($_REQUEST['exerciseId'])); } if (empty ($choice)) { $choice = $_REQUEST['choice']; } if (empty ($_REQUEST['choice'])) { $choice = $_REQUEST['choice2']; } if (empty ($questionNum)) { $questionNum = Database :: escape_string($_REQUEST['questionNum']); } if (empty ($nbrQuestions)) { $nbrQuestions = Database :: escape_string($_REQUEST['nbrQuestions']); } if (empty ($buttonCancel)) { $buttonCancel = $_REQUEST['buttonCancel']; } $error = ''; if (!isset ($exerciseType)) { $exe_start_date = time(); $_SESSION['exercice_start_date'] = $exe_start_date; } // if the user has clicked on the "Cancel" button if ($buttonCancel) { // returns to the exercise list header("Location: exercice.php?origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id"); exit (); } if ($origin == 'learnpath' && isset ($_GET['not_multiple_attempt']) && $_GET['not_multiple_attempt'] == strval(intval($_GET['not_multiple_attempt']))) { $not_multiple_attempt = (int) $_GET['not_multiple_attempt']; if ($not_multiple_attempt === 1) { require_once '../inc/reduced_header.inc.php'; echo '
$exerciseDescription
"; if ($exerciseType == ONE_PER_PAGE) { $s2 = "&exerciseId=" . $exerciseId; } $s .= " '; $b = 2; } if ($_configuration['live_exercise_tracking'] == true && $exerciseFeedbackType != EXERCISE_FEEDBACK_TYPE_DIRECT) { if ($table_recorded_not_exist) { //$table_recorded_not_exist if ($exercise_row['expired_time'] != 0) { $sql_fields = "expired_time_control, "; $sql_fields_values = "'"."$clock_expired_time"."',"; } else { $sql_fields = ""; $sql_fields_values = ""; } if ($exerciseType == ONE_PER_PAGE) { $sql = "INSERT INTO $stat_table($sql_fields exe_exo_id,exe_user_id,exe_cours_id,status,session_id,data_tracking,start_date,orig_lp_id,orig_lp_item_id) VALUES($sql_fields_values '$exerciseId','" . api_get_user_id() . "','" . $_course['id'] . "','incomplete','" . $session_id . "','" . implode(',', $questionList) . "','" . date('Y-m-d H:i:s') . "',$safe_lp_id,$safe_lp_item_id)"; Database::query($sql); } else { echo $sql = "INSERT INTO $stat_table ($sql_fields exe_exo_id,exe_user_id,exe_cours_id,status,session_id,start_date,orig_lp_id,orig_lp_item_id) VALUES($sql_fields_values '$exerciseId','" . api_get_user_id() . "','" . $_course['id'] . "','incomplete','" . $session_id . "','" . date('Y-m-d H:i:s') . "',$safe_lp_id,$safe_lp_item_id)"; Database::query($sql); } } } if ($origin != 'learnpath') { //so we are not in learnpath tool echo '