diff --git a/main/exercise/hotspot_admin.inc.php b/main/exercise/hotspot_admin.inc.php index fe0ef2378b..7e9040901f 100755 --- a/main/exercise/hotspot_admin.inc.php +++ b/main/exercise/hotspot_admin.inc.php @@ -9,9 +9,9 @@ use ChamiloSession as Session; * * @package chamilo.exercise * - * @author Toon Keppens + * @author Toon Keppens */ -$modifyAnswers = (int) $_GET['hotspotadmin']; +$modifyAnswers = (int)$_GET['hotspotadmin']; if (!is_object($objQuestion)) { $objQuestion = Question::read($modifyAnswers); @@ -576,30 +576,27 @@ if (isset($modifyAnswers)) { echo Display::return_message($msgErr, 'normal'); //main API } - $hotspot_admin_url = api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&hotspotadmin='.$modifyAnswers.'&exerciseId='.$exerciseId; ?> + $hotspot_admin_url = api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&' + .http_build_query(['hotspotadmin' => $modifyAnswers, 'exerciseId' => $exerciseId]); ?>
- + - + - + @@ -628,74 +625,74 @@ if (isset($modifyAnswers)) { get_flat_list(); - - for ($i = 1; $i <= $nbrAnswers; $i++) { - // is an delineation - if ($answerType == HOT_SPOT_DELINEATION) { - $option_lp = ''; - - // setting the LP - $isSelected = false; - foreach ($flat_list as $id => $details) { - $selected = ''; - if (isset($lp[$i]) && $id == $lp[$i]) { - $isSelected = true; - $selected = 'selected="selected"'; - } - $option_lp .= ''; - } + // Loading list of LPs + $flat_list = $list->get_flat_list(); + + for ($i = 1; $i <= $nbrAnswers; $i++) { + // is an delineation + if ($answerType == HOT_SPOT_DELINEATION) { + $option_lp = ''; + + // setting the LP + $isSelected = false; + foreach ($flat_list as $id => $details) { + $selected = ''; + if (isset($lp[$i]) && $id == $lp[$i]) { + $isSelected = true; + $selected = 'selected="selected"'; + } + $option_lp .= ''; + } - if ($isSelected) { - $option_lp = ''.$option_lp; - } else { - $option_lp = ''.$option_lp; + } else { + $option_lp = ''.$option_lp; - } + } - // Feedback SELECT - $question_list = $objExercise->selectQuestionList(); - $option_feed = ''; - $option_feed .= ''; + // Feedback SELECT + $question_list = $objExercise->selectQuestionList(); + $option_feed = ''; + $option_feed .= ''; - foreach ($question_list as $key => $questionid) { - $selected = ''; - $question = Question::read($questionid); - $questionTitle = strip_tags($question->selectTitle()); - $val = "Q$key: $questionTitle"; + foreach ($question_list as $key => $questionid) { + $selected = ''; + $question = Question::read($questionid); + $questionTitle = strip_tags($question->selectTitle()); + $val = "Q$key: $questionTitle"; - if (isset($select_question[$i]) && $questionid == $select_question[$i]) { - $selected = 'selected="selected"'; - } + if (isset($select_question[$i]) && $questionid == $select_question[$i]) { + $selected = 'selected="selected"'; + } - $option_feed .= ''; - } + $option_feed .= ''; + } - if (isset($select_question[$i]) && $select_question[$i] == -1) { - $option_feed .= ''; - } else { - $option_feed .= ''; - } + if (isset($select_question[$i]) && $select_question[$i] == -1) { + $option_feed .= ''; + } else { + $option_feed .= ''; + } - //-------- IF it is a delineation - if ($_SESSION['tmp_answers']['hotspot_type'][$i] == 'delineation') { - $option1 = $option2 = $option3 = ''; - for ($k = 1; $k <= 100; $k++) { - $selected1 = $selected2 = $selected3 = ''; - if ($k == $threadhold1[$i]) { - $selected1 = 'selected="selected"'; - } - if ($k == $threadhold2[$i]) { - $selected2 = 'selected="selected"'; - } - if ($k == $threadhold3[$i]) { - $selected3 = 'selected="selected"'; - } - $option1 .= ''; - $option2 .= ''; - $option3 .= ''; - } ?> + //-------- IF it is a delineation + if ($_SESSION['tmp_answers']['hotspot_type'][$i] == 'delineation') { + $option1 = $option2 = $option3 = ''; + for ($k = 1; $k <= 100; $k++) { + $selected1 = $selected2 = $selected3 = ''; + if ($k == $threadhold1[$i]) { + $selected1 = 'selected="selected"'; + } + if ($k == $threadhold2[$i]) { + $selected2 = 'selected="selected"'; + } + if ($k == $threadhold3[$i]) { + $selected3 = 'selected="selected"'; + } + $option1 .= ''; + $option2 .= ''; + $option3 .= ''; + } ?>