Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

This file contains the course criteria type.

Author: Aaron Barnes <aaronb@catalyst.net.nz>
Copyright: 2009 Catalyst IT Ltd
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 231 lines (8 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

completion_criteria_course:: (9 methods):
  fetch()
  config_form_display()
  update_config()
  review()
  get_title()
  get_title_detailed()
  get_type_title()
  cron()
  get_details()


Class: completion_criteria_course  - X-Ref

Course completion critieria - completion on course completion

This course completion criteria depends on another course with
completion enabled to be marked as complete for this user

fetch($params)   X-Ref
Finds and returns a data_object instance based on params.

param: array $params associative arrays varname=>value
return: data_object instance of data_object or false if none found.

config_form_display(&$mform, $data = null)   X-Ref
Add appropriate form elements to the critieria form

param: moodle_form $mform Moodle forms object
param: stdClass $data data used to define default value of the form

update_config(&$data)   X-Ref
Update the criteria information stored in the database

param: array $data Form data

review($completion, $mark = true)   X-Ref
Review this criteria and decide if the user has completed

param: completion_completion $completion The user's completion record
param: bool $mark Optionally set false to not save changes to database
return: bool

get_title()   X-Ref
Return criteria title for display in reports

return: string

get_title_detailed()   X-Ref
Return a more detailed criteria title for display in reports

return: string

get_type_title()   X-Ref
Return criteria type title for display in reports

return: string

cron()   X-Ref
Find user's who have completed this criteria


get_details($completion)   X-Ref
Return criteria progress details for display in reports

param: completion_completion $completion The user's completion record
return: array An array with the following keys: