]> git.mjollnir.org Git - moodle.git/commitdiff
Fix notice in numerical question.
authortjhunt <tjhunt>
Mon, 10 Dec 2007 11:57:24 +0000 (11:57 +0000)
committertjhunt <tjhunt>
Mon, 10 Dec 2007 11:57:24 +0000 (11:57 +0000)
question/type/numerical/questiontype.php

index 8a07800dafa423d6e0f9fcb514477d0545a14856..f4449591dcd42e9e92920dbd888f0179f4fdd57a 100644 (file)
@@ -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;