]> git.mjollnir.org Git - moodle.git/commitdiff
Now ignore hidden questions. Bug #4988
authorthepurpleblob <thepurpleblob>
Fri, 28 Apr 2006 09:36:17 +0000 (09:36 +0000)
committerthepurpleblob <thepurpleblob>
Fri, 28 Apr 2006 09:36:17 +0000 (09:36 +0000)
question/format.php

index cc737d6881a77266b6f6231357960642c21709d6..90cf4c9b2041de23d1acd2ba0baa6868af89ffd9 100644 (file)
@@ -297,14 +297,21 @@ class qformat_default {
 
         // iterate through questions
         foreach($questions as $question) {
-          $count++;
-          $qtype = $question->qtype;
-          // ignore random questiond
-          if ($qtype!=RANDOM) {
-              echo "<hr /><p><b>$count</b>. ".stripslashes($question->questiontext)."</p>";
-              $expout .= $this->writequestion( $question ) . "\n";
-              }
-          }
+            // do not export hidden questions
+            if (!empty($question->hidden)) {
+                continue;
+            }
+
+            // do not export random questions
+            if ($question->qtype==RANDOM) {
+                continue;
+            }
+
+        // export the question displaying message
+        $count++;
+        echo "<hr /><p><b>$count</b>. ".stripslashes($question->questiontext)."</p>";
+        $expout .= $this->writequestion( $question ) . "\n";
+        }
 
         // final pre-process on exported data
         $expout = $this->presave_process( $expout );