diff --git a/lang/en/expcontent.php b/lang/en/expcontent.php index 1532ba6..2b42fd4 100644 --- a/lang/en/expcontent.php +++ b/lang/en/expcontent.php @@ -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'; \ No newline at end of file +$string['contentid'] = 'Content ID'; diff --git a/lib.php b/lib.php index 6182a55..c078e8b 100644 --- a/lib.php +++ b/lib.php @@ -36,4 +36,12 @@ function expcontent_delete_instance($id) { $DB->delete_records('expcontent', array('id' => $id)); return true; -} \ No newline at end of file +} + +function expcontent_supports($feature) { + switch($feature) { + case FEATURE_COMPLETION_TRACKS_VIEWS: return true; + case FEATRUE_SHOW_COMPLETION: return true; + default: return null; + } +} diff --git a/mod_form.php b/mod_form.php index d2b0574..4e7c420 100644 --- a/mod_form.php +++ b/mod_form.php @@ -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(); } -} \ No newline at end of file +} diff --git a/view.php b/view.php index b5b271e..b8d6e6b 100644 --- a/view.php +++ b/view.php @@ -1,7 +1,8 @@ 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 += "/"; ?>