|
static | create (string $component) |
| Returns the xAPI handler of a specific component.
|
|
static | supports_xapi (string $component) |
| Whether a component supports (and implements) xAPI.
|
|
|
string | $component |
| component name in frankenstyle.
|
|
state_store | $statestore |
| the state_store instance.
|
|
◆ __construct()
core_xapi\handler::__construct |
( |
string | $component | ) |
|
|
finalprotected |
Constructor for a xAPI handler base class.
- Parameters
-
string | $component | the component name |
◆ create()
static core_xapi\handler::create |
( |
string | $component | ) |
|
|
staticfinal |
Returns the xAPI handler of a specific component.
- Parameters
-
string | $component | the component name in frankenstyle. |
- Return values
-
handler|null | a handler object or null if none found. |
- Exceptions
-
◆ delete_state()
core_xapi\handler::delete_state |
( |
state | $state | ) |
|
Process a state delete request.
- Parameters
-
state | $state | the state object |
- Return values
-
bool | if the deletion is successful |
◆ get_state_store()
core_xapi\handler::get_state_store |
( |
| ) |
|
Return a valor state store for this component.
Plugins may override this method is they want to use a different state store class.
- Return values
-
state_store | the store to use to get/put/delete states. |
◆ load_state()
core_xapi\handler::load_state |
( |
state | $state | ) |
|
Process a state save request.
- Parameters
-
state | $state | the state object |
- Return values
-
state|null | the resulting loaded state |
◆ process_statements()
core_xapi\handler::process_statements |
( |
array | $statements | ) |
|
Process a bunch of statements sended to a specific component.
- Parameters
-
statement[] | $statements | an array with all statement to process. |
- Return values
-
int[] | return an specifying what statements are being stored. |
◆ reset_states()
core_xapi\handler::reset_states |
( |
?string | $itemid = null, |
|
|
?int | $userid = null, |
|
|
?string | $stateid = null, |
|
|
?string | $registration = null ) |
Reset all states from this component.
- Parameters
-
string | null | $itemid | |
int | null | $userid | |
string | null | $stateid | |
string | null | $registration | |
◆ save_state()
core_xapi\handler::save_state |
( |
state | $state | ) |
|
Process a state save request.
- Parameters
-
state | $state | the state object |
- Return values
-
bool | if the state can be saved |
◆ 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
-
- Return values
-
core\event\base|null | a 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
-
◆ supports_xapi()
static core_xapi\handler::supports_xapi |
( |
string | $component | ) |
|
|
staticfinal |
Whether a component supports (and implements) xAPI.
- Parameters
-
string | $component | the component name in frankenstyle. |
- Return values
-
bool | true if the given component implements xAPI handler; false otherwise. |
◆ validate_state()
core_xapi\handler::validate_state |
( |
state | $state | ) |
|
|
abstractprotected |
Validate a xAPI state.
Check if the state is valid for this handler.
This method is used also for the state get requests so the validation cannot rely on having state data.
Note: this method must be overridden by the plugins which want to use xAPI states.
- Parameters
-
- Return values
-
bool | if the state is valid or not |
Reimplemented in mod_h5pactivity\xapi\handler.
◆ wipe_states()
core_xapi\handler::wipe_states |
( |
?string | $itemid = null, |
|
|
?int | $userid = null, |
|
|
?string | $stateid = null, |
|
|
?string | $registration = null ) |
Delete all states from this component.
- Parameters
-
string | null | $itemid | |
int | null | $userid | |
string | null | $stateid | |
string | null | $registration | |
The documentation for this class was generated from the following file:
- lib/xapi/classes/handler.php