Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403]

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

Defines 1 class

item_group:: (6 methods):
  __construct()
  create_from_data()
  create_from_group()
  get_user()
  get_all_users()
  get_group()


Class: item_group  - X-Ref

Group item inside a xAPI statement.

Only named groups are accepted (all groups must be real groups in the
platform) so anonymous groups will be rejected on creation. Groups can
be used as actor or as object inside a xAPI statement.

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

param: stdClass $data the original xAPI element
param: stdClass $group group 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_group xAPI item generated

create_from_group(stdClass $group)   X-Ref
Create a item_group from a existing group.

param: stdClass $group A group record.
return: item_group

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

This is a group item. To avoid security problems this method
thorws an exception when is called from a item_group class.

return: stdClass user record

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

return: array group users

get_group()   X-Ref
Return the moodle group represented by this item.

return: stdClass a group record