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 39 and 401]

This file contains the manual 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: 241 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

award_criteria_manual:: (6 methods):
  get_role_name()
  get_options()
  get_details()
  review()
  get_completed_criteria_sql()
  delete()


Class: award_criteria_manual  - X-Ref

Manual badge award criteria

get_role_name($rid)   X-Ref
Gets role name.
If no such role exists this function returns null.

return: string|null

get_options(&$mform)   X-Ref
Add appropriate new criteria options to the 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

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)

delete()   X-Ref
Delete this criterion