Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Statement agent (user) 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: 142 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

item_agent:: (5 methods):
  __construct()
  create_from_data()
  create_from_user()
  get_user()
  get_all_users()


Class: item_agent  - X-Ref

Agent xAPI statement element representing a Moodle user.

Agents can be used either as actor or object in a statement.

__construct(stdClass $data, stdClass $user)   X-Ref
Function to create an agent (user) from part of the xAPI statement.

param: stdClass $data the original xAPI element
param: stdClass $user user record

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_agentxAPI generated

create_from_user(stdClass $user)   X-Ref
Create a item_agent from a existing user.

param: stdClass $user A user record.
return: item_agent

get_user()   X-Ref
Returns the moodle user represented by this item.

return: stdClass user record

get_all_users()   X-Ref
Return all users represented by this item.

In this case the item is an agent so a single element array
will be returned always.

return: array list of users