Class xapi_handler for H5P statements and states.
More...
|
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.
|
|
Class xapi_handler for H5P statements and states.
- Since
- Moodle 3.9
- Copyright
- 2020 Ferran Recio ferra.nosp@m.n@mo.nosp@m.odle..nosp@m.com
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ create()
static core_xapi\handler::create |
( |
string | $component | ) |
|
|
staticfinalinherited |
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 | ) |
|
|
inherited |
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 |
( |
| ) |
|
|
inherited |
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 | ) |
|
|
inherited |
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 | ) |
|
|
inherited |
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 ) |
|
inherited |
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 | ) |
|
|
inherited |
Process a state save request.
- Parameters
-
state | $state | the state object |
- Return values
-
bool | if the state can be saved |
◆ statement_to_event()
mod_h5pactivity\xapi\handler::statement_to_event |
( |
statement | $statement | ) |
|
Convert a statement object into a Moodle xAPI Event.
If a statement is accepted by the xAPI webservice the component must provide an event to handle that statement, otherwise the statement will be rejected.
- Parameters
-
- Return values
-
core\event\base|null | a Moodle event to trigger |
Reimplemented from core_xapi\handler.
◆ supports_group_actors()
core_xapi\handler::supports_group_actors |
( |
| ) |
|
|
inherited |
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 | ) |
|
|
staticfinalinherited |
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()
mod_h5pactivity\xapi\handler::validate_state |
( |
state | $state | ) |
|
|
protected |
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.
- Parameters
-
- Return values
-
bool | if the state is valid or not |
Reimplemented from core_xapi\handler.
◆ wipe_states()
core_xapi\handler::wipe_states |
( |
?string | $itemid = null, |
|
|
?int | $userid = null, |
|
|
?string | $stateid = null, |
|
|
?string | $registration = null ) |
|
inherited |
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: