/** * Given an ID of an instance of this module, * this function will permanently delete the instance * and any data that depends on it. * * @global object * @param int $id * @return bool */ function lesson_delete_instance($id) { global $DB, $CFG; require_once $CFG->dirroot . '/mod/lesson/locallib.php'; $lesson = $DB->get_record("lesson", array("id" => $id), '*', MUST_EXIST); $lesson = new lesson($lesson); return $lesson->delete(); }