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 401 and 402] [Versions 401 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.

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
return: array array containing warnings and the awarded badges

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

return: external_single_structure