Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

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