Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 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 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

Course completion criteria

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: 273 lines (9 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

completion_criteria:: (5 methods):
  fetch_all()
  factory()
  get_icon()
  get_status()
  is_pending()


Class: completion_criteria  - X-Ref

Completion criteria abstract definition

fetch_all($params)   X-Ref
Finds and returns all data_object instances based on params.

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

factory($params)   X-Ref
Factory method for creating correct class object

param: array $params associative arrays varname=>value
return: completion_criteria

get_icon($alt, array $attributes = null)   X-Ref
Return pix_icon for display in reports.

param: string $alt The alt text to use for the icon
param: array $attributes html attributes
return: pix_icon

get_status($completion)   X-Ref
Return criteria status text for display in reports

param: completion_completion $completion The user's completion record
return: string

is_pending($completion)   X-Ref
Return true if the criteria's current status is different to what is sorted
in the database, e.g. pending an update

param: completion_completion $completion The user's criteria completion record
return: bool