From 47c03ecd8dc44d82e32efca282e8c3585cb4d98c Mon Sep 17 00:00:00 2001 From: pichetp Date: Fri, 15 Aug 2008 11:15:26 +0000 Subject: [PATCH] better filtering of null answers MDL-8475 --- question/type/numerical/questiontype.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/question/type/numerical/questiontype.php b/question/type/numerical/questiontype.php index cc3cf8407d..68cca25d1c 100644 --- a/question/type/numerical/questiontype.php +++ b/question/type/numerical/questiontype.php @@ -108,7 +108,7 @@ class question_numerical_qtype extends question_shortanswer_qtype { // Insert all the new answers foreach ($question->answer as $key => $dataanswer) { - if (!isset( $question->deleteanswer[$key] ) && !( trim($dataanswer) == 0 && $question->fraction[$key]== 0 &&trim($question->feedback[$key])=='')) { + if ( !( trim($dataanswer)=='' && $question->fraction[$key]== 0 && trim($question->feedback[$key])=='')) { $answer = new stdClass; $answer->question = $question->id; if (trim($dataanswer) == '*') { @@ -182,7 +182,6 @@ class question_numerical_qtype extends question_shortanswer_qtype { if (!empty($result->notice)) { return $result; } - return true; } -- 2.39.5