From c85aea03d3d554aea893d913b0d45cb5e185de93 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Mon, 10 Dec 2007 11:57:24 +0000 Subject: [PATCH] Fix notice in numerical question. --- question/type/numerical/questiontype.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.39.5