]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20296 setting get_correct_responses()
authorpichetp <pichetp>
Sat, 10 Oct 2009 01:08:11 +0000 (01:08 +0000)
committerpichetp <pichetp>
Sat, 10 Oct 2009 01:08:11 +0000 (01:08 +0000)
question/type/numerical/questiontype.php

index 2deeec97c08a1d429cfffea07eedd0c38682f0d2..fa7fd31745ea48887c7bd745a12a97b7c27c4db4 100644 (file)
@@ -515,9 +515,11 @@ class question_numerical_qtype extends question_shortanswer_qtype {
     function get_correct_responses(&$question, &$state) {
         $correct = parent::get_correct_responses($question, $state);
         $unit = $this->get_default_numerical_unit($question);
+        $correct['answer']= $correct[''];
         if (isset($correct['']) && $correct[''] != '*' && $unit) {
             $correct[''] .= ' '.$unit->unit;
-        }
+            $correct['unit']= $unit->unit;
+        }       
         return $correct;
     }