Class ilSCORMOfflineMode.
More...
◆ __construct()
ilSCORMOfflineMode::__construct |
( |
| ) |
|
Constructor.
- Parameters
-
Definition at line 46 of file class.ilSCORMOfflineMode.php.
References $_GET, $DIC, ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), and read().
49 $ilias = $DIC[
'ilias'];
50 $this->
ilias = $ilias;
51 $this->
id =
$_GET[
'ref_id'];
53 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
55 $this->cmd_url =
'./ilias.php?baseClass=ilSAHSPresentationGUI&cmd=';
56 $this->lm_cmd_url =
'./ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=' . $this->
id .
'&cmd=';
57 $this->lm_info_url = $this->lm_cmd_url .
'infoScreen';
58 $this->player12_url = $this->cmd_url .
'offlineMode_player12';
59 $this->player2004_url = $this->cmd_url .
'offlineMode_player2004';
60 $this->som_url = $this->cmd_url .
'offlineMode_som';
61 $this->offlineMode =
'online';
62 $this->sop_index =
'./Modules/ScormAicc/sop/sop_index.html';
63 $this->sop_appcache =
'./Modules/ScormAicc/sop/sop.appcache';
64 $this->sop_dir =
'./Modules/ScormAicc/templates/sop/';
65 $this->som_dir =
'./Modules/ScormAicc/templates/som/';
66 $this->scripts_dir =
'./Modules/ScormAicc/scripts/';
67 $this->images_dir =
'./templates/default/images/scorm/';
68 $this->pouchdb_js =
'./libs/bower/bower_components/pouchdb/dist/pouchdb.min.js';
69 $this->jquery_js =
'./libs/bower/bower_components/jquery/dist/jquery.min.js';
70 $this->bootstrap_js =
'./libs/bower/bower_components/bootstrap/dist/js/bootstrap.min.js';
71 $this->bootstrap_css =
'./libs/bower/bower_components/bootstrap/dist/css/bootstrap.min.css';
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, )
static _lookupObjectId($a_ref_id)
lookup object id
redirection script todo: (a better solution should control the processing via a xml file) ...
◆ checkIfAnyoneIsInOfflineMode()
static ilSCORMOfflineMode::checkIfAnyoneIsInOfflineMode |
( |
|
$obj_id | ) |
|
|
static |
◆ encodeuri()
static ilSCORMOfflineMode::encodeuri |
( |
|
$path | ) |
|
|
static |
◆ getClientIdSop()
ilSCORMOfflineMode::getClientIdSop |
( |
| ) |
|
Definition at line 248 of file class.ilSCORMOfflineMode.php.
250 $iliasDomain = substr(ILIAS_HTTP_PATH, 7);
251 if (substr($iliasDomain, 0, 1) ==
"\/") {
252 $iliasDomain = substr($iliasDomain, 1);
254 if (substr($iliasDomain, 0, 4) ==
"www.") {
255 $iliasDomain = substr($iliasDomain, 4);
257 return $iliasDomain .
';' . CLIENT_ID;
◆ getLmManifestEntries()
ilSCORMOfflineMode::getLmManifestEntries |
( |
| ) |
|
◆ getOfflineMode()
ilSCORMOfflineMode::getOfflineMode |
( |
| ) |
|
◆ getSopManifestEntries()
ilSCORMOfflineMode::getSopManifestEntries |
( |
| ) |
|
Definition at line 75 of file class.ilSCORMOfflineMode.php.
References $DIC, $log, $name, ilUtil\getImagePath(), iljQueryUtil\getLocaljQueryPath(), and ilUtil\getStyleSheetLocation().
79 $log->write(
"getSopManifestEntries ");
80 $manifest_string =
"";
83 $BASE_DIR =
'./Modules/Scorm2004/';
93 $manifest_string .= $BASE_DIR .
'templates/default/player.css' .
"\n";
94 $manifest_string .= $BASE_DIR .
'scripts/buildrte/rte.js' .
"\n";
95 $manifest_string .= $BASE_DIR .
'scripts/ilNestedList.js' .
"\n";
97 $manifest_string .= $this->player2004_url .
"\n";
99 $manifest_string .= $this->player12_url .
"\n";
101 $manifest_string .= $this->som_url .
"\n";
104 foreach ($objects as
$name => $object) {
105 if (preg_match(
'/\/\.+/',
$name)) {
109 $manifest_string .= self::encodeuri(
$name) .
"\n";
112 foreach ($objects as
$name => $object) {
113 if (preg_match(
'/\/\.+/',
$name)) {
117 $manifest_string .= self::encodeuri(
$name) .
"\n";
121 foreach ($objects as
$name => $object) {
122 if (preg_match(
'/\/\.+/',
$name)) {
126 $manifest_string .= self::encodeuri(
$name) .
"\n";
129 foreach ($objects as
$name => $object) {
130 if (preg_match(
'/\/\.+/',
$name)) {
134 $manifest_string .= self::encodeuri(
$name) .
"\n";
137 $manifest_string .= $this->pouchdb_js .
"\n";
138 $manifest_string .= $this->jquery_js .
"\n";
139 $manifest_string .= $this->bootstrap_js .
"\n";
140 $manifest_string .= $this->bootstrap_css .
"\n";
143 return $manifest_string;
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getLocaljQueryPath()
◆ il2sopSahsUser()
ilSCORMOfflineMode::il2sopSahsUser |
( |
| ) |
|
Definition at line 274 of file class.ilSCORMOfflineMode.php.
References $DIC, $ilDB, $ilUser, $res, $row, and ilChangeEvent\_lookupReadEvents().
Referenced by tracking2sop().
277 $ilDB = $DIC[
'ilDB'];
279 $package_attempts = 0;
282 $first_access = null;
284 $last_status_change = null;
285 $total_time_sec = null;
286 $sco_total_time_sec = 0;
288 $percentage_completed = 0;
292 $ilDB = $DIC[
'ilDB'];
295 'SELECT * FROM sahs_user WHERE obj_id=%s AND user_id=%s',
296 array(
'integer',
'integer'),
297 array($this->obj_id,
$ilUser->getID())
300 $package_attempts =
$row[
'package_attempts'];
301 $module_version =
$row[
'module_version'];
302 $last_visited =
$row[
'last_visited'];
303 if (
$row[
'first_access'] != null) {
304 $first_access = strtotime(
$row[
'first_access']) * 1000;
306 if (
$row[
'last_access'] != null) {
307 $last_access = strtotime(
$row[
'last_access']) * 1000;
309 $total_time_sec =
$row[
'total_time_sec'];
310 $sco_total_time_sec =
$row[
'sco_total_time_sec'];
311 $status =
$row[
'status'];
312 $percentage_completed =
$row[
'percentage_completed'];
314 if ($first_access == null) {
315 include_once
'./Services/Tracking/classes/class.ilChangeEvent.php';
317 foreach ($all as $event) {
318 $first_access = strtotime($event[
'first_access']) * 1000;
321 return array($package_attempts, $module_version, $last_visited, $first_access, $last_access, $last_status_change, $total_time_sec, $sco_total_time_sec, $status, $percentage_completed, $user_data);
foreach($_POST as $key=> $value) $res
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object which happened after the last time the user caught ...
◆ il2sopUserData()
ilSCORMOfflineMode::il2sopUserData |
( |
| ) |
|
◆ read()
ilSCORMOfflineMode::read |
( |
| ) |
|
|
private |
Definition at line 445 of file class.ilSCORMOfflineMode.php.
References $DIC, $ilDB, $ilUser, $res, and $row.
Referenced by __construct().
448 $ilDB = $DIC[
'ilDB'];
451 'SELECT offline_mode FROM sahs_user WHERE obj_id=%s AND user_id=%s',
452 array(
'integer',
'integer'),
453 array($this->obj_id,
$ilUser->getId())
456 if (
$row[
'offline_mode'] != null &&
$row[
'offline_mode'] !=
'') {
457 $this->offlineMode =
$row[
'offline_mode'];
459 $this->offlineMode =
"online";
foreach($_POST as $key=> $value) $res
◆ scormPlayerUnloadForSop2il()
ilSCORMOfflineMode::scormPlayerUnloadForSop2il |
( |
|
$data | ) |
|
Definition at line 395 of file class.ilSCORMOfflineMode.php.
References $data, $DIC, $GLOBALS, $ilDB, $ilUser, $res, and ilChangeEvent\_updateAccessForScormOfflinePlayer().
398 $ilDB = $DIC[
'ilDB'];
400 $first_access = null;
401 if (
$data->first_access != null) {
402 $first_access = date(
'Y-m-d H:i:s', round(
$data->first_access / 1000));
405 $i_last_access = null;
406 if (
$data->last_access != null) {
407 $i_last_access = round(
$data->last_access / 1000);
408 $last_access = date(
'Y-m-d H:i:s', $i_last_access);
409 include_once(
"./Services/Tracking/classes/class.ilChangeEvent.php");
412 $last_status_change = null;
413 if (
$data->last_status_change != null) {
414 $last_status_change = date(
'Y-m-d H:i:s', round(
$data->last_status_change / 1000));
416 $GLOBALS[
'DIC'][
'ilLog']->write(
'first_access=' . $first_access);
418 'UPDATE sahs_user SET first_access=%s, last_access=%s, last_status_change=%s, last_visited=%s, module_version=%s WHERE obj_id=%s AND user_id=%s',
419 array(
'timestamp',
'timestamp',
'timestamp',
'text',
'integer',
'integer',
'integer'),
420 array($first_access,$last_access,$last_status_change,
$data->last_visited,
$data->module_version, $this->obj_id,
$ilUser->getId())
static _updateAccessForScormOfflinePlayer($obj_id, $usr_id, $i_last_access, $t_first_access)
_updateAccessForScormOfflinePlayer needed to synchronize last_access and first_access when learning m...
foreach($_POST as $key=> $value) $res
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
◆ setOfflineMode()
ilSCORMOfflineMode::setOfflineMode |
( |
|
$a_mode | ) |
|
Definition at line 428 of file class.ilSCORMOfflineMode.php.
References $DIC, $ilDB, $ilUser, and $res.
431 $ilDB = $DIC[
'ilDB'];
434 'UPDATE sahs_user SET offline_mode=%s WHERE obj_id=%s AND user_id=%s',
435 array(
'text',
'integer',
'integer'),
436 array($a_mode, $this->obj_id,
$ilUser->getId())
438 $this->offlineMode = $a_mode;
foreach($_POST as $key=> $value) $res
◆ sop2il()
ilSCORMOfflineMode::sop2il |
( |
| ) |
|
Definition at line 324 of file class.ilSCORMOfflineMode.php.
References $data, $DIC, $GLOBALS, $i, $ilDB, $ilUser, $in, $lm_set, $result, $ret, exit, ilSCORM2004StoreData\setCMIData(), ilObjSCORMTracking\storeJsApiCmi(), ilObjSCORMTracking\syncGlobalStatus(), ilSCORM2004StoreData\syncGlobalStatus(), and ilUtil\yn2tf().
328 $ilDB = $DIC[
'ilDB'];
330 $in = file_get_contents(
"php://input");
332 $ret = array(
'msg' => array(),
'err' => array());
335 $ret[
'err'][] =
"no post data recieved";
336 print(json_encode(
$ret));
342 if ($this->type ==
'scorm2004') {
343 $lm_set =
$ilDB->queryF(
'SELECT default_lesson_mode, interactions, objectives, comments, time_from_lms FROM sahs_lm WHERE id = %s', array(
'integer'), array($this->obj_id));
345 $defaultLessonMode = ($lm_rec[
"default_lesson_mode"]);
351 include_once
'./Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
353 $GLOBALS[
'DIC'][
'ilLog']->write(
'cmi_count=' . count(
$data->cmi));
366 if (!is_array($a_r)) {
375 include_once
"./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php";
387 $ret[
'err'][] =
"invalid post data recieved";
389 $ret[
'msg'][] =
"post data recieved";
391 header(
'Content-Type: text/plain; charset=UTF-8');
392 print json_encode(
$ret);
static syncGlobalStatus($userId, $packageId, $data, $new_global_status, $time_from_lms)
static storeJsApiCmi($user_id, $obj_id, $data)
if(php_sapi_name() !='cli') $in
static setCMIData($userId, $packageId, $data, $getComments, $getInteractions, $getObjectives)
static syncGlobalStatus($userId, $packageId, $data, $new_global_status)
static yn2tf($a_yn)
convert "y"/"n" to true/false
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
◆ stopOfflineModeForUser()
static ilSCORMOfflineMode::stopOfflineModeForUser |
( |
|
$obj_id, |
|
|
|
$user_id |
|
) |
| |
|
static |
◆ tracking2sop()
ilSCORMOfflineMode::tracking2sop |
( |
| ) |
|
Definition at line 169 of file class.ilSCORMOfflineMode.php.
References $_GET, $DIC, $ilUser, $obj_id, $result, $tree, ilObject\_lookupDescription(), ilObject\_lookupTitle(), ilObjSCORMInitData\get_max_attempts(), ilObjSCORMInitData\getIliasScormData(), ilObjSCORMInitData\getIliasScormResources(), ilObjSCORMInitData\getIliasScormTree(), ilObjSCORMInitData\getIliasScormVars(), ilObjectLP\getInstance(), il2sopSahsUser(), and il2sopUserData().
173 $ilias = $DIC[
'ilias'];
175 header(
'Content-Type: text/javascript; charset=UTF-8');
177 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
179 $module_version = $ob->getModuleVersion();
182 $scorm_version =
"1.2";
183 if ($this->type ==
"scorm2004") {
184 $scorm_version =
"2004";
188 $learning_progress_enabled = 1;
189 include_once
'./Services/Object/classes/class.ilObjectLP.php';
191 if ($olp->getCurrentMode() == 0) {
192 $learning_progress_enabled = 0;
195 $certificate_enabled = 0;
198 $ilias_version = $ilias->getSetting(
"ilias_version");
200 if ($this->type ==
'scorm2004') {
201 include_once
"./Modules/Scorm2004/classes/ilSCORM13Player.php";
203 $init_data = json_encode($ob2004->getConfigForPlayer());
204 $resources = json_decode($ob2004->getCPDataInit());
206 $max_attempt = $ob2004->get_max_attempts();
207 $adlact_data = json_decode($ob2004->getADLActDataInit());
210 include_once
"./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMInitData.php";
221 'client_data' => array(
235 $learning_progress_enabled,
236 $certificate_enabled,
241 'sahs_user' => $sahs_user,
static getIliasScormData($a_packageId)
static getIliasScormResources($a_packageId)
static _lookupTitle($a_id)
lookup object title
static getIliasScormVars($slm_obj)
static get_max_attempts($a_packageId)
Get max.
static _lookupDescription($a_id)
lookup object description
static getInstance($a_obj_id)
Class ilObjSCORMLearningModule.
Class ilObjSCORMLearningModule.
static getIliasScormTree($a_packageId)
◆ usersInOfflineMode()
static ilSCORMOfflineMode::usersInOfflineMode |
( |
|
$obj_id | ) |
|
|
static |
◆ $cmd_url
ilSCORMOfflineMode::$cmd_url |
◆ $debug
ilSCORMOfflineMode::$debug = false |
◆ $imsmanifest
ilSCORMOfflineMode::$imsmanifest |
◆ $lm_appcache
ilSCORMOfflineMode::$lm_appcache |
◆ $lm_cmd_url
ilSCORMOfflineMode::$lm_cmd_url |
◆ $lm_dir
ilSCORMOfflineMode::$lm_dir |
◆ $lm_imsmanifest_xml
ilSCORMOfflineMode::$lm_imsmanifest_xml |
◆ $lm_index
ilSCORMOfflineMode::$lm_index |
◆ $obj_id
ilSCORMOfflineMode::$obj_id |
◆ $offlineMode
ilSCORMOfflineMode::$offlineMode |
◆ $player12_url
ilSCORMOfflineMode::$player12_url |
◆ $player2004_url
ilSCORMOfflineMode::$player2004_url |
◆ $scripts_dir
ilSCORMOfflineMode::$scripts_dir |
◆ $som_dir
ilSCORMOfflineMode::$som_dir |
◆ $som_url
ilSCORMOfflineMode::$som_url |
◆ $sop_appcache
ilSCORMOfflineMode::$sop_appcache |
◆ $sop_dir
ilSCORMOfflineMode::$sop_dir |
◆ $sop_index
ilSCORMOfflineMode::$sop_index |
◆ $type
ilSCORMOfflineMode::$type |
The documentation for this class was generated from the following file: