Conversion handler for the accumulative grading strategy data.
More...
|
| get_component_name () |
| Returns the normalized name of the plugin, eg mod_workshop.
|
|
| get_converter () |
|
| get_paths () |
| Activity module subplugins can't declare any paths to handle.
|
|
| 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.
|
|
| on_elements_end () |
| Called when we reach </ELEMENTS>
|
|
| on_elements_start () |
| Called when we reach <ELEMENTS>
|
|
| on_legacy_element_end () |
| Called when we reach </ELEMENT>
|
|
| process_legacy_element (array $data, array $raw) |
| Converts <ELEMENT> into <workshopform_accumulative_dimension>
|
|
| use_xml_writer (xml_writer $xmlwriter) |
| Provides a xml_writer instance to this workshopform handler.
|
|
|
| close_xml_writer () |
| Close the XML writer.
|
|
| get_new_scaleid ($oldscaleid) |
| If needed, creates new standard (global) scale to replace the legacy workshop one and returns the mapping.
|
|
| has_xml_writer () |
| Checks if the XML writer has been opened by self::open_xml_writer().
|
|
| make_sure_xml_exists ($filename, $rootelement=false, $content=array()) |
| Makes sure that a new XML file exists, or creates it itself.
|
|
| open_xml_writer ($filename) |
| Opens the XML writer - after calling, one is free to use $xmlwriter.
|
|
| write_xml ($element, array $data, array $attribs=array(), $parent='/') |
| Writes the given XML tree data into the currently opened file.
|
|
Conversion handler for the accumulative grading strategy data.
◆ 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_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_new_scaleid()
moodle1_workshopform_accumulative_handler::get_new_scaleid |
( |
| $oldscaleid | ) |
|
|
protected |
If needed, creates new standard (global) scale to replace the legacy workshop one and returns the mapping.
If the given $oldscaleid represents a scale, returns array $oldscaleid => $newscaleid that can be used as a parameter for workshopform_accumulative_upgrade_element(). Otherwise this method returns empty array.
In workshop 1.x, scale field in workshop_elements had the following meaning: 0 | 2 point Yes/No scale 1 | 2 point Present/Absent scale 2 | 2 point Correct/Incorrect scale 3 | 3 point Good/Poor scale 4 | 4 point Excellent/Very Poor scale 5 | 5 point Excellent/Very Poor scale 6 | 7 point Excellent/Very Poor scale 7 | Score out of 10 8 | Score out of 20 9 | Score out of 100
- See also
- workshopform_accumulative_upgrade_scales()
- Parameters
-
int | $oldscaleid | the value of the 'scale' field in the moodle.xml backup file |
- Return values
-
array | (int)oldscaleid => (int)newscaleid |
◆ get_paths()
moodle1_submod_handler::get_paths |
( |
| ) |
|
|
finalinherited |
Activity module subplugins can't declare any paths to handle.
The paths must be registered by the parent module and then re-dispatched to the relevant subplugins for eventual processing.
- 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_elements_end()
moodle1_workshopform_handler::on_elements_end |
( |
| ) |
|
|
inherited |
◆ on_elements_start()
moodle1_workshopform_handler::on_elements_start |
( |
| ) |
|
|
inherited |
◆ 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.
◆ process_legacy_element()
moodle1_workshopform_accumulative_handler::process_legacy_element |
( |
array | $data, |
|
|
array | $raw ) |
◆ use_xml_writer()
moodle1_workshopform_handler::use_xml_writer |
( |
xml_writer | $xmlwriter | ) |
|
|
inherited |
Provides a xml_writer instance to this workshopform handler.
- Parameters
-
◆ 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/form/accumulative/backup/moodle1/lib.php