Workshop conversion handler.
More...
|
| get_component_name () |
| Returns the normalized name of the plugin, eg mod_workshop. More...
|
|
| get_converter () |
|
| get_current_workshop () |
| Provides access to the current <workshop> data. More...
|
|
| get_inforef_manager () |
| Provides access to the instance's inforef manager. More...
|
|
| get_modname () |
| Returns the name of the module, eg. More...
|
|
| get_paths () |
| Declare the paths in moodle.xml we are able to convert. More...
|
|
| log ($message, $level, $a=null, $depth=null, $display=false) |
| This function will be responsible for handling the params, and to call to the corresponding logger->process() once all modifications in params have been performed. More...
|
|
| on_workshop_element_end () |
| This is executed when the parser reaches </ELEMENT>
|
|
| on_workshop_elements_end () |
| This is executed when the parser reaches </ELEMENTS>
|
|
| on_workshop_elements_start () |
| This is executed when the parser reaches <ELEMENTS> More...
|
|
| on_workshop_end () |
| This is executed when the parser reaches </MOD>
|
|
| process_workshop ($data, $raw) |
| This is executed every time we have one /MOODLE_BACKUP/COURSE/MODULES/MOD/WORKSHOP data available.
|
|
| process_workshop_element ($data, $raw) |
| Processes one <ELEMENT> tag from moodle.xml.
|
|
| process_workshop_element_rubric ($data, $raw) |
| Processes one <RUBRIC> tag from moodle.xml.
|
|
|
moodle1_converter | $converter |
|
array | $currentcminfo = null |
| in-memory cache for the course module information for the current workshop
|
|
array | $currentworkshop = null |
| the temporary in-memory cache for the current <MOD> contents
|
|
moodle1_file_manager | $fileman = null |
| for the current workshop
|
|
moodle1_inforef_manager | $inforefman = null |
|
array | $newelementids = array() |
| the mapping of legacy elementno => newelementid for the current workshop
|
|
string | $pluginname |
|
string | $plugintype |
|
null string | $xmlfilename |
| the name of file we are writing to
|
|
null xml_writer | $xmlwriter |
|
Workshop conversion handler.
◆ close_xml_writer()
moodle1_xml_handler::close_xml_writer |
( |
| ) |
|
|
protectedinherited |
Close the XML writer.
At the moment, the caller must close all tags before calling
- Return values
-
Reimplemented in moodle1_qtype_handler.
◆ get_cminfo()
moodle1_mod_handler::get_cminfo |
( |
|
$instance, |
|
|
|
$modname = null |
|
) |
| |
|
protectedinherited |
Returns course module information for the given instance id.
The information for this instance id has been stashed by moodle1_course_outline_handler::process_course_module()
- Parameters
-
int | $instance | the module instance id |
string | $modname | the module type, defaults to $this->pluginname |
- Return values
-
◆ get_component_name()
moodle1_plugin_handler::get_component_name |
( |
| ) |
|
|
inherited |
Returns the normalized name of the plugin, eg mod_workshop.
- Return values
-
◆ get_converter()
moodle1_handler::get_converter |
( |
| ) |
|
|
inherited |
◆ get_current_workshop()
moodle1_mod_workshop_handler::get_current_workshop |
( |
| ) |
|
Provides access to the current <workshop> data.
- Return values
-
◆ get_inforef_manager()
moodle1_mod_workshop_handler::get_inforef_manager |
( |
| ) |
|
Provides access to the instance's inforef manager.
- Return values
-
◆ get_modname()
moodle1_mod_handler::get_modname |
( |
| ) |
|
|
inherited |
Returns the name of the module, eg.
'forum'
- Return values
-
◆ get_paths()
moodle1_mod_workshop_handler::get_paths |
( |
| ) |
|
Declare the paths in moodle.xml we are able to convert.
The method returns list of convert_path instances. For each path returned, at least one of on_xxx_start(), process_xxx() and on_xxx_end() methods must be defined. The method process_xxx() is not executed if the associated path element is empty (i.e. it contains none elements or sub-paths only).
Note that the path /MOODLE_BACKUP/COURSE/MODULES/MOD/WORKSHOP does not actually exist in the file. The last element with the module name was appended by the moodle1_converter class.
- Return values
-
◆ get_strategy_handler()
moodle1_mod_workshop_handler::get_strategy_handler |
( |
|
$strategy | ) |
|
|
protected |
internal implementation details follow /////////////////////////////////
Factory method returning the handler of the given grading strategy subplugin
- Parameters
-
string | $strategy | the name of the grading strategy |
- Exceptions
-
- Return values
-
◆ has_xml_writer()
moodle1_xml_handler::has_xml_writer |
( |
| ) |
|
|
protectedinherited |
◆ log()
moodle1_handler::log |
( |
|
$message, |
|
|
|
$level, |
|
|
|
$a = null , |
|
|
|
$depth = null , |
|
|
|
$display = false |
|
) |
| |
|
inherited |
This function will be responsible for handling the params, and to call to the corresponding logger->process() once all modifications in params have been performed.
Implements loggable.
◆ make_sure_xml_exists()
moodle1_xml_handler::make_sure_xml_exists |
( |
|
$filename, |
|
|
|
$rootelement = false , |
|
|
|
$content = array() |
|
) |
| |
|
protectedinherited |
Makes sure that a new XML file exists, or creates it itself.
This is here so we can check that all XML files that the restore process relies on have been created by an executed handler. If the file is not found, this method can create it using the given $rootelement as an empty root container in the file.
- Parameters
-
string | $filename | relative file name like 'course/course.xml' |
string | bool | $rootelement | root element to use, false to not create the file |
array | $content | content of the root element |
- Return values
-
bool | true is the file existed, false if it did not |
◆ on_workshop_elements_start()
moodle1_mod_workshop_handler::on_workshop_elements_start |
( |
| ) |
|
This is executed when the parser reaches <ELEMENTS>
The dimensions definition follows. One of the grading strategy subplugins will append dimensions data in self::process_workshop_element()
◆ open_xml_writer()
moodle1_xml_handler::open_xml_writer |
( |
|
$filename | ) |
|
|
protectedinherited |
Opens the XML writer - after calling, one is free to use $xmlwriter.
- Parameters
-
string | $filename | XML file name to write into |
- Return values
-
Reimplemented in moodle1_qtype_handler.
◆ write_xml()
moodle1_xml_handler::write_xml |
( |
|
$element, |
|
|
array |
$data, |
|
|
array |
$attribs = array() , |
|
|
|
$parent = '/' |
|
) |
| |
|
protectedinherited |
Writes the given XML tree data into the currently opened file.
- Parameters
-
string | $element | the name of the root element of the tree |
array | $data | the associative array of data to write |
array | $attribs | list of additional fields written as attributes instead of nested elements |
string | $parent | used internally during the recursion, do not set yourself |
The documentation for this class was generated from the following file:
- mod/workshop/backup/moodle1/lib.php