Search moodle.org's
Developer Documentation

See Release Notes

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

(no description)

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

Defines 1 class

get_states:: (4 methods):
  execute_parameters()
  execute()
  convert_since_param_to_timestamp()
  execute_returns()


Class: get_states  - X-Ref

This is the external API for generic xAPI get all states ids.

execute_parameters()   X-Ref
Parameters for execute

return: external_function_parameters

execute(string $component,string $activityiri,string $agent,?string $registration = null,?string $since = null)   X-Ref
Process a get states request.

param: string $component The component name in frankenstyle.
param: string $activityiri The activity IRI.
param: string $agent The agent JSON.
param: string|null $registration The xAPI registration UUID.
param: string|null $since A ISO 8601 timestamps or a numeric timestamp.
return: array the list of the stored state ids

convert_since_param_to_timestamp(?string $since)   X-Ref
Convert the xAPI since param into a Moodle integer timestamp.

According to xAPI standard, the "since" param must follow the ISO 8601
format. However, because Moodle do not use this format, we accept both
numeric timestamp and ISO 8601.

param: string|null $since A ISO 8601 timestamps or a numeric timestamp.
return: null|int the resulting timestamp or null if since is null.

execute_returns()   X-Ref
Return for execute.

return: external_multiple_structure