]> git.mjollnir.org Git - moodle.git/commitdiff
A couple of changes to Pierre's calculated question import/export
authorthepurpleblob <thepurpleblob>
Wed, 28 Mar 2007 11:58:44 +0000 (11:58 +0000)
committerthepurpleblob <thepurpleblob>
Wed, 28 Mar 2007 11:58:44 +0000 (11:58 +0000)
export_process and import_process flags now apply to all questions
and what looked like a development print_r has been commented out.

question/editlib.php
question/format.php
question/format/xml/format.php

index c8b518a8056bc72e38a3321c14386b1dc014d940..0ecd24aa3f02522f1b022946b3f3e62468fa1440 100644 (file)
@@ -22,9 +22,10 @@ define('DEFAULT_QUESTIONS_PER_PAGE', 20);
 * @param int $category category number
 * @param bool $noparent if true only questions with NO parent will be selected
 * @param bool $recurse include subdirectories
+* @param bool $export set true if this is called by questionbank export
 * @author added by Howard Miller June 2004
 */
-function get_questions_category( $category, $noparent=false, $recurse=true ) {
+function get_questions_category( $category, $noparent=false, $recurse=true, $export=true ) {
 
     global $QTYPES;
 
@@ -51,6 +52,7 @@ function get_questions_category( $category, $noparent=false, $recurse=true ) {
         // iterate through questions, getting stuff we need
         foreach($questions as $question) {
             $questiontype = $QTYPES[$question->qtype];
+            $question->export_process = $export;
             $questiontype->get_question_options( $question );
             $qresults[] = $question;
         }
@@ -394,4 +396,4 @@ function question_list($course, $categoryid, $quizid=0,
     echo "</form>\n";
 }
 
-?>
\ No newline at end of file
+?>
index 94ad5f62b3380c22e77c06ca63f1f3de9b9e5a5d..5619926b40b18ad1a732ff188f00ebb00556f161 100644 (file)
@@ -314,6 +314,10 @@ class qformat_default {
         $question->partiallycorrectfeedback = '';
         $question->incorrectfeedback = '';
 
+        // this option in case the questiontypes class wants
+        // to know where the data came from
+        $question->export_process = true;
+
         return $question;
     }
 
index 5b98c489b263984c55e7512ca3fdc5aa1cb99d61..c4b4e6cda11284fd04605d330d1a129bc1e33a5e 100755 (executable)
@@ -529,9 +529,7 @@ class qformat_xml extends qformat_default {
           } 
         }
                 
-                echo "<pre>loaded qo";print_r($qo);echo "</pre>";
-
-        $qo->import_process = true ; // flag for question_save_options()
+                // echo "<pre>loaded qo";print_r($qo);echo "</pre>";
 
         return $qo;
     }