. defined('MOODLE_INTERNAL') || die(); class restore_plagiarism_pchkorg_plugin extends restore_plagiarism_plugin { public function process_pchkorg_config($data) { $data = (object) $data; set_config($this->task->get_courseid(), $data->value, $data->plugin); } public function process_pchkorgconfigmod($data) { global $DB; $data = (object) $data; $data->cm = $this->task->get_moduleid(); $DB->insert_record('plagiarism_pchkorg_config', $data); } public function process_pchkorgfiles($data) { global $DB; $data = (object) $data; $data->cm = $this->task->get_moduleid(); $data->userid = $this->get_mappingid('user', $data->userid); $DB->insert_record('plagiarism_pchkorg_files', $data); } protected function define_course_plugin_structure() { $paths = array(); $elename = 'pchkorg_config'; $elepath = $this->get_pathfor('/pchkorg_configs/pchkorg_config'); $paths[] = new restore_path_element($elename, $elepath); return $paths; // And we return the interesting paths. } protected function define_module_plugin_structure() { $paths = array(); $elename = 'pchkorgconfigmod'; $elepath = $this->get_pathfor('/pchkorg_activities_configs/pchkorg_activities_config'); $paths[] = new restore_path_element($elename, $elepath); $elename = 'pchkorgfiles'; $elepath = $this->get_pathfor('/pchkorg_file/pchkorg_file'); $paths[] = new restore_path_element($elename, $elepath); return $paths; } }