Blackboard V5 and V6 question importer.
Copyright: | 2012 Jean-Michel Vedrine |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 155 lines (6 kb) |
Included or required: | 0 times |
Referenced: | 1 time |
Includes or requires: | 0 files |
qformat_blackboard_six_base:: (8 methods):
provide_import()
can_import_file()
mime_type()
importpostprocess()
set_filebase()
store_file_for_text_field()
text_field()
cleaned_text_field()
Class: qformat_blackboard_six_base - X-Ref
Base class question import format for zip files with imagesprovide_import() X-Ref |
This plugin provide import return: bool true |
can_import_file($file) X-Ref |
Check if the given file is capable of being imported by this plugin. As {@link file_storage::mimetype()} may use finfo PHP extension if available, the value returned by $file->get_mimetype for a .dat file is not the same on all servers. So we must made 2 checks to verify if the plugin can import the file. param: stored_file $file the file to check return: bool whether this plugin can import the file |
mime_type() X-Ref |
No description |
importpostprocess() X-Ref |
Does any post-processing that may be desired Clean the temporary directory if a zip file was imported return: bool success |
set_filebase($path) X-Ref |
Set the path to the root of images tree param: string $path path to images root |
store_file_for_text_field(&$text, $tempdir, $filepathinsidetempdir, $filename) X-Ref |
Store an image file in a draft filearea param: array $text, if itemid element don't exists it will be created param: string $tempdir path to root of image tree param: string $filepathinsidetempdir path to image in the tree param: string $filename image's name return: string new name of the image as it was stored |
text_field($text) X-Ref |
Given an HTML text with references to images files, store all images in a draft filearea, and return an array with all urls in text recoded, format set to FORMAT_HTML, and itemid set to filearea itemid param: string $text text to parse and recode return: array with keys text, format, itemid. |
cleaned_text_field($text) X-Ref |
Same as text_field but text is cleaned. param: string $text text to parse and recode return: array with keys text, format, itemid. |