From 59b60c77753798c9e236885c205c71186cc9f68d Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Fri, 31 Jan 2020 11:53:12 -0500 Subject: [PATCH] Quiz: Fix hotspot edition and math formulas - refs BT#16676 --- main/exercise/admin.php | 14 -------------- main/exercise/hotspot_admin.inc.php | 8 ++++++++ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/main/exercise/admin.php b/main/exercise/admin.php index 7a99f35983..14c8a93b5a 100755 --- a/main/exercise/admin.php +++ b/main/exercise/admin.php @@ -64,20 +64,6 @@ if (!$is_allowedToEdit) { $exerciseId = isset($_GET['exerciseId']) ? (int) $_GET['exerciseId'] : 0; -/* stripslashes POST data */ -if ($_SERVER['REQUEST_METHOD'] == 'POST') { - foreach ($_POST as $key => $val) { - if (is_string($val)) { - $_POST[$key] = stripslashes($val); - } elseif (is_array($val)) { - foreach ($val as $key2 => $val2) { - $_POST[$key][$key2] = stripslashes($val2); - } - } - $GLOBALS[$key] = $_POST[$key]; - } -} - $newQuestion = isset($_GET['newQuestion']) ? $_GET['newQuestion'] : 0; $modifyAnswers = isset($_GET['modifyAnswers']) ? $_GET['modifyAnswers'] : 0; $editQuestion = isset($_GET['editQuestion']) ? $_GET['editQuestion'] : 0; diff --git a/main/exercise/hotspot_admin.inc.php b/main/exercise/hotspot_admin.inc.php index 260de41d52..b109777528 100755 --- a/main/exercise/hotspot_admin.inc.php +++ b/main/exercise/hotspot_admin.inc.php @@ -2,6 +2,7 @@ /* For licensing terms, see /license.txt */ use ChamiloSession as Session; +use Symfony\Component\HttpFoundation\Request; /** * This script allows to manage answers. It is included from the @@ -23,6 +24,13 @@ $pictureName = $objQuestion->getPictureFilename(); $debug = 0; // debug variable to get where we are $okPicture = empty($pictureName) ? false : true; +$httpRequest = Request::createFromGlobals(); +$reponse = $httpRequest->request->get('reponse'); +$comment = $httpRequest->request->get('comment'); +$weighting = $httpRequest->request->get('weighting'); +$hotspot_coordinates = $httpRequest->request->get('hotspot_coordinates'); +$hotspot_type = $httpRequest->request->get('hotspot_type'); + // if we come from the warning box "this question is used in several exercises" if ($modifyIn) { if ($debug > 0) {