From 19623c973c33027d83b30cd5eb4477b42eef52a2 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 28 Feb 2007 17:15:23 +0000 Subject: [PATCH] Minor improvement to validation code. --- 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 54b9e6f9dff..776f9e0ff73 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; }