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.

Differences Between: [Versions 311 and 402] [Versions 311 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