troodle-expcontent/lib.php
Kumi 87e610d313
feat: add basic structure for exp360 module
Introduced the foundational elements for the exp360 module, including:
- Added access control capabilities
- Implemented index page for course instances
- Created add, update, and delete functions for instances
- Updated plugin version

These changes establish the module's core functionality and prepare it for further development and integration.
2024-07-05 11:30:55 +02:00

36 lines
650 B
PHP

<?php
defined('MOODLE_INTERNAL') || die();
function exp360_add_instance($exp360)
{
global $DB;
$exp360->timemodified = time();
$exp360->timecreated = time();
return $DB->insert_record('exp360', $exp360);
}
function exp360_update_instance($exp360)
{
global $DB;
$exp360->timemodified = time();
$exp360->id = $exp360->instance;
return $DB->update_record('exp360', $exp360);
}
function exp360_delete_instance($id)
{
global $DB;
if (!$exp360 = $DB->get_record('exp360', array('id' => $id))) {
return false;
}
$DB->delete_records('exp360', array('id' => $exp360->id));
return true;
}