You are here

function hook_opigno_scorm_ui_commit in Opigno 7

Implements hook_opigno_scorm_ui_commit().

Allows module to persist data provided by the SCORM package SCOs. The $data parameter contains a complete representation of the data set on the API object.

Important note! Unlike hook_opigno_scorm_ui_register_cmi_data(), which accepts either associate arrays or objects, the $data variable is an object.

Parameters

object $scorm:

object $data:

2 functions implement hook_opigno_scorm_ui_commit()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

opigno_scorm_quiz_opigno_scorm_ui_commit in modules/scorm/quiz/opigno_scorm_quiz.module
Implements hook_opigno_scorm_ui_commit().
opigno_scorm_ui_opigno_scorm_ui_commit in modules/scorm/ui/opigno_scorm_ui.module
Implements hook_opigno_scorm_ui_commit().
1 invocation of hook_opigno_scorm_ui_commit()
opigno_scorm_ui_ajax_commit in modules/scorm/ui/includes/opigno_scorm_ui.ajax.inc
AJAX callback: SCORM committed data.

File

modules/scorm/ui/opigno_scorm_ui.api.php, line 73
This file contains module hooks definitions and documentation.

Code

function hook_opigno_scorm_ui_commit($scorm, $data) {
  global $user;

  // Store the last position.
  if (!empty($data->cmi->location)) {
    opigno_scorm_scorm_cmi_set($user->uid, $scorm->id, 'cmi.location', $data->cmi->location);
  }
}