]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18034 saving answers data in $question->answer if they come from edit from.
authorpichetp <pichetp>
Tue, 27 Jan 2009 15:00:19 +0000 (15:00 +0000)
committerpichetp <pichetp>
Tue, 27 Jan 2009 15:00:19 +0000 (15:00 +0000)
question/type/calculated/questiontype.php

index 7db457554663d3e8ca13815a87fdcd95db044b37..b7c20d669a36c32a1b760407220c386103c5dd8a 100644 (file)
@@ -149,6 +149,9 @@ class question_calculated_qtype extends default_questiontype {
             $units = &$result->units;
         }
         // Insert all the new answers
+        if (isset($question->answer) && !isset($question->answers)) {
+            $question->answers=$question->answer;
+        }
         foreach ($question->answers as $key => $dataanswer) {
             if (  trim($dataanswer) != '' ) {
                 $answer = new stdClass;