Browse Source

Fixing setting variables

Julio Montoya 12 years ago
parent
commit
c7653332fb
2 changed files with 11 additions and 5 deletions
  1. 7 5
      main/exercice/exercice.php
  2. 4 0
      main/exercice/exercise_show.php

+ 7 - 5
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
 

+ 4 - 0
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'))) {