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 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

This file contains the activity badge award criteria type class

Author: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
Copyright: 2012 onwards Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 271 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

award_criteria_activity:: (6 methods):
  __construct()
  get_mod_instance()
  get_details()
  get_options()
  review()
  get_completed_criteria_sql()


Class: award_criteria_activity  - X-Ref

Badge award criteria -- award on activity completion

__construct($record)   X-Ref
No description

get_mod_instance($cmid)   X-Ref
Gets the module instance from the database and returns it.
If no module instance exists this function returns false.

return: stdClass|bool

get_details($short = '')   X-Ref
Get criteria description for displaying to users

return: string

get_options(&$mform)   X-Ref
Add appropriate new criteria options to the form


review($userid, $filtered = false)   X-Ref
Review this criteria and decide if it has been completed

param: int $userid User whose criteria completion needs to be reviewed.
param: bool $filtered An additional parameter indicating that user list
return: bool Whether criteria is complete

get_completed_criteria_sql()   X-Ref
Returns array with sql code and parameters returning all ids
of users who meet this particular criterion.

return: array list($join, $where, $params)