From daf0aae017aad533d773c2908526d551ea15fdef Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Thu, 8 Jun 2017 12:19:19 -0500 Subject: [PATCH] Minor - Format code - refs BT#12874 --- main/exercise/hotspot_admin.inc.php | 849 +++++++++++++++------------- 1 file changed, 449 insertions(+), 400 deletions(-) diff --git a/main/exercise/hotspot_admin.inc.php b/main/exercise/hotspot_admin.inc.php index 656df2e940..6017bd799b 100755 --- a/main/exercise/hotspot_admin.inc.php +++ b/main/exercise/hotspot_admin.inc.php @@ -13,7 +13,7 @@ use ChamiloSession as Session; $modifyAnswers = intval($_GET['hotspotadmin']); if (!is_object($objQuestion)) { - $objQuestion = Question :: read($modifyAnswers); + $objQuestion = Question::read($modifyAnswers); } $questionName = $objQuestion->selectTitle(); @@ -43,7 +43,7 @@ if ($modifyIn) { $objExercise->addToList($questionId); // construction of the duplicated Question - $objQuestion = Question :: read($questionId); + $objQuestion = Question::read($questionId); // adds the exercise ID into the exercise list of the Question object $objQuestion->addToList($exerciseId); @@ -146,7 +146,8 @@ if ($submitAnswers || $buttonBack) { $editQuestion = $questionId; unset($modifyAnswers); - echo ''; + echo ''; } if ($debug > 0) { @@ -326,7 +327,8 @@ if ($submitAnswers || $buttonBack) { $editQuestion = $questionId; unset($modifyAnswers); - echo ''; + echo ''; } } } @@ -574,9 +576,11 @@ if ($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.'&'.api_get_cidreq(); + $hotspot_admin_url = api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&hotspotadmin=' + .$modifyAnswers.'&exerciseId='.$exerciseId.'&'.api_get_cidreq(); ?> -
+
@@ -599,344 +603,45 @@ if ($modifyAnswers) {
- - + +
- - - - - - selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> - - '.get_lang('Scenario').''; - } - } else { ?> - - - - - - - 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; - } - - // Feedback SELECT - $question_list = $objExercise->selectQuestionList(); - $option_feed = ''; - $option_feed .= ''; - - foreach ($question_list as $key => $questionid) { - $selected = ''; - $question = Question::read($questionid); - $val = 'Q'.$key.' :'.substrwords($question->selectTitle(), ICON_SIZE_SMALL); - - if (isset($select_question[$i]) && $questionid == $select_question[$i]) { - $selected = 'selected="selected"'; - } - - $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 .= ''; - } - ?> - - - - - selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> - - - - - - - - - - - - - - selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> - - - - - - - - - - selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> - - - - - - - - - - - - - selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> - - - - - - - - 'TestProposedAnswer', - 'cols-size' => [0, 12, 0] - ); - $form->addHtmlEditor('comment['.$i.']', null, false, false, $config); - $renderer = $form->defaultRenderer(); - $form_template = '{content}'; - $renderer->setFormTemplate($form_template); - $element_template = ' - {label} - {element}'; - $renderer->setElementTemplate($element_template); - - $form->setDefaults(array('comment['.$i.']' => $commentValue)); - $return = $form->return_form(); - ?> - - - - - + + + + + selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { + echo ''; + if ($answerType == HOT_SPOT_DELINEATION) { + echo ''; } - - $list = new LearnpathList(api_get_user_id()); - $flat_list = $list->get_flat_list(); + } else { + echo ''; + } + ?> + + + + + 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_noerror) && $id == $lp_noerror) { - $selected = 'selected="selected"'; + if (isset($lp[$i]) && $id == $lp[$i]) { $isSelected = true; + $selected = 'selected="selected"'; } $option_lp .= ''; } @@ -944,93 +649,437 @@ if ($modifyAnswers) { if ($isSelected) { $option_lp = ''.$option_lp; } else { - $option_lp = ''.$option_lp; + $option_lp = ''.$option_lp; } // Feedback SELECT $question_list = $objExercise->selectQuestionList(); $option_feed = ''; $option_feed .= ''; - $details = isset($details) ? $details : null; - $id = isset($id) ? $id : 0; - $selectQuestionNoError = isset($selectQuestionNoError) ? $selectQuestionNoError : null; + foreach ($question_list as $key => $questionid) { $selected = ''; $question = Question::read($questionid); $val = 'Q'.$key.' :'.substrwords($question->selectTitle(), ICON_SIZE_SMALL); - if ($questionid == $selectQuestionNoError) { + + if (isset($select_question[$i]) && $questionid == $select_question[$i]) { $selected = 'selected="selected"'; } + $option_feed .= ''; } - if ($selectQuestionNoError == -1) { + + if (isset($select_question[$i]) && $select_question[$i] == -1) { $option_feed .= ''; } else { $option_feed .= ''; } - if ($answerType == HOT_SPOT_DELINEATION) { + //-------- 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 .= ''; + } ?> - - selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> - - - - - - + + + + selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> + + + + + + + + + - - selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> - - + + + + + + selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> + + + + + + + + + + + + + selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> + + + + + + + + 'TestProposedAnswer', + 'cols-size' => [0, 12, 0] + ); + $form->addHtmlEditor('comment['.$i.']', null, false, false, $config); + $renderer = $form->defaultRenderer(); + $form_template = '{content}'; + $renderer->setFormTemplate($form_template); + $element_template = ' + {label} + {element}'; + $renderer->setElementTemplate($element_template); + + $form->setDefaults(array('comment['.$i.']' => $commentValue)); + $return = $form->return_form(); + ?> + + + -
  * - - *
- - - -

-

- - -

-

- - -

-

- - -

-
-

- - -

- - -
-
-

- -

-
-

- - -

-

- - -

-

- - -

-
 
- - - - - - - - - - - - -
-
-

- -

-
-

- - -

-

-
- -

-

-
- -

-
-
 
 * 
- - - - - - - - -
-

- -

-
-

- - -

-

- - -

-

- - -

-
 
- - - - - - - - - - - - - -
  *'.get_lang('Comment').''.get_lang('Scenario').''.get_lang('Comment').' *
  + + + +

+

+ + +

+

+ + +

+

+ + +

+
+

+ + +

+ + +
+
+

+ +

+
+

+ + +

+

+ + +

+

+ + +

+
 
+ + + + + - + + -
-

- -

-
-

-
- -

-

-
- -

-

-
- -

+ + + + +
+
+

+ +

+
+

+ + +

+

+
+ +

+

+
+ +

+
    
 * 
+ + + + + + + + +
+

+ +

+
+

+ + +

+

+ + +

+

+ + +

+
 
+ + + + + + + + + + + + -
+ + + get_flat_list(); + $option_lp = ''; + $isSelected = false; + foreach ($flat_list as $id => $details) { + $selected = ''; + if (isset($lp_noerror) && $id == $lp_noerror) { + $selected = 'selected="selected"'; + $isSelected = true; + } + $option_lp .= ''; + } + + if ($isSelected) { + $option_lp = ''.$option_lp; + } else { + $option_lp = '' + .$option_lp; + } + + // Feedback SELECT + $question_list = $objExercise->selectQuestionList(); + $option_feed = ''; + $option_feed .= ''; + $selectQuestionNoError = isset($selectQuestionNoError) ? $selectQuestionNoError : null; + foreach ($question_list as $key => $questionid) { + $selected = ''; + $question = Question::read($questionid); + $val = 'Q'.$key.' :'.substrwords($question->selectTitle(), ICON_SIZE_SMALL); + if ($questionid == $selectQuestionNoError) { + $selected = 'selected="selected"'; + } + $option_feed .= ''; + } + if ($selectQuestionNoError == -1) { + $option_feed .= ''; + } else { + $option_feed .= ''; + } + + if ($answerType == HOT_SPOT_DELINEATION) { + ?> + + + selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> + + + + + +   + + + + + + + + + selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> + +
+

+ +

+
+

+
+ +

+

+
+ +

+

+
+ +

+ +   + +   + + + + +
- +
@@ -1039,19 +1088,19 @@ if ($modifyAnswers) {