Bring up to speed

This commit is contained in:
Kumi 2021-11-30 09:42:55 +01:00
parent 299f9a9647
commit 5e5f731f74
4 changed files with 20 additions and 6 deletions

View file

@ -2,8 +2,8 @@
defined('MOODLE_INTERNAL') || die();
$string['modulename'] = 'EXP360 Content';
$string['modulename'] = 'EXP360 Contents';
$string['modulename'] = '360° Content';
$string['modulename'] = '360° Content';
$string['settings'] = 'Settings';
@ -11,4 +11,4 @@ $string['baseurl'] = 'Base URL';
$string['baseurl_help'] = 'Base URL of the EXP360 Content Server';
$string['name'] = 'Name';
$string['contentid'] = 'Content ID';
$string['contentid'] = 'Content ID';

10
lib.php
View file

@ -36,4 +36,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 FEATRUE_SHOW_COMPLETION: return true;
default: return null;
}
}

View file

@ -19,10 +19,12 @@ class mod_expcontent_mod_form extends moodleform_mod {
$mform->addElement('text', 'contentid', get_string('contentid', 'expcontent'), array('size'=>'64'));
$mform->setType('contentid', PARAM_TEXT);
$mform->addRule('contentid', null, 'required', null, 'client');
$this->standard_intro_elements();
$this->standard_coursemodule_elements();
$this->add_action_buttons();
}
}
}

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 += "/";
?>