MDL-29060 q export: writefiles should be public write_files & belongs to XML format.

This commit is contained in:
Tim Hunt
2011-11-20 11:49:41 +00:00
parent f218cdab34
commit 7e7fdf59c6
2 changed files with 35 additions and 36 deletions
-22
View File
@@ -876,26 +876,4 @@ class qformat_default {
return html_to_text(format_text($question->questiontext,
$question->questiontextformat, $formatoptions), 0, false);
}
/**
* convert files into text output in the given format.
* @param array
* @param string encoding method
* @return string $string
*/
protected function writefiles($files, $encoding='base64') {
if (empty($files)) {
return '';
}
$string = '';
foreach ($files as $file) {
if ($file->is_directory()) {
continue;
}
$string .= '<file name="' . $file->get_filename() . '" encoding="' . $encoding . '">';
$string .= base64_encode($file->get_content());
$string .= '</file>';
}
return $string;
}
}