diff --git a/main/exercise/Draggable.php b/main/exercise/Draggable.php index d099d1d065..2b307d9c11 100644 --- a/main/exercise/Draggable.php +++ b/main/exercise/Draggable.php @@ -79,7 +79,7 @@ class Draggable extends Question $defaults['orientation'] = 'h'; } - for ($i = 1; $i <= $nb_matches; ++$i) { + for ($i = 1; $i <= $nb_matches; $i++) { $matches[$i] = $i; } @@ -111,7 +111,7 @@ class Draggable extends Question echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'); } - for ($i = 1; $i <= $nb_matches; ++$i) { + for ($i = 1; $i <= $nb_matches; $i++) { $renderer = &$form->defaultRenderer(); $renderer->setElementTemplate( '{error}{element}', @@ -182,13 +182,13 @@ class Draggable extends Question $position = 0; $objAnswer = new Answer($this->id); // Insert the options - for ($i = 1; $i <= $nb_matches; ++$i) { + for ($i = 1; $i <= $nb_matches; $i++) { $position++; $objAnswer->createAnswer($position, 0, '', 0, $position); } // Insert the answers - for ($i = 1; $i <= $nb_matches; ++$i) { + for ($i = 1; $i <= $nb_matches; $i++) { $position++; $answer = $form->getSubmitValue('answer['.$i.']'); $matches = $form->getSubmitValue('matches['.$i.']'); diff --git a/main/exercise/MatchingDraggable.php b/main/exercise/MatchingDraggable.php index b32d1c8103..0a8a027704 100644 --- a/main/exercise/MatchingDraggable.php +++ b/main/exercise/MatchingDraggable.php @@ -81,12 +81,12 @@ class MatchingDraggable extends Question } if (empty($matches)) { - for ($i = 1; $i <= $nb_options; ++$i) { + for ($i = 1; $i <= $nb_options; $i++) { // fill the array with A, B, C..... $matches[$i] = chr(64 + $i); } } else { - for ($i = $counter; $i <= $nb_options; ++$i) { + for ($i = $counter; $i <= $nb_options; $i++) { // fill the array with A, B, C..... $matches[$i] = chr(64 + $i); } @@ -121,7 +121,7 @@ class MatchingDraggable extends Question 'Height' => '125', ]; - for ($i = 1; $i <= $nb_matches; ++$i) { + for ($i = 1; $i <= $nb_matches; $i++) { $renderer = &$form->defaultRenderer(); $renderer->setElementTemplate( '{error}{element}', @@ -174,7 +174,7 @@ class MatchingDraggable extends Question echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'); } - for ($i = 1; $i <= $nb_options; ++$i) { + for ($i = 1; $i <= $nb_options; $i++) { $renderer = &$form->defaultRenderer(); $renderer->setElementTemplate( @@ -232,14 +232,14 @@ class MatchingDraggable extends Question $objAnswer = new Answer($this->id); // Insert the options - for ($i = 1; $i <= $nb_options; ++$i) { + for ($i = 1; $i <= $nb_options; $i++) { $position++; $option = $form->getSubmitValue("option[$i]"); $objAnswer->createAnswer($option, 0, '', 0, $position); } // Insert the answers - for ($i = 1; $i <= $nb_matches; ++$i) { + for ($i = 1; $i <= $nb_matches; $i++) { $position++; $answer = $form->getSubmitValue("answer[$i]"); $matches = $form->getSubmitValue("matches[$i]"); diff --git a/main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php b/main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php index 5a58f302f5..2d969603f5 100644 --- a/main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php +++ b/main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php @@ -104,7 +104,7 @@ class MultipleAnswerTrueFalseDegreeCertainty extends Question // Can be more options $optionData = Question::readQuestionOption($this->id, $courseId); - for ($i = 1; $i <= $nbAnswers; ++$i) { + for ($i = 1; $i <= $nbAnswers; $i++) { $renderer->setElementTemplate( '{error}
{element}', 'correct['.$i.']' diff --git a/main/exercise/UniqueAnswerImage.php b/main/exercise/UniqueAnswerImage.php index 39e003ebc9..984cb4ad58 100644 --- a/main/exercise/UniqueAnswerImage.php +++ b/main/exercise/UniqueAnswerImage.php @@ -122,7 +122,7 @@ class UniqueAnswerImage extends UniqueAnswer echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer')); } - for ($i = 1; $i <= $numberAnswers; ++$i) { + for ($i = 1; $i <= $numberAnswers; $i++) { $form->addHtml(''); if (isset($answer) && is_object($answer)) { if ($answer->correct[$i]) { diff --git a/main/exercise/calculated_answer.class.php b/main/exercise/calculated_answer.class.php index bfdffd732c..de86b73e7c 100644 --- a/main/exercise/calculated_answer.class.php +++ b/main/exercise/calculated_answer.class.php @@ -209,7 +209,7 @@ class CalculatedAnswer extends Question $auxFormula = $formula; $nb = preg_match_all('/\[[^\]]*\]/', $auxAnswer, $blanks); if ($nb > 0) { - for ($i = 0; $i < $nb; ++$i) { + for ($i = 0; $i < $nb; $i++) { $blankItem = $blanks[0][$i]; // take random float values when one or both edge values have a decimal point diff --git a/main/exercise/export/scorm/ScormSection.php b/main/exercise/export/scorm/ScormSection.php index 4220f9677c..b697ea4609 100644 --- a/main/exercise/export/scorm/ScormSection.php +++ b/main/exercise/export/scorm/ScormSection.php @@ -215,7 +215,7 @@ class ScormSection list($jstmp, $htmltmp) = ScormQuestion::export_question($q, false, $js_id); $js .= $jstmp."\n"; $html .= $htmltmp."\n"; - ++$js_id; + $js_id++; } return [$js, $html]; diff --git a/main/exercise/fill_blanks.class.php b/main/exercise/fill_blanks.class.php index ed466e7943..9cbe687ab7 100755 --- a/main/exercise/fill_blanks.class.php +++ b/main/exercise/fill_blanks.class.php @@ -436,7 +436,7 @@ class FillBlanks extends Question if ($nb > 0) { $answer .= '::'; // weighting - for ($i = 0; $i < $nb; ++$i) { + for ($i = 0; $i < $nb; $i++) { // enter the weighting of word $i $answer .= $form->getSubmitValue('weighting['.$i.']'); // not the last word, add "," @@ -449,7 +449,7 @@ class FillBlanks extends Question // input width $answer .= ":"; - for ($i = 0; $i < $nb; ++$i) { + for ($i = 0; $i < $nb; $i++) { // enter the width of input for word $i $answer .= $form->getSubmitValue('sizeofinput['.$i.']'); // not the last word, add "," diff --git a/main/exercise/global_multiple_answer.class.php b/main/exercise/global_multiple_answer.class.php index d998222c34..7c12e4c509 100755 --- a/main/exercise/global_multiple_answer.class.php +++ b/main/exercise/global_multiple_answer.class.php @@ -78,7 +78,7 @@ class GlobalMultipleAnswer extends Question $scoreG = "0"; //Global /* boucle pour sauvegarder les donn�es dans le tableau defaults */ - for ($i = 1; $i <= $nb_answers; ++$i) { + for ($i = 1; $i <= $nb_answers; $i++) { /* si la reponse est de type objet */ if (is_object($answer)) { $defaults['answer['.$i.']'] = $answer->answer[$i]; diff --git a/main/exercise/matching.class.php b/main/exercise/matching.class.php index 6da1c4a602..232485fc74 100755 --- a/main/exercise/matching.class.php +++ b/main/exercise/matching.class.php @@ -88,12 +88,12 @@ class Matching extends Question } if (empty($matches)) { - for ($i = 1; $i <= $nb_options; ++$i) { + for ($i = 1; $i <= $nb_options; $i++) { // fill the array with A, B, C..... $matches[$i] = chr(64 + $i); } } else { - for ($i = $counter; $i <= $nb_options; ++$i) { + for ($i = $counter; $i <= $nb_options; $i++) { // fill the array with A, B, C..... $matches[$i] = chr(64 + $i); } @@ -130,7 +130,7 @@ class Matching extends Question 'Height' => '125', ]; - for ($i = 1; $i <= $nb_matches; ++$i) { + for ($i = 1; $i <= $nb_matches; $i++) { $renderer = &$form->defaultRenderer(); $renderer->setElementTemplate( '{error}{element}', @@ -193,7 +193,7 @@ class Matching extends Question ); } - for ($i = 1; $i <= $nb_options; ++$i) { + for ($i = 1; $i <= $nb_options; $i++) { $renderer = &$form->defaultRenderer(); $renderer->setElementTemplate( '{error}{element}', @@ -251,14 +251,14 @@ class Matching extends Question $objAnswer = new Answer($this->id); // Insert the options - for ($i = 1; $i <= $nb_options; ++$i) { + for ($i = 1; $i <= $nb_options; $i++) { $position++; $option = $form->getSubmitValue('option['.$i.']'); $objAnswer->createAnswer($option, 0, '', 0, $position); } // Insert the answers - for ($i = 1; $i <= $nb_matches; ++$i) { + for ($i = 1; $i <= $nb_matches; $i++) { $position++; $answer = $form->getSubmitValue('answer['.$i.']'); $matches = $form->getSubmitValue('matches['.$i.']'); diff --git a/main/exercise/multiple_answer.class.php b/main/exercise/multiple_answer.class.php index 8b0ce5a3da..28feca6af9 100755 --- a/main/exercise/multiple_answer.class.php +++ b/main/exercise/multiple_answer.class.php @@ -80,7 +80,7 @@ class MultipleAnswer extends Question echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer')); } - for ($i = 1; $i <= $nb_answers; ++$i) { + for ($i = 1; $i <= $nb_answers; $i++) { $form->addHtml(''); if (is_object($answer)) { $defaults['answer['.$i.']'] = $answer->answer[$i]; diff --git a/main/exercise/multiple_answer_combination.class.php b/main/exercise/multiple_answer_combination.class.php index 7cf2b0a0d8..6354f749ba 100755 --- a/main/exercise/multiple_answer_combination.class.php +++ b/main/exercise/multiple_answer_combination.class.php @@ -72,7 +72,7 @@ class MultipleAnswerCombination extends Question echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer')); } - for ($i = 1; $i <= $nb_answers; ++$i) { + for ($i = 1; $i <= $nb_answers; $i++) { $form->addHtml(''); if (is_object($answer)) { diff --git a/main/exercise/multiple_answer_true_false.class.php b/main/exercise/multiple_answer_true_false.class.php index 4b089b4383..deb8391107 100755 --- a/main/exercise/multiple_answer_true_false.class.php +++ b/main/exercise/multiple_answer_true_false.class.php @@ -83,7 +83,7 @@ class MultipleAnswerTrueFalse extends Question // Can be more options $optionData = Question::readQuestionOption($this->id, $course_id); - for ($i = 1; $i <= $nb_answers; ++$i) { + for ($i = 1; $i <= $nb_answers; $i++) { $form->addHtml(''); $renderer->setElementTemplate( diff --git a/main/exercise/unique_answer.class.php b/main/exercise/unique_answer.class.php index b0daaadcc5..3b41c8c0dd 100755 --- a/main/exercise/unique_answer.class.php +++ b/main/exercise/unique_answer.class.php @@ -130,7 +130,7 @@ class UniqueAnswer extends Question ); } - for ($i = 1; $i <= $nb_answers; ++$i) { + for ($i = 1; $i <= $nb_answers; $i++) { $form->addHtml(''); if (isset($answer) && is_object($answer)) { if (isset($answer->correct[$i]) && $answer->correct[$i]) { diff --git a/main/exercise/unique_answer_no_option.class.php b/main/exercise/unique_answer_no_option.class.php index d8b5e3cfc0..3ee0f9fe2e 100755 --- a/main/exercise/unique_answer_no_option.class.php +++ b/main/exercise/unique_answer_no_option.class.php @@ -105,14 +105,14 @@ class UniqueAnswerNoOption extends Question $nb_answers--; } } - for ($k = 1; $k <= $nb_answers; ++$k) { + for ($k = 1; $k <= $nb_answers; $k++) { if ($answer->position[$k] != '666') { $new_list[$count] = $count; $count++; } } } else { - for ($k = 1; $k <= $nb_answers; ++$k) { + for ($k = 1; $k <= $nb_answers; $k++) { $new_list[$k] = $k; } } diff --git a/main/lp/aicc.class.php b/main/lp/aicc.class.php index be9c38a69e..9fe1e570d3 100755 --- a/main/lp/aicc.class.php +++ b/main/lp/aicc.class.php @@ -1065,7 +1065,7 @@ class aicc extends learnpath case $enclosure: if ($enclosed && $data[$i + 1] == $enclosure) { $fldval .= $chr; - ++$i; // Skip the next character. + $i++; // Skip the next character. } else { $enclosed = !$enclosed; }