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

This commit is contained in:
Tim Hunt
2011-11-20 12:05:18 +00:00
parent f28832d5c0
commit fef14d0fc8
2 changed files with 39 additions and 39 deletions
-22
View File
@@ -866,26 +866,4 @@ class qformat_default {
$text = $question->questiontext;
return format_text(html_to_text($text, 0, false), $format, $formatoptions);
}
/**
* convert files into text output in the given format.
* @param array
* @param string encoding method
* @return string $string
*/
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;
}
}