Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added overidable method presave_process - allows last minute modifica…

…tion of

data to be exported to file. Done to get xml output working.
  • Loading branch information...
commit b1984b0d336d55bbb359b13f993568658f4808e2 1 parent 29a95fe
thepurpleblob authored
Showing with 12 additions and 3 deletions.
  1. +12 −3 mod/quiz/format.php
View
15 mod/quiz/format.php
@@ -164,6 +164,14 @@ function exportpreprocess($category, $course) {
return true;
}
+ function presave_process( $content ) {
+ /// enables any processing to be done on the content
+ /// just prior to the file being saved
+ /// default is to do nothing
+
+ return $content;
+ }
+
function exportprocess($filename) {
/// Exports a given category. There's probably little need to change this
@@ -194,9 +202,12 @@ function exportprocess($filename) {
foreach($questions as $question) {
$count++;
echo "<hr><p><b>$count</b>. ".stripslashes($question->questiontext)."</p>";
- $expout .= $this->writequestion( $question );
+ $expout .= $this->writequestion( $question ) . "\n";
}
+ // final pre-process on exported data
+ $expout = $this->presave_process( $expout );
+
// write file
$filepath = $path."/".$filename . $this->export_file_extension();
if (!$fh=fopen($filepath,"w")) {
@@ -212,8 +223,6 @@ function exportprocess($filename) {
function exportpostprocess() {
/// Does any post-processing that may be desired
- /// Argument is a simple array of question ids that
- /// have just been added.
return true;
}
Please sign in to comment.
Something went wrong with that request. Please try again.