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.

This file contains the overall badge award criteria type

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

Defines 1 class

award_criteria_overall:: (8 methods):
  config_form_criteria()
  config_options()
  get_details()
  review()
  get_completed_criteria_sql()
  get_options()
  get_params()
  save()


Class: award_criteria_overall  - X-Ref

Overall badge award criteria

config_form_criteria($data)   X-Ref
Add appropriate form elements to the criteria form

param: stdClass $data details of overall criterion

config_options(&$mform, $param)   X-Ref
Add appropriate parameter elements to the criteria form


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

return: string

review($userid, $filtered = false)   X-Ref
Review this criteria and decide if it has been completed
Overall criteria review should be called only from other criteria handlers.

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)

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


get_params($cid)   X-Ref
Return criteria parameters

param: int $critid Criterion ID
return: array

save($params = array()   X-Ref
Saves overall badge criteria description.

param: array $params Values from the form or any other array.