]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19519 , MDL-1728 Adding database question_calculated_options
authorpichetp <pichetp>
Sat, 22 Aug 2009 15:38:51 +0000 (15:38 +0000)
committerpichetp <pichetp>
Sat, 22 Aug 2009 15:38:51 +0000 (15:38 +0000)
question/format/xml/format.php

index 0d69e44f773ac0ac6336846fe919c5a3e3cd3ea6..e089b4e6ef4b5b0bd2598062d30b05925ab0a53c 100755 (executable)
@@ -415,7 +415,7 @@ class qformat_xml extends qformat_default {
 
         // header parts particular to numerical
         $qo->qtype = CALCULATED ;//CALCULATED;
-
+        $qo->synchronize = $this->getpath( $question, array( '#','synchronize',0,'#' ), 0 );
         // get answers array
        // echo "<pre> question";print_r($question);echo "</pre>";
         $answers = $question['#']['answer'];
@@ -948,6 +948,12 @@ class qformat_xml extends qformat_default {
             }
             break;
         case CALCULATED:
+            if (!empty($question->options->synchronize)) {
+                $expout .= "    <synchronize>{$question->options->synchronize}</synchronize>\n";
+            }
+            else {
+                $expout .= "    <synchronize>0</synchronize>\n";
+            }
         case CALCULATEDSIMPLE:
             foreach ($question->options->answers as $answer) {
                 $tolerance = $answer->tolerance;