Beispiel #1
0
/**
 * Deletes an instance of the videofile from the database
 *
 * Given an ID of an instance of this module,
 * this function will permanently delete the instance
 * and any data that depends on it.
 *
 * @param int $id Id of the module instance
 * @return boolean
 */
function videofile_delete_instance($id)
{
    require_once dirname(__FILE__) . '/locallib.php';
    $cm = get_coursemodule_from_instance('videofile', $id, 0, false, MUST_EXIST);
    $context = context_module::instance($cm->id);
    $videofile = new videofile($context, null, null);
    return $videofile->delete_instance();
}