Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Classes | Functions | Variables
restore_stepslib.php File Reference

Defines various restore steps that will be used by common tasks in restore. More...

Classes

class  restore_activity_competencies_structure_step
 Restore activity competencies structure step. More...
 
class  restore_activity_grade_history_structure_step
 Step in charge of restoring the grade history of an activity. More...
 
class  restore_activity_grades_structure_step
 This structure step restores the grade items associated with one activity All the grade items are made child of the "course" grade item but the original categoryid is saved as parentitemid in the backup_ids table, so, when restoring the complete gradebook (categories and calculations), that information is available there. More...
 
class  restore_activity_grading_structure_step
 Defines the restore step for advanced grading methods attached to the activity module. More...
 
class  restore_activity_logs_structure_step
 This structure step restores activity logs, extending restore_course_logs_structure_step sharing its same structure but modifying the way records are handled. More...
 
class  restore_activity_logstores_structure_step
 Structure step in charge of restoring the logstores.xml file for the activity logs. More...
 
class  restore_activity_search_index
 Index activity after restore (when not restoring whole course). More...
 
class  restore_activity_structure_step
 Abstract structure step, parent of all the activity structure steps. More...
 
class  restore_badges_structure_step
 This structure steps restores the badges and their configs. More...
 
class  restore_block_instance_structure_step
 This structure steps restores one instance + positions of one block Note: Positions corresponding to one existing context are restored here, but all the ones having unknown contexts are sent to backup_ids for a later chance to be restored at the end (final task) More...
 
class  restore_block_search_index
 Index block after restore (when not restoring whole course). More...
 
class  restore_calendar_action_events
 Restore action events. More...
 
class  restore_calendarevents_structure_step
 This structure steps restores the calendar events. More...
 
class  restore_comments_structure_step
 This structure steps restores the comments Note: Cannot use the comments API because defaults to USER->id. More...
 
class  restore_completion_defaults_structure_step
 Restore completion defaults for each module type. More...
 
class  restore_contentbankcontent_structure_step
 This structure steps restores the content bank content. More...
 
class  restore_course_competencies_structure_step
 Restore course competencies structure step. More...
 
class  restore_course_completion_structure_step
 
class  restore_course_legacy_files_step
 Execution step that will migrate legacy files if present. More...
 
class  restore_course_logs_structure_step
 This structure step restores course logs (cmid = 0), delegating the hard work to the corresponding restore_logs_processor passing the collection of restore_log_rule rules to be observed as they are defined by the task. More...
 
class  restore_course_logstores_structure_step
 Structure step in charge of restoring the logstores.xml file for the course logs. More...
 
class  restore_course_search_index
 Index course after restore. More...
 
class  restore_course_structure_step
 Structure step that will read the course.xml file, loading it and performing various actions depending of the site/restore settings. More...
 
class  restore_create_and_clean_temp_stuff
 delete old directories and conditionally create backup_temp_ids table More...
 
class  restore_create_categories_and_questions
 Structure step in charge of creating/mapping all the qcats and qs by parsing the questions.xml file and checking it against the results calculated by restore_process_categories_and_questions and stored in backup_ids_temp. More...
 
class  restore_create_included_users
 Execution step that will create all the needed users as calculated by @restore_process_included_users (those having newiteind = 0) More...
 
class  restore_create_question_files
 Execution step that will create all the question/answers/qtype-specific files for the restored questions. More...
 
class  restore_decode_interlinks
 decode all the interlinks present in restored content relying 100% in the restore_decode_processor that handles both the contents to modify and the rules to be applied More...
 
class  restore_default_enrolments_step
 If no instances yet add default enrol methods the same way as when creating new course in UI. More...
 
class  restore_drop_and_clean_temp_stuff
 delete the temp dir used by backup/restore (conditionally), delete old directories and drop temp ids table More...
 
class  restore_enrolments_structure_step
 This structure steps restores the enrol plugins and their underlying enrolments, performing all the mappings and/or movements required. More...
 
class  restore_execute_after_restore
 Review all the tasks having one after_restore method executing it to perform some final adjustments of information not available when the task was executed. More...
 
class  restore_filters_structure_step
 This structure steps restores the filters and their configs. More...
 
class  restore_fix_restorer_access_step
 Make sure the user restoring the course can actually access it. More...
 
class  restore_grade_history_structure_step
 Step in charge of restoring the grade history of a course. More...
 
class  restore_gradebook_structure_step
 Restore calculated grade items, grade categories etc. More...
 
