Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 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 310]

(no description)

File Size: 193 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

H5PEventBase:: (6 methods):
  __construct()
  validLogLevel()
  validStats()
  isAction()
  getDataArray()
  getFormatArray()


Class: H5PEventBase  - X-Ref

The base class for H5P events. Extend to track H5P events in your system.

__construct($type, $sub_type = NULL, $content_id = NULL, $content_title = NULL, $library_name = NULL, $library_version = NULL)   X-Ref
Adds event type, h5p library and timestamp to event before saving it.

Common event types with sub type:
content, <none> – content view
embed – viewed through embed code
shortcode – viewed through internal shortcode
edit – opened in editor
delete – deleted
create – created through editor
create upload – created through upload
update – updated through editor
update upload – updated through upload
upgrade – upgraded

results, <none> – view own results
content – view results for content
set – new results inserted or updated

settings, <none> – settings page loaded

library, <none> – loaded in editor
create – new library installed
update – old library updated

param: string $type
param: string $sub_type
param: string $content_id
param: string $content_title
param: string $library_name
param: string $library_version

validLogLevel($type, $sub_type)   X-Ref
Determines if the event type should be saved/logged.

param: string $type
param: string $sub_type
return: boolean

validStats($type, $sub_type)   X-Ref
Check if the event should be included in the statistics counter.

param: string $type
param: string $sub_type
return: boolean

isAction($type, $sub_type)   X-Ref
Check if event type is an action.

param: string $type
param: string $sub_type
return: boolean

getDataArray()   X-Ref
A helper which makes it easier for systems to save the data.
Add all relevant properties to a assoc. array.
There are no NULL values. Empty string or 0 is used instead.
Used by both Drupal and WordPress.

return: array with keyed values

getFormatArray()   X-Ref
A helper which makes it easier for systems to save the data.
Used in WordPress.

return: array with strings