Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
core_xapi\handler Class Reference

Class handler handles basic xapi statements. More...

Inheritance diagram for core_xapi\handler:
mod_h5pactivity\xapi\handler

Public Member Functions

 process_statements (array $statements)
 Process a bunch of statements sended to a specific component. More...
 
 statement_to_event (statement $statement)
 Convert a statement object into a Moodle xAPI Event. More...
 
 supports_group_actors ()
 Return true if group actor is enabled. More...
 

Static Public Member Functions

static create (string $component)
 Returns the xAPI handler of a specific component. More...
 

Protected Member Functions

 __construct (string $component)
 Constructor for a xAPI handler base class. More...
 

Protected Attributes

string $component
 component name in frankenstyle.
 

Detailed Description

Class handler handles basic xapi statements.

Constructor & Destructor Documentation

◆ __construct()

core_xapi\handler::__construct ( string  $component)
finalprotected

Constructor for a xAPI handler base class.

Parameters
string$componentthe component name

Member Function Documentation

◆ create()

static core_xapi\handler::create ( string  $component)
staticfinal

Returns the xAPI handler of a specific component.

Parameters
string$componentthe component name in frankenstyle.
Return values
handler|nulla handler object or null if none found.
Exceptions
xapi_exception

◆ process_statements()

core_xapi\handler::process_statements ( array  $statements)

Process a bunch of statements sended to a specific component.

Parameters
statement[]$statementsan array with all statement to process.
Return values
int[]return an specifying what statements are being stored.

◆ statement_to_event()

core_xapi\handler::statement_to_event ( statement  $statement)
abstract

Convert a statement object into a Moodle xAPI Event.

If a statement is accepted by validate_statement the component must provide a event to handle that statement, otherwise the statement will be rejected.

Note: this method must be overridden by the plugins which want to use xAPI.

Parameters
statement$statement
Return values
core::event::base|nulla Moodle event to trigger

Reimplemented in mod_h5pactivity\xapi\handler.

◆ supports_group_actors()

core_xapi\handler::supports_group_actors ( )

Return true if group actor is enabled.

Note: this method must be overridden by the plugins which want to use groups in statements.

Return values
bool

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