From: jamiesensei Date: Fri, 19 Jan 2007 07:20:43 +0000 (+0000) Subject: oops. fix to last commit about empty answers logic was wrong X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=845b703bb9a45046008208cbf450c304bf097ed1;p=moodle.git oops. fix to last commit about empty answers logic was wrong --- diff --git a/question/type/calculated/edit_calculated_form.php b/question/type/calculated/edit_calculated_form.php index 4cc3b4fa06..bcc9de6c0f 100644 --- a/question/type/calculated/edit_calculated_form.php +++ b/question/type/calculated/edit_calculated_form.php @@ -176,13 +176,13 @@ class question_edit_calculated_form extends question_edit_form { foreach ($answers as $key => $answer){ //check no of choices $trimmedanswer = trim($answer); - if (($trimmedanswer=='')||$answercount==0){ + if (($trimmedanswer!='')||$answercount==0){ $eqerror = qtype_calculated_find_formula_errors($trimmedanswer); if (FALSE !== $eqerror){ $errors['answers['.$key.']'] = $eqerror; } } - if ($trimmedanswer==''){ + if ($trimmedanswer!=''){ if ('2' == $data['correctanswerformat'][$key] && '0' == $data['correctanswerlength'][$key]) { $errors['correctanswerlength['.$key.']'] = get_string('zerosignificantfiguresnotallowed','quiz');