Bug fixes

This commit is contained in:
Kumi 2021-12-07 11:02:33 +01:00
parent 877b5e764f
commit 0bae26309b
4 changed files with 15 additions and 3 deletions

View file

@ -3,7 +3,7 @@
defined('MOODLE_INTERNAL') || die();
$string['modulename'] = 'EXP360 Content';
$string['modulename'] = 'EXP360 Contents';
$string['modulenameplural'] = 'EXP360 Contents';
$string['settings'] = 'Settings';

View file

@ -37,4 +37,12 @@ function expcontent_delete_instance($id) {
$DB->delete_records('expcontent', array('id' => $id));
return true;
}
function expcontent_supports($feature) {
switch($feature) {
case FEATURE_COMPLETION_TRACKS_VIEWS: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
default: return null;
}
}

View file

@ -2,7 +2,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = "2021081900";
$plugin->version = "2021111500";
$plugin->component = 'mod_expcontent';
$plugin->maturity = MATURITY_ALPHA;
$plugin->release = 'v0.0.1';

View file

@ -1,7 +1,8 @@
<?php
require('../../config.php');
require_once('lib.php');
require_once($CFG->dirroot.'/mod/expcontent/lib.php');
require_once($CFG->libdir.'/completionlib.php');
$id = required_param('id', PARAM_INT);
list ($course, $cm) = get_course_and_cm_from_cmid($id, 'expcontent');
@ -10,6 +11,9 @@ $expcontent = $DB->get_record('expcontent', array('id'=> $cm->instance), '*', MU
$expconfig = get_config('mod_expcontent');
$baseurl = $expconfig->baseurl;
$completion = new completion_info($course);
$completion->set_module_viewed($cm);
if ($baseurl[-1] != "/") $baseurl += "/";
?>