Module: ScormEngine::Api::Endpoints::Registrations::LaunchHistory

Included in:
ScormEngine::Api::Endpoints
Defined in:
lib/scorm_engine/api/endpoints/registrations/launch_history.rb

Instance Method Summary collapse

Instance Method Details

#get_registration_launch_history(options = {}) ⇒ Array<ScormEngine::Models::RegistrationLaunchHistory>

Get launch history data associated with this registration

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :registration_id (String)

    ID for the registration.

  • :instance (String)

    () The instance of this registration to use. If not provided, the latest instance will be used.

  • :include_history_log (Boolean) — default: false

    Whether to include the history log in the launch history. The history log is a blob of XML that shows all of the SCORM-related calls inside the course. Depending on the course itself, these logs can get very large if a lot of calls are being made.

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/scorm_engine/api/endpoints/registrations/launch_history.rb', line 28

def get_registration_launch_history(options = {})
  require_options(options, :registration_id)

  options = options.dup
  registration_id = options.delete(:registration_id)
  options[:includeHistoryLog] = !!options.delete(:include_history_log)

  response = get("registrations/#{registration_id}/launchHistory", options)

  result = if response.success?
             response.body["launchHistory"].map do |history|
               ScormEngine::Models::RegistrationLaunchHistory.new_from_api(history)
             end
           end

  Response.new(raw_response: response, result: result)
end