better filtering of null answers MDL-8475
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user