Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 402] [Versions 400 and 403]

Badges external API

Copyright: 2016 Juan Leyva <juan@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 206 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

core_badges_external:: (3 methods):
  get_user_badges_parameters()
  get_user_badges()
  get_user_badges_returns()


Class: core_badges_external  - X-Ref

Badges external functions

get_user_badges_parameters()   X-Ref
Describes the parameters for get_user_badges.

return: external_function_parameters

get_user_badges($userid = 0, $courseid = 0, $page = 0, $perpage = 0, $search = '', $onlypublic = false)   X-Ref
Returns the list of badges awarded to a user.

return: array array containing warnings and the awarded badges
param: int $userid       user id
param: int $courseid     course id
param: int $page         page of records to return
param: int $perpage      number of records to return per page
param: string  $search   a simple string to search for
param: bool $onlypublic  whether to return only public badges

get_user_badges_returns()   X-Ref
Describes the get_user_badges return value.

return: external_single_structure