Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 402] [Versions 401 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: 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