From dfdc6e36f51c572b02e7f4ab704b9a522516a0cb Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 25 May 2012 19:03:59 +0200 Subject: [PATCH] Undo multiple answer changes see #4801 --- main/exercice/exercise.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main/exercice/exercise.class.php b/main/exercice/exercise.class.php index 51a8f926f4..3e58811325 100644 --- a/main/exercice/exercise.class.php +++ b/main/exercice/exercise.class.php @@ -2864,6 +2864,9 @@ class Exercise { //Fixes multiple answer question in order to be exact if ($answerType == MULTIPLE_ANSWER) { + $diff = @array_diff($answer_correct_array, $real_answers); + /* + * All good answers or nothing works like exact $counter = 1; $correct_answer = true; foreach ($real_answers as $my_answer) { @@ -2873,12 +2876,15 @@ class Exercise { break; } $counter++; - } + }*/ if ($debug) error_log(" answer_correct_array: ".print_r($answer_correct_array, 1).""); if ($debug) error_log(" real_answers: ".print_r($real_answers, 1).""); - if ($debug) error_log(" correct_answer: ".$correct_answer); + //if ($debug) error_log(" correct_answer: ".$correct_answer); - if ($correct_answer == false) { + /*if ($correct_answer == false) { + $questionScore = 0; + }*/ + if (!empty($diff)) { $questionScore = 0; } }