diff --git a/main/exercice/Draggable.php b/main/exercice/Draggable.php index c68f8d4c53..467dee15c3 100644 --- a/main/exercice/Draggable.php +++ b/main/exercice/Draggable.php @@ -1,5 +1,4 @@ nbrAnswers) > 0) { $nb_matches = $nb_options = 0; - + for ($i = 1; $i <= $answer->nbrAnswers; $i++) { if ($answer->isCorrect($i)) { $nb_matches++; @@ -134,7 +133,6 @@ class Draggable extends Question } $form->addHtml(''); - $group = array(); $renderer->setElementTemplate( '
{element}', @@ -220,5 +218,4 @@ class Draggable extends Question return $header; } - } diff --git a/main/exercice/MatchingDraggable.php b/main/exercice/MatchingDraggable.php index f3516052f1..8ef359c389 100644 --- a/main/exercice/MatchingDraggable.php +++ b/main/exercice/MatchingDraggable.php @@ -1,5 +1,4 @@ addRule('answerVariations', get_lang('GiveAnswerVariations'),'required'); $form->setDefaults(array('answerVariations' => '1')); - global $text, $class; + global $text; // setting the save button here and not in the question class.php $form->addButtonSave($text, 'submitQuestion'); @@ -273,6 +274,7 @@ class CalculatedAnswer extends Question ) ) ); + return empty($result) ? false : true; } } diff --git a/main/exercice/fill_blanks.class.php b/main/exercice/fill_blanks.class.php index 5a13b8e1ce..55653c205f 100755 --- a/main/exercice/fill_blanks.class.php +++ b/main/exercice/fill_blanks.class.php @@ -288,8 +288,6 @@ class FillBlanks extends Question */ public function processAnswersCreation($form) { - global $charset; - $answer = $form->getSubmitValue('answer'); // Due the ckeditor transform the elements to their HTML value @@ -342,9 +340,9 @@ class FillBlanks extends Question

I use a [computer] and a [pen].

becomes

I use a [computer] and a [pen].

::100,50:100,50@1 - ++++++++-------** - --- -- --- -- - - A B (C) (D)(E) + ++++++++-------** + --- -- --- -- - + A B (C) (D)(E) +++++++ : required, weighting of each words ------- : optional, input width to display, 200 if not present ** : equal @1 if "Allow answers order switches" has been checked, @ otherwise diff --git a/main/exercice/freeanswer.class.php b/main/exercice/freeanswer.class.php index 9396a176b8..090266bda6 100755 --- a/main/exercice/freeanswer.class.php +++ b/main/exercice/freeanswer.class.php @@ -25,11 +25,11 @@ class FreeAnswer extends Question /** * function which redifines Question::createAnswersForm - * @param the formvalidator instance + * @param formvalidator $form */ function createAnswersForm($form) { - $form->addElement('text', 'weighting', get_lang('Weighting'), array('class' => 'span1')); + $form->addElement('text', 'weighting', get_lang('Weighting')); global $text, $class; // setting the save button here and not in the question class.php $form->addButtonSave($text, 'submitQuestion'); @@ -43,8 +43,8 @@ class FreeAnswer extends Question } /** - * abstract function which creates the form to create / edit the answers of the question - * @param FormValidator + * abstract function which creates the form to create/edit the answers of the question + * @param FormValidator $form */ function processAnswersCreation($form) { diff --git a/main/exercice/global_multiple_answer.class.php b/main/exercice/global_multiple_answer.class.php index 5b0fa1559d..17dd24b20c 100755 --- a/main/exercice/global_multiple_answer.class.php +++ b/main/exercice/global_multiple_answer.class.php @@ -21,7 +21,7 @@ class GlobalMultipleAnswer extends Question /** * function which redefines Question::createAnswersForm - * @param the FormValidator + * @param FormValidator $form */ public function createAnswersForm($form) { @@ -81,7 +81,7 @@ class GlobalMultipleAnswer extends Question $defaults['comment[' . $i . ']'] = $answer->comment[$i]; $defaults['correct[' . $i . ']'] = $answer->correct[$i]; - //------------- D�but + // start $scoreA = $answer->weighting[$i]; } if ($scoreA > 0) { @@ -162,7 +162,7 @@ class GlobalMultipleAnswer extends Question /** * abstract function which creates the form to create / edit the answers of the question - * @param the FormValidator instance + * @param FormValidator $form */ function processAnswersCreation($form) { diff --git a/main/exercice/multiple_answer_combination.class.php b/main/exercice/multiple_answer_combination.class.php index 1000d36405..0c9aaa39ff 100755 --- a/main/exercice/multiple_answer_combination.class.php +++ b/main/exercice/multiple_answer_combination.class.php @@ -1,5 +1,6 @@ edit_exercise_in_lp == true) { // setting the save button here and not in the question class.php @@ -289,7 +289,8 @@ class MultipleAnswerTrueFalse extends Question $comment = trim($form -> getSubmitValue('comment['.$i.']')); $goodAnswer = trim($form -> getSubmitValue('correct['.$i.']')); if (empty($options)) { - //If this is the first time that the question is created when change the default values from the form 1 and 2 by the correct "option id" registered + //If this is the first time that the question is created when + // change the default values from the form 1 and 2 by the correct "option id" registered $goodAnswer = $sorted_by_position[$goodAnswer]['id']; } $questionWeighting += $extra_values[0]; //By default 0 has the correct answers diff --git a/main/exercice/oral_expression.class.php b/main/exercice/oral_expression.class.php index 1a8100c681..17724e3e0b 100755 --- a/main/exercice/oral_expression.class.php +++ b/main/exercice/oral_expression.class.php @@ -1,5 +1,6 @@ addHtml(''); $form->addHtml(''); - $navigator_info = api_get_navigator(); - - global $text, $class; + global $text; $buttonGroup = []; //ie6 fix