Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Statement verb object for xAPI structure checking and usage.

Copyright: 2020 Ferran Recio
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 103 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

item_verb:: (4 methods):
  __construct()
  create_from_data()
  create_from_id()
  get_id()


Class: item_verb  - X-Ref

Verb xAPI statement item.

Verbs represent the interaction a user/group made inside a xAPI
compatible plugin. Internally a xAPI verb must be representad as
in a valid IRI format (which is a less restrictive version of a
regular URL so a moodle_url out is completelly fine). To make it
easy for plugins to generate valid IRI, a simple string van be
provided and the class will convert into a valid IRI internally.

__construct(stdClass $data)   X-Ref
An xAPI verb constructor based on xAPI data structure.

param: stdClass $data from the specific xAPI element

create_from_data(stdClass $data)   X-Ref
Function to create an item from part of the xAPI statement.

param: stdClass $data the original xAPI element
return: item item_verb xAPI generated

create_from_id(string $id)   X-Ref
Create a valid item_verb from a simple verb string.

param: string $id string to convert to a valid IRI (or a valid IRI)
return: item_verb the resulting item_verb

get_id()   X-Ref
Return the id used in this item.

Id will be extracted from the provided IRI. If it's a valid IRI
it will return all IRI value but if it is generate by the iri helper
from this library it will extract the original value.

return: string the ID (extracted from IRI value)