class  restore_groups_members_structure_step
 Structure step that will create all the needed group memberships by loading them from the groups.xml file performing the required matches. More...
 
class  restore_groups_structure_step
 Structure step that will create all the needed groups and groupings by loading them from the groups.xml file performing the required matches. More...
 
class  restore_load_and_map_roles
 Execution step that, conditionally (if there isn't preloaded information), will load all the needed roles to backup_temp_ids. More...
 
class  restore_load_categories_and_questions
 Execution step that, conditionally (if there isn't preloaded information will load all the question categories and questions (header info only) to backup_temp_ids. More...
 
class  restore_load_included_files
 
class  restore_load_included_inforef_records
 
class  restore_load_included_users
 Execution step that, conditionally (if there isn't preloaded information and users have been selected in settings, will load all the needed users to backup_temp_ids. More...
 
class  restore_module_structure_step
 Structure step to restore common course_module information. More...
 
class  restore_move_module_questions_categories
 Execution step that will move all the CONTEXT_MODULE question categories created at early stages of restore in course context (because modules weren't created yet) to their target module (matching by old-new-contextid mapping) More...
 
class  restore_outcomes_structure_step
 Structure step that will create all the needed outocomes by loading them from the outcomes.xml. More...
 
class  restore_process_categories_and_questions
 Execution step that, conditionally (if there isn't preloaded information) will process all the needed categories and questions in order to decide and perform any action with them (create / map / error) Note: Any error will cause exception, as far as this is the same processing than the one into restore prechecks (that should have stopped process earlier) More...
 
class  restore_process_course_modules_availability
 Process legacy module availability records in backup_ids. More...
 
class  restore_process_file_aliases_queue
 Try to restore aliases and references to external files. More...
 
class  restore_process_included_users
 Execution step that, conditionally (if there isn't preloaded information and users have been selected in settings, will process all the needed users in order to decide and perform any action with them (create / map / error) Note: Any error will cause exception, as far as this is the same processing than the one into restore prechecks (that should have stopped process earlier) More...
 
class  restore_questions_activity_structure_step
 Abstract structure step to help activities that store question attempt data. More...
 
class  restore_ras_and_caps_structure_step
 
class  restore_rebuild_course_cache
 first, ensure that we have no gaps in section numbers and then, rebuid the course cache More...
 
class  restore_review_pending_block_positions
 Review all the (pending) block positions in backup_ids, matching by contextid, creating positions as needed. More...
 
class  restore_scales_structure_step
 Structure step that will create all the needed scales by loading them from the scales.xml. More...
 
class  restore_section_structure_step
 Structure step that will read the section.xml creating/updating sections as needed, rebuilding course cache and other friends. More...
 
class  restore_update_availability
 Updates the availability data for course modules and sections. More...
 
class  restore_userscompletion_structure_step
 Structure step that will process the user activity completion information if all these conditions are met: More...
 

Functions

 add_question_usages ($element, &$paths, $nameprefix='')
 Attach below $element (usually attempts) the needed restore_path_elements to restore question_usages and all they contain. More...
 
 after_execute ()
 
 get_qtype_restorer ($qtype)
 Get the restore_qtype_plugin subclass for a specific question type. More...
 
 inform_new_usage_id ($newusageid)
 When process_question_usage creates the new usage, it calls this method to let the activity link to the new usage. More...
 
 process_question_attempt ($data)
 Process question_attempts.
 
 process_question_attempt_step ($data)
 Process question_attempt_steps.
 
 process_question_usage ($data)
 Process question_usages.
 
 questions_recode_layout ($layout)
 Given a list of question->ids, separated by commas, returns the recoded list, with all the restore question mappings applied. More...
 
 questions_recode_response_data ( $qtype, $newquestionid, $sequencenumber, array $response)
 Recode the respones data for a particular step of an attempt at at particular question. More...
 
 restore_question_attempt_step_worker ($data, $nameprefix)
 This method does the actual work for process_question_attempt_step or process_{nameprefix}_question_attempt_step. More...
 
 restore_question_attempt_worker ($data, $nameprefix)
 This method does the actual work for process_question_attempt or process_{nameprefix}_question_attempt. More...
 
 restore_question_usage_worker ($data, $nameprefix)
 This method does the actual work for process_question_usage or process_{nameprefix}_question_usage. More...
 

Variables

array $newquestionids = array()
 question_attempt->id to questionid.
 
trait restore_questions_attempt_data_trait
 Helper code for use by any plugin that stores question attempt data that it needs to back up. More...
 

Detailed Description

Defines various restore steps that will be used by common tasks in restore.

@subpackage moodle2