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.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402] [Versions 402 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: 211 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