Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Class: mod_scorm_external  - X-Ref

SCORM module external functions

view_scorm_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

view_scorm($scormid)   X-Ref
Trigger the course module viewed event.

param: int $scormid the scorm instance id
return: array of warnings and status result

view_scorm_returns()   X-Ref
Returns description of method result value

return: external_description

get_scorm_attempt_count_parameters()   X-Ref
Describes the parameters for get_scorm_attempt_count.

return: external_function_parameters

get_scorm_attempt_count($scormid, $userid, $ignoremissingcompletion = false)   X-Ref
Return the number of attempts done by a user in the given SCORM.

param: int $scormid the scorm id
param: int $userid the user id
param: bool $ignoremissingcompletion ignores attempts that haven't reported a grade/completion
return: array of warnings and the attempts count

get_scorm_attempt_count_returns()   X-Ref
Describes the get_scorm_attempt_count return value.

return: external_single_structure

get_scorm_scoes_parameters()   X-Ref
Describes the parameters for get_scorm_scoes.

return: external_function_parameters

get_scorm_scoes($scormid, $organization = '')   X-Ref
Returns a list containing all the scoes data related to the given scorm id

param: int $scormid the scorm id
param: string $organization the organization id
return: array warnings and the scoes data

get_scorm_scoes_returns()   X-Ref
Describes the get_scorm_scoes return value.

return: external_single_structure

get_scorm_user_data_parameters()   X-Ref
Describes the parameters for get_scorm_user_data.

return: external_function_parameters

get_scorm_user_data($scormid, $attempt)   X-Ref
Retrieves user tracking and SCO data and default SCORM values

param: int $scormid the scorm id
param: int $attempt the attempt number
return: array warnings and the scoes data

get_scorm_user_data_returns()   X-Ref
Describes the get_scorm_user_data return value.

return: external_single_structure

insert_scorm_tracks_parameters()   X-Ref
Describes the parameters for insert_scorm_tracks.

return: external_function_parameters

insert_scorm_tracks($scoid, $attempt, $tracks)   X-Ref
Saves a SCORM tracking record.
It will overwrite any existing tracking data for this attempt.
Validation should be performed before running the function to ensure the user will not lose any existing attempt data.

param: int $scoid the SCO id
param: string $attempt the attempt number
param: array $tracks the track records to be stored
return: array warnings and the scoes data

insert_scorm_tracks_returns()   X-Ref
Describes the insert_scorm_tracks return value.

return: external_single_structure

get_scorm_sco_tracks_parameters()   X-Ref
Describes the parameters for get_scorm_sco_tracks.

return: external_function_parameters

get_scorm_sco_tracks($scoid, $userid, $attempt = 0)   X-Ref
Retrieves SCO tracking data for the given user id and attempt number

param: int $scoid the sco id
param: int $userid the user id
param: int $attempt the attempt number
return: array warnings and the scoes data

get_scorm_sco_tracks_returns()   X-Ref
Describes the get_scorm_sco_tracks return value.

return: external_single_structure

get_scorms_by_courses_parameters()   X-Ref
Describes the parameters for get_scorms_by_courses.

return: external_function_parameters

get_scorms_by_courses($courseids = array()   X-Ref
Returns a list of scorms in a provided list of courses,
if no list is provided all scorms that the user can view will be returned.

param: array $courseids the course ids
return: array the scorm details

get_scorms_by_courses_returns()   X-Ref
Describes the get_scorms_by_courses return value.

return: external_single_structure

launch_sco_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

launch_sco($scormid, $scoid = 0)   X-Ref
Trigger the course module viewed event.

param: int $scormid the SCORM instance id
param: int $scoid the SCO id
return: array of warnings and status result

launch_sco_returns()   X-Ref
Returns description of method result value

return: external_description

get_scorm_access_information_parameters()   X-Ref
Describes the parameters for get_scorm_access_information.

return: external_external_function_parameters

get_scorm_access_information($scormid)   X-Ref
Return access information for a given scorm.

param: int $scormid scorm instance id
return: array of warnings and the access information

get_scorm_access_information_returns()   X-Ref
Describes the get_scorm_access_information return value.

return: external_single_structure