iMath) - Computer Science Dep. of IME-USP (Brazil) * * License * - http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /// Moodle core defines constant MOODLE_INTERNAL which shall be used to make sure that the script is included and not called directly. defined('MOODLE_INTERNAL') || die(); /// This is called at the beginning of the uninstallation process to give the module // a chance to clean-up its hacks, bits etc. where possible. // @return bool Return true if success. require_once ($CFG->dirroot . '/mod/iassign/locallib.php'); function xmldb_iassign_uninstall () { global $DB; $fs = get_file_storage(); $context_system = context_system::instance(); $fs->delete_area_files($context_system->id, 'mod_iassign', 'ilm'); $courses = $DB->get_records('course'); foreach ($courses as $course) { $context_course = context_course::instance($course->id); $fs->delete_area_files($context_course->id, 'mod_iassign', 'exercise'); $fs->delete_area_files($context_course->id, 'mod_iassign', 'activity'); } return true; }