}
}
-
+/**
+ * @param string $feature FEATURE_xx constant for requested feature
+ * @return mixed True if module supports feature, null if doesn't know
+ */
+function assignment_supports($feature) {
+ switch($feature) {
+ case FEATURE_COMPLETION_TRACKS_VIEWS: return true;
+ case FEATURE_GRADE_HAS_GRADE: return true;
+ default: return null;
+ }
+}
?>
$assignmentclass = "assignment_$assignment->assignmenttype";
$assignmentinstance = new $assignmentclass($cm->id, $assignment, $cm, $course);
- $assignmentinstance->view(); // Actually display the assignment!
+/// Mark as viewed
+ $completion=new completion_info($course);
+ $completion->set_module_viewed($cm);
+ $assignmentinstance->view(); // Actually display the assignment!
?>
return array('moodle/site:accessallgroups');
}
+/**
+ * @param string $feature FEATURE_xx constant for requested feature
+ * @return mixed True if module supports feature, null if doesn't know
+ */
+function choice_supports($feature) {
+ switch($feature) {
+ case FEATURE_COMPLETION_TRACKS_VIEWS: return true;
+ default: return null;
+ }
+}
?>
print_footer($course);
-
+/// Mark as viewed
+ $completion=new completion_info($course);
+ $completion->set_module_viewed($cm);
?>
return array('moodle/site:accessallgroups', 'moodle/site:viewfullnames');
}
+/**
+ * @param string $feature FEATURE_xx constant for requested feature
+ * @return mixed True if module supports feature, null if doesn't know
+ */
+function data_supports($feature) {
+ switch($feature) {
+ case FEATURE_COMPLETION_TRACKS_VIEWS: return true;
+ case FEATURE_GRADE_HAS_GRADE: return true;
+ default: return null;
+ }
+}
?>
}
print_footer($course);
+
+/// Mark as viewed
+ $completion=new completion_info($course);
+ $completion->set_module_viewed($cm);
?>
return array('moodle/site:accessallgroups', 'moodle/site:viewfullnames', 'moodle/site:trustcontent');
}
+/**
+ * @param string $feature FEATURE_xx constant for requested feature
+ * @return mixed True if module supports feature, null if doesn't know
+ */
+function glossary_supports($feature) {
+ switch($feature) {
+ case FEATURE_COMPLETION_TRACKS_VIEWS: return true;
+ case FEATURE_GRADE_HAS_GRADE: return true;
+ default: return null;
+ }
+}
+
?>
glossary_print_tabbed_table_end();
/// Finish the page
-
print_footer($course);
+/// Mark as viewed
+ $completion=new completion_info($course);
+ $completion->set_module_viewed($cm);
?>
return array('moodle/site:accessallgroups');
}
+/**
+ * @param string $feature FEATURE_xx constant for requested feature
+ * @return mixed True if module supports feature, null if doesn't know
+ */
+function lesson_supports($feature) {
+ switch($feature) {
+ case FEATURE_COMPLETION_TRACKS_VIEWS: return true;
+ case FEATURE_GRADE_HAS_GRADE: return true;
+ default: return null;
+ }
+}
+
?>
/// Finish the page
print_footer($course);
+/// Mark as viewed
+ $completion=new completion_info($course);
+ $completion->set_module_viewed($cm);
?>
}
}
+/**
+ * @param string $feature FEATURE_xx constant for requested feature
+ * @return mixed True if module supports feature, null if doesn't know
+ */
+function resource_supports($feature) {
+ switch($feature) {
+ case FEATURE_COMPLETION_TRACKS_VIEWS: return true;
+ default: return null;
+ }
+}
+
?>
$resourceclass = 'resource_'.$resource->type;
$resourceinstance = new $resourceclass($cm->id);
- $resourceinstance->display();
+ // Mark activity viewed before we display it because some resource types
+ // do not return from display()
+ $completion=new completion_info($course);
+ $completion->set_module_viewed($cm);
+ $resourceinstance->display();
?>