Permalink
Browse files

Changed export part so that export file extension can be changed

by overriding export_file_extension() method
  • Loading branch information...
1 parent b4fe424 commit 3102622add56cbab05f3dce2b67554304cbf1d3a thepurpleblob committed Aug 6, 2004
Showing with 8 additions and 1 deletion.
  1. +8 −1 mod/quiz/format.php
View
@@ -148,6 +148,13 @@ function importpostprocess() {
// 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 @@ function exportprocess($filename) {
}
// write file
- $filepath = $path."/".$filename;
+ $filepath = $path."/".$filename . $this->export_file_extension();
if (!$fh=fopen($filepath,"w")) {
error("Cannot open for writing: $filepath");
}

0 comments on commit 3102622

Please sign in to comment.