From: tjhunt Date: Mon, 10 Dec 2007 11:57:24 +0000 (+0000) Subject: Fix notice in numerical question. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c85aea03d3d554aea893d913b0d45cb5e185de93;p=moodle.git Fix notice in numerical question. --- diff --git a/question/type/numerical/questiontype.php b/question/type/numerical/questiontype.php index 8a07800daf..f4449591dc 100644 --- a/question/type/numerical/questiontype.php +++ b/question/type/numerical/questiontype.php @@ -267,7 +267,8 @@ class question_numerical_qtype extends question_shortanswer_qtype { function get_correct_responses(&$question, &$state) { $correct = parent::get_correct_responses($question, $state); - if ($correct[''] != '*' && $unit = $this->get_default_numerical_unit($question)) { + $unit = $this->get_default_numerical_unit($question); + if (isset($correct['']) && $correct[''] != '*' && $unit) { $correct[''] .= ' '.$unit->unit; } return $correct;