]> git.mjollnir.org Git - moodle.git/commitdiff
Changed export part so that export file extension can be changed
authorthepurpleblob <thepurpleblob>
Fri, 6 Aug 2004 11:09:22 +0000 (11:09 +0000)
committerthepurpleblob <thepurpleblob>
Fri, 6 Aug 2004 11:09:22 +0000 (11:09 +0000)
by overriding export_file_extension() method

mod/quiz/format.php

index bd9339ea737dd3f1ed8c753c516ca77b513b56a1..6f5d9c4456cb0e6af155dfa228dc3f27e1b83657 100644 (file)
@@ -148,6 +148,13 @@ class quiz_default_format {
 // Export functions
 
 
+    function export_file_extension() {
+    /// return the files extension appropriate for this type
+    /// override if you don't want .txt
+  
+        return ".txt";
+    }
+
     function exportpreprocess($category, $course) {
     /// Does any pre-processing that may be desired
 
@@ -191,7 +198,7 @@ class quiz_default_format {
           }
 
         // write file
-        $filepath = $path."/".$filename;
+        $filepath = $path."/".$filename . $this->export_file_extension();
         if (!$fh=fopen($filepath,"w")) {
             error("Cannot open for writing: $filepath");
         }