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.

Classes to manage manual badge award.

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

Defines 3 classes

badge_award_selector_base:: (3 methods):
  __construct()
  get_options()
  get_groups_sql()

badge_potential_users_selector:: (2 methods):
  find_users()
  set_existing_recipients()

badge_existing_users_selector:: (3 methods):
  find_users()
  process_manual_award()
  process_manual_revoke()


Class: badge_award_selector_base  - X-Ref

__construct($name, array $options)   X-Ref
Constructor method

param: string $name
param: array $options

get_options()   X-Ref
Returns an array of options to seralise and store for searches

return: array

get_groups_sql()   X-Ref
Restricts the selection of users to display, according to the groups they belong.

return: array

Class: badge_potential_users_selector  - X-Ref

A user selector control for potential users to award badge

find_users($search)   X-Ref
Finds all potential badge recipients

Potential badge recipients are all enroled users
who haven't got a badge from current issuer role.

param: string $search
return: array

set_existing_recipients(array $users)   X-Ref
Sets the existing recipients

param: array $users

Class: badge_existing_users_selector  - X-Ref

A user selector control for existing users to award badge

find_users($search)   X-Ref
Finds all users who already have been awarded a badge by current role

param: string $search
return: array

process_manual_award($recipientid, $issuerid, $issuerrole, $badgeid)   X-Ref
No description

process_manual_revoke($recipientid, $issuerid, $issuerrole, $badgeid)   X-Ref
Manually revoke awarded badges.

param: int $recipientid
param: int $issuerid
param: int $issuerrole
param: int $badgeid
return: bool