moodle-expcontent/lib.php

49 lines
1 KiB
PHP
Raw Normal View History

2021-07-06 14:08:32 +00:00
<?php
if (!defined('MOODLE_INTERNAL')) die();
function expcontent_add_instance($expcontent) {
global $DB;
$expcontent->timemodified = time();
$expcontent->introformat = FORMAT_MOODLE;
$expcontent->id = $DB->insert_record('expcontent', $expcontent);
return $expcontent->id;
}
function expcontent_update_instance($expcontent) {
global $DB;
$expcontent->timemodified = time();
$expcontent->id = $expcontent->instance;
if (! $DB->update_record('expcontent', $expcontent)) {
return false;
}
return true;
}
function expcontent_delete_instance($id) {
global $DB;
if (! $expcontent = $DB->get_record('expcontent', array('id' => $id))) {
return false;
}
$DB->delete_records('expcontent', array('id' => $id));
return true;
2021-11-30 08:42:55 +00:00
}
function expcontent_supports($feature) {
switch($feature) {
case FEATURE_COMPLETION_TRACKS_VIEWS: return true;
case FEATRUE_SHOW_COMPLETION: return true;
2021-11-30 10:20:49 +00:00
case FEATURE_BACKUP_MOODLE2: return true;
2021-11-30 08:42:55 +00:00
default: return null;
}
}