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 310 and 400] [Versions 39 and 400] [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

Badge assertion library.

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: 407 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: core_badges_assertion  - X-Ref

Class that represents badge assertion.

__construct($hash, $obversion = OPEN_BADGES_V2)   X-Ref
Constructs with issued badge unique hash.

param: string $hash Badge unique hash from badge_issued table.
param: int $obversion to control version JSON-LD.

get_badge_id()   X-Ref
Get the local id for this badge.

return: int

get_assertion_hash()   X-Ref
Get the local id for this badge assertion.

return: string

get_badge_assertion($issued = true, $usesalt = true)   X-Ref
Get badge assertion.

return: array Badge assertion.
param: boolean $issued Include the nested badge issued information.
param: boolean $usesalt Hash the identity and include the salt information for the hash.

get_badge_class($issued = true)   X-Ref
Get badge class information.

return: array Badge Class information.
param: boolean $issued Include the nested badge issuer information.

get_issuer()   X-Ref
Get badge issuer information.

return: array Issuer information.

get_related_badges(badge $badge)   X-Ref
Get related badges of the badge.

return: array|bool List related badges.
param: badge $badge Badge object.

get_endorsement()   X-Ref
Get endorsement of the badge.

return: false|stdClass Endorsement information.

get_criteria_badge_class()   X-Ref
Get criteria of badge class.

return: array|string Criteria information.

get_alignments()   X-Ref
Get alignment of the badge.

return: array information.

embed_data_badge_version2(&$json, $type = OPEN_BADGES_V2_TYPE_ASSERTION)   X-Ref
Embed data of Open Badges Specification Version 2.0 to json.

param: array $json for assertion, badges, issuer.
param: string $type Content type.