get_setting_value('userinfo'); $paths[] = new restore_path_element('lamslesson', '/activity/lamslesson'); if ($userinfo) { // No need to restore userdata as that's already in LAMS } // Return the paths wrapped into standard activity structure return $this->prepare_activity_structure($paths); } protected function process_lamslesson($data) { global $DB; $data = (object)$data; $oldid = $data->id; $data->course = $this->get_courseid(); $data->timemodified = $this->apply_date_offset($data->timemodified); // insert the lamslesson record $newitemid = $DB->insert_record('lamslesson', $data); // immediately after inserting "activity" record, call this $this->apply_activity_instance($newitemid); } protected function after_execute() { // Add lamslesson related files, no need to match by itemname (just internally handled context) $this->add_related_files('mod_lamslesson', 'intro', null); } }