Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 402] [Versions 39 and 403]

Course completion critieria - marked by role

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: 166 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

completion_criteria_role:: (9 methods):
  fetch()
  config_form_display()
  update_config()
  complete()
  review()
  get_title()
  get_title_detailed()
  get_type_title()
  get_details()


Class: completion_criteria_role  - X-Ref

Course completion critieria - marked by role

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

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

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

param: moodleform $mform Moodle forms object
param: stdClass $data used to set default values of the form

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

param: stdClass $data Form data

complete($completion)   X-Ref
Mark this criteria as complete

param: completion_completion $completion The user's completion record

review($completion, $mark = true, $is_complete = false)   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
param: bool $is_complete Set to false if the criteria has been completed just now.
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

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: