diff --git a/main/exercice/exercice_submit.php b/main/exercice/exercice_submit.php
deleted file mode 100644
index e49522015b..0000000000
--- a/main/exercice/exercice_submit.php
+++ /dev/null
@@ -1,1121 +0,0 @@
-'; //jQuery
- $htmlHeadXtra[] = ''; //Glossary
- }
-/* ------------ 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 '
';
-$exerciseTitle = api_parse_tex($exerciseTitle);
-
-echo "
" . $exerciseTitle . "
";
-
-if ($exerciseAttempts > 0) {
- $user_id = api_get_user_id();
- $course_code = api_get_course_id();
- $sql = "SELECT count(*) FROM $stat_table WHERE exe_exo_id = '$quizID'
- AND exe_user_id = '$user_id'
- AND status != 'incomplete'
- AND orig_lp_id = $safe_lp_id
- AND orig_lp_item_id = $safe_lp_item_id
- AND exe_cours_id = '$course_code' AND session_id = '" . (int) $_SESSION['id_session'] . "'";
-
- $aquery = Database::query($sql, __FILE__, __LINE__);
- $attempt = Database :: fetch_array($aquery);
-
- if ($attempt[0] >= $exerciseAttempts) {
- if (!api_is_allowed_to_edit(null,true)) {
- Display :: display_warning_message(sprintf(get_lang('ReachedMaxAttempts'), $exerciseTitle, $exerciseAttempts), false);
- if ($origin != 'learnpath')
- Display :: display_footer();
- exit;
- } else {
- Display :: display_warning_message(sprintf(get_lang('ReachedMaxAttemptsAdmin'), $exerciseTitle, $exerciseAttempts), false);
- }
- }
-}
-
-if (!function_exists('convert_date_to_number')) {
- function convert_date_to_number($default) {
- // 2008-10-12 00:00:00 ---to--> 12345672218 (timestamp)
- $parts = split(' ', $default);
- list ($d_year, $d_month, $d_day) = split('-', $parts[0]);
- list ($d_hour, $d_minute, $d_second) = split(':', $parts[1]);
- return mktime($d_hour, $d_minute, $d_second, $d_month, $d_day, $d_year);
- }
-}
-
-$limit_time_exists = (($Exe_starttime != '0000-00-00 00:00:00') || ($Exe_endtime != '0000-00-00 00:00:00')) ? true : false;
-if ($limit_time_exists) {
- $exercise_start_time = convert_date_to_number($Exe_starttime);
- $exercise_end_time = convert_date_to_number($Exe_endtime);
- $time_now = convert_date_to_number(date('Y-m-d H:i:s'));
- $permission_to_start = (($time_now - $exercise_start_time) > 0) ? true : false;
- if ($_SERVER['REQUEST_METHOD'] != 'POST')
- $exercise_timeover = (($time_now - $exercise_end_time) > 0) ? true : false;
- if ($permission_to_start == false || $exercise_timeover == true) { //
- if (!api_is_allowed_to_edit(null,true)) {
- $message_warning = ($permission_to_start == false) ? get_lang('ExerciseNoStartedYet') : get_lang('ReachedTimeLimit');
- Display :: display_warning_message(sprintf($message_warning, $exerciseTitle, $exerciseAttempts));
- Display :: display_footer();
- exit;
- } else {
- $message_warning = ($permission_to_start == false) ? get_lang('ExerciseNoStartedAdmin') : get_lang('ReachedTimeLimitAdmin');
- Display :: display_warning_message(sprintf($message_warning, $exerciseTitle, $exerciseAttempts));
- }
- }
-}
-
-if (!empty ($error)) {
- Display :: display_error_message($error, false);
-} else {
- if (!empty ($exerciseSound)) {
- echo "
", "
";
- }
-
- // Get number of hotspot questions for javascript validation
- $number_of_hotspot_questions = 0;
- $onsubmit = '';
- $i = 0;
- //i have a doubt in this line cvargas
- //var_dump($questionList);
- if (!strcmp($questionList[0], '') === 0) {
- foreach ($questionList as $questionId) {
- $i++;
- $objQuestionTmp = Question :: read($questionId);
- // for sequential exercises
- if ($exerciseType == 2) {
- // if it is not the right question, goes to the next loop iteration
- if ($questionNum != $i) {
- continue;
- } else {
- if ($objQuestionTmp->selectType() == HOT_SPOT) {
- $number_of_hotspot_questions++;
- }
-
- break;
- }
- } else {
- if ($objQuestionTmp->selectType() == HOT_SPOT) {
- $number_of_hotspot_questions++;
- }
- }
- }
- }
- if ($number_of_hotspot_questions > 0) {
- $onsubmit = "onsubmit=\"return validateFlashVar('" . $number_of_hotspot_questions . "', '" . get_lang('HotspotValidateError1') . "', '" . get_lang('HotspotValidateError2') . "');\"";
- }
- $s = "
$exerciseDescription
";
-
- if ($exerciseType == 2)
- {
- $s2 = "&exerciseId=" . $exerciseId;
- }
-
- $s .= "
";
- $b = 2;
-}
-echo '
';
-if ($_configuration['live_exercise_tracking'] == true && $exerciseFeedbackType != 1) {
- //if($questionNum < 2){
- if ($table_recorded_not_exist) {
- if ($exerciseType == 2) {
- Database::query("INSERT INTO $stat_table(exe_exo_id,exe_user_id,exe_cours_id,status,session_id,data_tracking,start_date,orig_lp_id,orig_lp_item_id)
- VALUES('$exerciseId','" . api_get_user_id() . "','" . $_course['id'] . "','incomplete','" . api_get_session_id() . "','" . implode(',', $questionList) . "','" . date('Y-m-d H:i:s') . "',$safe_lp_id,$safe_lp_item_id)", __FILE__, __LINE__);
- } else {
- Database::query("INSERT INTO $stat_table (exe_exo_id,exe_user_id,exe_cours_id,status,session_id,start_date,orig_lp_id,orig_lp_item_id)
- VALUES('$exerciseId','" . api_get_user_id() . "','" . $_course['id'] . "','incomplete','" . api_get_session_id() . "','" . date('Y-m-d H:i:s') . "',$safe_lp_id,$safe_lp_item_id)", __FILE__, __LINE__);
- }
- }
-}
-
-if ($origin != 'learnpath') {
- //so we are not in learnpath tool
- echo ''; //End glossary div
- Display :: display_footer();
-} else {
- echo '