Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
backup_qtype_multichoice_plugin Class Reference

Provides the information to backup multichoice questions. More...

Inheritance diagram for backup_qtype_multichoice_plugin:

Public Member Functions

 define_plugin_structure ($connectionpoint)
 

Static Public Member Functions

static get_components_and_fileareas ($filter=null)
 Returns all the components and fileareas used by all the installed qtypes.
 
static get_qtype_fileareas ()
 Returns one array with filearea => mappingname elements for the qtype.
 

Protected Member Functions

 add_question_datasets ($element)
 Attach to $element (usually questions) the needed backup structures for question_datasets for a given question Used by calculated qtypes.
 
 add_question_numerical_options ($element)
 Attach to $element (usually questions) the needed backup structures for question_numerical_options for a given question Used both by calculated and numerical qtypes.
 
 add_question_numerical_units ($element)
 Attach to $element (usually questions) the needed backup structures for question_numerical_units for a given question Used both by calculated and numerical qtypes.
 
 add_question_question_answers ($element)
 Attach to $element (usually questions) the needed backup structures for question_answers for a given question Used by various qtypes (calculated, essay, multianswer, multichoice, numerical, shortanswer, truefalse)
 
 define_question_plugin_structure ()
 Returns the qtype information to attach to question element.
 
 get_plugin_element ($final_elements=null, $conditionparam=null, $conditionvalue=null)
 Factory method that will return one backup_plugin_element (backup_optigroup_element) with its name automatically calculated, based one the plugin being handled (type, name)
 
 get_recommended_name ()
 Simple helper function that suggests one name for the main nested element in plugins It's not mandatory to use it but recommended ;-)
 
 get_setting_value ($name)
 Returns the value of one (task/plan) setting.
 

Protected Attributes

string $connectionpoint
 
backup_optigroup_element $optigroup
 
string $pluginname
 
string $plugintype
 
backup_structure_step $step
 
backup_course_task backup_activity_task $task
 

Detailed Description

Provides the information to backup multichoice questions.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ get_components_and_fileareas()

static backup_qtype_plugin::get_components_and_fileareas ( $filter = null)
staticinherited

Returns all the components and fileareas used by all the installed qtypes.

The method introspects each qtype, asking it about fileareas used. Then, one 2-level array is returned. 1st level is the component name (qtype_xxxx) and 2nd level is one array of filearea => mappings to look

Note that this function is used both in backup and restore, so it is important to use the same mapping names (usually, name of the table in singular) always

TODO: Surely this can be promoted to backup_plugin easily and make it to work for ANY plugin, not only qtypes (but we don't need it for now)

◆ get_qtype_fileareas()

static backup_qtype_plugin::get_qtype_fileareas ( )
staticinherited

Returns one array with filearea => mappingname elements for the qtype.

Used by get_components_and_fileareas to know about all the qtype files to be processed both in backup and restore.

Reimplemented in backup_qtype_calculated_plugin, backup_qtype_ddimageortext_plugin, backup_qtype_ddmarker_plugin, backup_qtype_ddwtos_plugin, backup_qtype_essay_plugin, and backup_qtype_match_plugin.


The documentation for this class was generated from the following file: