Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402]

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: 279 lines (9 kb)
Included or required:0 times
Referenced: 0 times
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