Class ilSCORMOfflineMode.
More...
◆ __construct()
ilSCORMOfflineMode::__construct |
( |
| ) |
|
Constructor.
- Parameters
-
Definition at line 46 of file class.ilSCORMOfflineMode.php.
References $_GET, ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), and read().
49 $this->
ilias = $ilias;
50 $this->
id =
$_GET[
'ref_id'];
52 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
54 $this->cmd_url =
'./ilias.php?baseClass=ilSAHSPresentationGUI&cmd=';
55 $this->lm_cmd_url =
'./ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=' . $this->
id .
'&cmd=';
56 $this->lm_info_url = $this->lm_cmd_url .
'infoScreen';
57 $this->player12_url = $this->cmd_url .
'offlineMode_player12';
58 $this->player2004_url = $this->cmd_url .
'offlineMode_player2004';
59 $this->som_url = $this->cmd_url .
'offlineMode_som';
60 $this->offlineMode =
'online';
61 $this->sop_index =
'./Modules/ScormAicc/sop/sop_index.html';
62 $this->sop_appcache =
'./Modules/ScormAicc/sop/sop.appcache';
63 $this->sop_dir =
'./Modules/ScormAicc/templates/sop/';
64 $this->som_dir =
'./Modules/ScormAicc/templates/som/';
65 $this->scripts_dir =
'./Modules/ScormAicc/scripts/';
66 $this->images_dir =
'./templates/default/images/scorm/';
67 $this->pouchdb_js =
'./libs/bower/bower_components/pouchdb/dist/pouchdb.min.js';
68 $this->jquery_js =
'./libs/bower/bower_components/jquery/dist/jquery.min.js';
69 $this->bootstrap_js =
'./libs/bower/bower_components/bootstrap/dist/js/bootstrap.min.js';
70 $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 243 of file class.ilSCORMOfflineMode.php.
245 $iliasDomain = substr(ILIAS_HTTP_PATH, 7);
246 if (substr($iliasDomain, 0, 1) ==
"\/") {
247 $iliasDomain = substr($iliasDomain, 1);
249 if (substr($iliasDomain, 0, 4) ==
"www.") {
250 $iliasDomain = substr($iliasDomain, 4);
252 return $iliasDomain .
';' . CLIENT_ID;
◆ getLmManifestEntries()
ilSCORMOfflineMode::getLmManifestEntries |
( |
| ) |
|
Definition at line 144 of file class.ilSCORMOfflineMode.php.
References $log, $name, $obj_id, and ilUtil\getWebspaceDir().
147 $log->write(
"getLmManifestEntries");
149 $manifest_string =
"";
151 foreach ($objects as
$name => $object) {
152 if (preg_match(
'/\/\.+/',
$name)) {
155 if (preg_match(
'/\.zip$/',
$name)) {
159 $manifest_string .= self::encodeuri(
$name) .
"\n";
162 return $manifest_string;
static getWebspaceDir($mode="filesystem")
get webspace directory
◆ getOfflineMode()
ilSCORMOfflineMode::getOfflineMode |
( |
| ) |
|
◆ getSopManifestEntries()
ilSCORMOfflineMode::getSopManifestEntries |
( |
| ) |
|
Definition at line 74 of file class.ilSCORMOfflineMode.php.
References $log, $name, ilUtil\getImagePath(), iljQueryUtil\getLocaljQueryPath(), and ilUtil\getStyleSheetLocation().
77 $log->write(
"getSopManifestEntries ");
78 $manifest_string =
"";
81 $BASE_DIR =
'./Modules/Scorm2004/';
91 $manifest_string .= $BASE_DIR .
'templates/default/player.css' .
"\n";
92 $manifest_string .= $BASE_DIR .
'scripts/buildrte/rte.js' .
"\n";
93 $manifest_string .= $BASE_DIR .
'scripts/ilNestedList.js' .
"\n";
95 $manifest_string .= $this->player2004_url .
"\n";
97 $manifest_string .= $this->player12_url .
"\n";
99 $manifest_string .= $this->som_url .
"\n";
102 foreach ($objects as
$name => $object) {
103 if (preg_match(
'/\/\.+/',
$name)) {
107 $manifest_string .= self::encodeuri(
$name) .
"\n";
110 foreach ($objects as
$name => $object) {
111 if (preg_match(
'/\/\.+/',
$name)) {
115 $manifest_string .= self::encodeuri(
$name) .
"\n";
119 foreach ($objects as
$name => $object) {
120 if (preg_match(
'/\/\.+/',
$name)) {
124 $manifest_string .= self::encodeuri(
$name) .
"\n";
127 foreach ($objects as
$name => $object) {
128 if (preg_match(
'/\/\.+/',
$name)) {
132 $manifest_string .= self::encodeuri(
$name) .
"\n";
135 $manifest_string .= $this->pouchdb_js .
"\n";
136 $manifest_string .= $this->jquery_js .
"\n";
137 $manifest_string .= $this->bootstrap_js .
"\n";
138 $manifest_string .= $this->bootstrap_css .
"\n";
141 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 268 of file class.ilSCORMOfflineMode.php.
References $ilDB, $ilUser, $res, $row, ilChangeEvent\_lookupReadEvents(), and array.
Referenced by tracking2sop().
271 $package_attempts = 0;
274 $first_access = null;
276 $last_status_change = null;
277 $total_time_sec = null;
278 $sco_total_time_sec = 0;
280 $percentage_completed = 0;
284 $res = $ilDB->queryF(
285 'SELECT * FROM sahs_user WHERE obj_id=%s AND user_id=%s',
286 array(
'integer',
'integer'),
287 array($this->obj_id,$ilUser->getID())
289 while (
$row = $ilDB->fetchAssoc(
$res)) {
290 $package_attempts =
$row[
'package_attempts'];
291 $module_version =
$row[
'module_version'];
292 $last_visited =
$row[
'last_visited'];
293 if (
$row[
'first_access'] != null) {
294 $first_access = strtotime(
$row[
'first_access'])*1000;
296 if (
$row[
'last_access'] != null) {
297 $last_access = strtotime(
$row[
'last_access'])*1000;
299 $total_time_sec =
$row[
'total_time_sec'];
300 $sco_total_time_sec =
$row[
'sco_total_time_sec'];
301 $status =
$row[
'status'];
302 $percentage_completed =
$row[
'percentage_completed'];
304 if ($first_access == null) {
305 include_once
'./Services/Tracking/classes/class.ilChangeEvent.php';
307 foreach ($all as $event) {
308 $first_access = strtotime($event[
'first_access'])*1000;
311 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 ...
Create styles array
The data for the language used.
◆ il2sopUserData()
ilSCORMOfflineMode::il2sopUserData |
( |
| ) |
|
◆ read()
ilSCORMOfflineMode::read |
( |
| ) |
|
|
private |
Definition at line 429 of file class.ilSCORMOfflineMode.php.
References $ilDB, $ilUser, $res, $row, and array.
Referenced by __construct().
432 $res = $ilDB->queryF(
433 'SELECT offline_mode FROM sahs_user WHERE obj_id=%s AND user_id=%s',
434 array(
'integer',
'integer'),
435 array($this->obj_id,$ilUser->getId())
437 while (
$row = $ilDB->fetchAssoc(
$res)) {
438 if (
$row[
'offline_mode'] != null &&
$row[
'offline_mode'] !=
'') {
439 $this->offlineMode =
$row[
'offline_mode'];
441 $this->offlineMode =
"online";
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
◆ scormPlayerUnloadForSop2il()
ilSCORMOfflineMode::scormPlayerUnloadForSop2il |
( |
|
$data | ) |
|
Definition at line 383 of file class.ilSCORMOfflineMode.php.
References $data, $GLOBALS, $ilDB, $ilUser, $res, ilChangeEvent\_updateAccessForScormOfflinePlayer(), array, and date.
387 if (
$data->first_access != null) {
388 $first_access=
date(
'Y-m-d H:i:s', round(
$data->first_access/1000));
392 if (
$data->last_access != null) {
393 $i_last_access = round(
$data->last_access/1000);
394 $last_access=
date(
'Y-m-d H:i:s', $i_last_access);
395 include_once(
"./Services/Tracking/classes/class.ilChangeEvent.php");
398 $last_status_change=null;
399 if (
$data->last_status_change != null) {
400 $last_status_change=
date(
'Y-m-d H:i:s', round(
$data->last_status_change/1000));
402 $GLOBALS[
'ilLog']->write(
'first_access=' . $first_access);
403 $res = $ilDB->queryF(
404 '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',
405 array(
'timestamp',
'timestamp',
'timestamp',
'text',
'integer',
'integer',
'integer'),
406 array($first_access,$last_access,$last_status_change,
$data->last_visited,
$data->module_version, $this->obj_id,$ilUser->getId())
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.
◆ setOfflineMode()
ilSCORMOfflineMode::setOfflineMode |
( |
|
$a_mode | ) |
|
Definition at line 414 of file class.ilSCORMOfflineMode.php.
References $ilDB, $ilUser, $res, and array.
417 $res = $ilDB->queryF(
418 'UPDATE sahs_user SET offline_mode=%s WHERE obj_id=%s AND user_id=%s',
419 array(
'text',
'integer',
'integer'),
420 array($a_mode, $this->obj_id,$ilUser->getId())
422 $this->offlineMode=$a_mode;
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
◆ sop2il()
ilSCORMOfflineMode::sop2il |
( |
| ) |
|
Definition at line 314 of file class.ilSCORMOfflineMode.php.
References $data, $GLOBALS, $i, $ilDB, $ilUser, $in, $lm_set, $result, $ret, array, exit, header, ilSCORM2004StoreData\setCMIData(), ilObjSCORMTracking\storeJsApiCmi(), ilObjSCORMTracking\syncGlobalStatus(), ilSCORM2004StoreData\syncGlobalStatus(), and ilUtil\yn2tf().
318 $in = file_get_contents(
"php://input");
323 $ret[
'err'][] =
"no post data recieved";
324 print(json_encode(
$ret));
327 $userId=$ilUser->getID();
330 if ($this->type ==
'scorm2004') {
331 $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));
332 while ($lm_rec = $ilDB->fetchAssoc(
$lm_set)) {
333 $defaultLessonMode=($lm_rec[
"default_lesson_mode"]);
339 include_once
'./Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
354 if (!is_array($a_r)) {
363 include_once
"./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php";
375 $ret[
'err'][] =
"invalid post data recieved";
377 $ret[
'msg'][] =
"post data recieved";
379 header(
'Content-Type: text/plain; charset=UTF-8');
380 print json_encode(
$ret);
static syncGlobalStatus($userId, $packageId, $data, $new_global_status, $time_from_lms)
static storeJsApiCmi($user_id, $obj_id, $data)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Add a drawing to the header
Create styles array
The data for the language used.
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
◆ stopOfflineModeForUser()
static ilSCORMOfflineMode::stopOfflineModeForUser |
( |
|
$obj_id, |
|
|
|
$user_id |
|
) |
| |
|
static |
◆ tracking2sop()
ilSCORMOfflineMode::tracking2sop |
( |
| ) |
|
Definition at line 166 of file class.ilSCORMOfflineMode.php.
References $_GET, $ilUser, $obj_id, $result, ilObject\_lookupDescription(), ilObject\_lookupTitle(), array, ilObjSCORMInitData\get_max_attempts(), ilObjSCORMInitData\getIliasScormData(), ilObjSCORMInitData\getIliasScormResources(), ilObjSCORMInitData\getIliasScormTree(), ilObjSCORMInitData\getIliasScormVars(), ilObjectLP\getInstance(), header, il2sopSahsUser(), and il2sopUserData().
170 header(
'Content-Type: text/javascript; charset=UTF-8');
172 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
174 $module_version = $ob->getModuleVersion();
177 $scorm_version =
"1.2";
178 if ($this->type ==
"scorm2004") {
179 $scorm_version =
"2004";
183 $learning_progress_enabled = 1;
184 include_once
'./Services/Object/classes/class.ilObjectLP.php';
186 if ($olp->getCurrentMode() == 0) {
187 $learning_progress_enabled = 0;
190 $certificate_enabled = 0;
193 $ilias_version = $ilias->getSetting(
"ilias_version");
195 if ($this->type ==
'scorm2004') {
196 include_once
"./Modules/Scorm2004/classes/ilSCORM13Player.php";
198 $init_data = json_encode($ob2004->getConfigForPlayer());
199 $resources = json_decode($ob2004->getCPDataInit());
201 $max_attempt = $ob2004->get_max_attempts();
202 $adlact_data = json_decode($ob2004->getADLActDataInit());
205 include_once
"./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMInitData.php";
216 'client_data' =>
array(
230 $learning_progress_enabled,
231 $certificate_enabled,
236 '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
Add a drawing to the header
Create styles array
The data for the language used.
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: