Quiz: Fix hotspot edition and math formulas - refs BT#16676

pull/3090/head
Angel Fernando Quiroz Campos 6 years ago
parent 7f80943f93
commit 59b60c7775
  1. 14
      main/exercise/admin.php
  2. 8
      main/exercise/hotspot_admin.inc.php

@ -64,20 +64,6 @@ if (!$is_allowedToEdit) {
$exerciseId = isset($_GET['exerciseId']) ? (int) $_GET['exerciseId'] : 0; $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; $newQuestion = isset($_GET['newQuestion']) ? $_GET['newQuestion'] : 0;
$modifyAnswers = isset($_GET['modifyAnswers']) ? $_GET['modifyAnswers'] : 0; $modifyAnswers = isset($_GET['modifyAnswers']) ? $_GET['modifyAnswers'] : 0;
$editQuestion = isset($_GET['editQuestion']) ? $_GET['editQuestion'] : 0; $editQuestion = isset($_GET['editQuestion']) ? $_GET['editQuestion'] : 0;

@ -2,6 +2,7 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use ChamiloSession as Session; use ChamiloSession as Session;
use Symfony\Component\HttpFoundation\Request;
/** /**
* This script allows to manage answers. It is included from the * 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 $debug = 0; // debug variable to get where we are
$okPicture = empty($pictureName) ? false : true; $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 we come from the warning box "this question is used in several exercises"
if ($modifyIn) { if ($modifyIn) {
if ($debug > 0) { if ($debug > 0) {

Loading…
Cancel
Save