diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index 1198f197b9..5e09803758 100644 --- a/main/exercice/exercice.php +++ b/main/exercice/exercice.php @@ -91,11 +91,12 @@ if (isset($_SESSION['exerciseResult'])) { } //General POST/GET/SESSION/COOKIES parameters recovery -$origin = isset($_REQUEST['origin']) ? Security::remove_XSS($_REQUEST['origin']) : isset($origin) ? $origin : null; -$choice = isset($_REQUEST['choice']) ? Security::remove_XSS($_REQUEST['choice']) : isset($choice) ? $choice : null; -$hpchoice = isset($_REQUEST['hpchoice']) ? Security::remove_XSS($_REQUEST['hpchoice']) : isset($hpchoice) ? $hpchoice : null; -$exerciseId = isset($_REQUEST['exerciseId']) ? Security::remove_XSS($_REQUEST['exerciseId']) : isset($exerciseId) ? $exerciseId : null; -$file = isset($_REQUEST['file']) ? Database::escape_string($_REQUEST['file']) : isset($file) ? $file : null; +$origin = isset($_REQUEST['origin']) ? Security::remove_XSS($_REQUEST['origin']) : null; +$choice = isset($_REQUEST['choice']) ? Security::remove_XSS($_REQUEST['choice']) : null; + +$hpchoice = isset($_REQUEST['hpchoice']) ? Security::remove_XSS($_REQUEST['hpchoice']) : null; +$exerciseId = isset($_REQUEST['exerciseId']) ? Security::remove_XSS($_REQUEST['exerciseId']) : null; +$file = isset($_REQUEST['file']) ? Database::escape_string($_REQUEST['file']) : null; $learnpath_id = isset($_REQUEST['learnpath_id']) ? intval($_REQUEST['learnpath_id']) : null; $learnpath_item_id = isset($_REQUEST['learnpath_item_id']) ? intval($_REQUEST['learnpath_item_id']) : null; @@ -187,6 +188,7 @@ HotPotGCt($documentPath, 1, api_get_user_id()); // only for administrator if ($is_allowedToEdit) { + if (!empty($choice)) { // construction of Exercise diff --git a/main/exercice/exercise_show.php b/main/exercice/exercise_show.php index 5e14a468db..a8c4ef02f0 100644 --- a/main/exercice/exercise_show.php +++ b/main/exercice/exercise_show.php @@ -96,6 +96,10 @@ if (empty($objExercise)) { } $feedback_type = $objExercise->feedback_type; +if ($objExercise->exercise_was_added_in_lp && $learnpath_id != 0) { + //Display::display_normal_message(get_lang('ThisExerciseWasResolvedInsideALP')); +} + //If is not valid $session_control_key = get_session_time_control_key($exercise_id, $learnpath_id, $learnpath_item_id); if (isset($session_control_key) && !exercise_time_control_is_valid($exercise_id, $learnpath_id, $learnpath_item_id) && !in_array($action, array('qualify','edit'))) {