Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core_badges_assertion Class Reference

Open Badges Assertions specification 1.0 More...

Public Member Functions

 __construct ($hash, $obversion=OPEN_BADGES_V2)
 Constructs with issued badge unique hash.
 
 get_alignments ()
 Get alignment of the badge.
 
 get_assertion_hash ()
 Get the local id for this badge assertion.
 
 get_badge_assertion ($issued=true, $usesalt=true)
 Get badge assertion.
 
 get_badge_class ($issued=true)
 Get badge class information.
 
 get_badge_id ()
 Get the local id for this badge.
 
 get_criteria_badge_class ()
 Get criteria of badge class.
 
 get_endorsement ()
 Get endorsement of the badge.
 
 get_issuer ()
 Get badge issuer information.
 
 get_related_badges (badge $badge)
 Get related badges of the badge.
 
 get_tags ()
 Get tags of the badge.
 

Protected Member Functions

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

Detailed Description

Open Badges Assertions specification 1.0

Badge asserion is defined by three parts:

  • Badge Assertion (information regarding a specific badge that was awarded to a badge earner)
  • Badge Class (general information about a badge and what it is intended to represent)
  • Issuer Class (general information of an issuing organisation) Class that represents badge assertion.

Constructor & Destructor Documentation

◆ __construct()

core_badges_assertion::__construct ( $hash,
$obversion = OPEN_BADGES_V2 )

Constructs with issued badge unique hash.

Parameters
string$hashBadge unique hash from badge_issued table.
int$obversionto control version JSON-LD.

Member Function Documentation

◆ embed_data_badge_version2()

core_badges_assertion::embed_data_badge_version2 ( & $json,
$type = OPEN_BADGES_V2_TYPE_ASSERTION )
protected

Embed data of Open Badges Specification Version 2.0 to json.

Parameters
array$jsonfor assertion, badges, issuer.
string$typeContent type.

◆ get_alignments()

core_badges_assertion::get_alignments ( )

Get alignment of the badge.

Return values
arrayinformation.

◆ get_assertion_hash()

core_badges_assertion::get_assertion_hash ( )

Get the local id for this badge assertion.

Return values
string

◆ get_badge_assertion()

core_badges_assertion::get_badge_assertion ( $issued = true,
$usesalt = true )

Get badge assertion.

Parameters
boolean$issuedInclude the nested badge issued information.
boolean$usesaltHash the identity and include the salt information for the hash.
Return values
arrayBadge assertion.

◆ get_badge_class()

core_badges_assertion::get_badge_class ( $issued = true)

Get badge class information.

Parameters
boolean$issuedInclude the nested badge issuer information.
Return values
arrayBadge Class information.

◆ get_badge_id()

core_badges_assertion::get_badge_id ( )

Get the local id for this badge.

Return values
int

◆ get_criteria_badge_class()

core_badges_assertion::get_criteria_badge_class ( )

Get criteria of badge class.

Return values
array|stringCriteria information.

◆ get_endorsement()

core_badges_assertion::get_endorsement ( )

Get endorsement of the badge.

Return values
false|stdClassEndorsement information.

◆ get_issuer()

core_badges_assertion::get_issuer ( )

Get badge issuer information.

Return values
arrayIssuer information.

◆ get_related_badges()

core_badges_assertion::get_related_badges ( badge $badge)

Get related badges of the badge.

Parameters
badge$badgeBadge object.
Return values
array|boolList related badges.

◆ get_tags()

core_badges_assertion::get_tags ( )

Get tags of the badge.

Return values
arraytags.

The documentation for this class was generated from the following file: