From 2cb16d8f9be3788cbf75bd61232a208d7805ce50 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 28 Feb 2007 17:15:45 +0000 Subject: [PATCH] Minor improvement to validation code. Merged from MOODLE_18_STABLE. --- question/type/shortanswer/edit_shortanswer_form.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/question/type/shortanswer/edit_shortanswer_form.php b/question/type/shortanswer/edit_shortanswer_form.php index 54b9e6f9df..776f9e0ff7 100644 --- a/question/type/shortanswer/edit_shortanswer_form.php +++ b/question/type/shortanswer/edit_shortanswer_form.php @@ -68,13 +68,10 @@ class question_edit_shortanswer_form extends question_edit_form { $answers = $data['answer']; $answercount = 0; $maxgrade = false; - foreach ($answers as $key => $answer){ + foreach ($answers as $key => $answer) { $trimmedanswer = trim($answer); if (!empty($trimmedanswer)){ $answercount++; - } - // Check grades - if ($answer != '') { if ($data['fraction'][$key] == 1) { $maxgrade = true; } -- 2.39.5