ILIAS  release_7 Revision v7.30-3-g800a261c036
ilSCORMOfflineMode Class Reference

Class ilSCORMOfflineMode. More...

+ Collaboration diagram for ilSCORMOfflineMode:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getSopManifestEntries ()
 
 getLmManifestEntries ()
 
 tracking2sop ()
 
 getClientIdSop ()
 
 il2sopUserData ()
 
 il2sopSahsUser ()
 
 sop2il ()
 
 scormPlayerUnloadForSop2il ($data)
 
 setOfflineMode ($a_mode)
 
 getOfflineMode ()
 

Static Public Member Functions

static checkIfAnyoneIsInOfflineMode ($obj_id)
 
static usersInOfflineMode ($obj_id)
 
static stopOfflineModeForUser ($obj_id, $user_id)
 
static encodeuri ($path)
 

Data Fields

 $type
 
 $obj_id
 
 $offlineMode
 
 $cmd_url
 
 $lm_cmd_url
 
 $player12_url
 
 $player2004_url
 
 $som_url
 
 $sop_dir
 
 $som_dir
 
 $scripts_dir
 
 $sop_index
 
 $sop_appcache
 
 $lm_dir
 
 $lm_index
 
 $lm_appcache
 
 $lm_imsmanifest_xml
 
 $imsmanifest
 
 $debug = false
 

Private Member Functions

 read ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSCORMOfflineMode::__construct ( )

Constructor.

Parameters
int$a_idObject ID @access public

Definition at line 46 of file class.ilSCORMOfflineMode.php.

47 {
48 global $DIC;
49 $ilias = $DIC['ilias'];
50 $this->ilias = $ilias;
51 $this->id = $_GET['ref_id'];
52 $this->obj_id = ilObject::_lookupObjectId($_GET['ref_id']);
53 include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
54 $this->type = ilObjSAHSLearningModule::_lookupSubType($this->obj_id);
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 = './node_modules/bootstrap/dist/js/bootstrap.min.js';
71 $this->bootstrap_css = './node_modules/bootstrap/dist/css/bootstrap.min.css';
72 $this->read();
73 }
$_GET["client_id"]
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, )
static _lookupObjectId($a_ref_id)
lookup object id
global $DIC
Definition: goto.php:24
redirection script todo: (a better solution should control the processing via a xml file)

References $_GET, $DIC, ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkIfAnyoneIsInOfflineMode()

static ilSCORMOfflineMode::checkIfAnyoneIsInOfflineMode (   $obj_id)
static

Definition at line 463 of file class.ilSCORMOfflineMode.php.

464 {
465 global $DIC;
466 $ilDB = $DIC['ilDB'];
467 $res = $ilDB->queryF(
468 "SELECT count(*) cnt FROM sahs_user WHERE obj_id=%s AND offline_mode = 'offline'",
469 array('integer'),
470 array($obj_id)
471 );
472 $val_rec = $ilDB->fetchAssoc($res);
473 if ($val_rec["cnt"] == 0) {
474 return false;
475 }
476 return true;
477 }
foreach($_POST as $key=> $value) $res
global $ilDB

References $DIC, $ilDB, $obj_id, and $res.

Referenced by ilObjSCORM2004LearningModuleGUI\initPropertiesForm(), and ilObjSCORMLearningModuleGUI\initPropertiesForm().

+ Here is the caller graph for this function:

◆ encodeuri()

static ilSCORMOfflineMode::encodeuri (   $path)
static

Definition at line 507 of file class.ilSCORMOfflineMode.php.

508 {
509 return implode('/', array_map('rawurlencode', explode('/', $path)));
510 }

Referenced by getLmManifestEntries(), and getSopManifestEntries().

+ Here is the caller graph for this function:

◆ getClientIdSop()

ilSCORMOfflineMode::getClientIdSop ( )

Definition at line 247 of file class.ilSCORMOfflineMode.php.

248 {
249 $iliasDomain = substr(ILIAS_HTTP_PATH, 7);
250 if (substr($iliasDomain, 0, 1) == "\/") {
251 $iliasDomain = substr($iliasDomain, 1);
252 }
253 if (substr($iliasDomain, 0, 4) == "www.") {
254 $iliasDomain = substr($iliasDomain, 4);
255 }
256 return $iliasDomain . ';' . CLIENT_ID;
257 }
const CLIENT_ID
Definition: constants.php:39

References CLIENT_ID.

◆ getLmManifestEntries()

ilSCORMOfflineMode::getLmManifestEntries ( )

Definition at line 146 of file class.ilSCORMOfflineMode.php.

147 { // ToDo: database support !!
148 global $DIC;
149 $log = $DIC['log'];
150 $log->write("getLmManifestEntries");
151 $this->lm_dir = ilUtil::getWebspaceDir("filesystem") . '/lm_data/lm_' . $this->obj_id;
152 $manifest_string = "";
153 $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->lm_dir));
154 foreach ($objects as $name => $object) {
155 if (preg_match('/\/\.+/', $name)) {
156 continue;
157 }
158 if (preg_match('/\.zip$/', $name)) {
159 continue;
160 }
161 //$manifest_string .= preg_replace('/^\./','./Modules/ScormAicc',$name) . "\n"; // for cli
162 $manifest_string .= self::encodeuri($name) . "\n";
163 }
164 //$log->write($manifest_string);
165 return $manifest_string;
166 }
static getWebspaceDir($mode="filesystem")
get webspace directory
if($format !==null) $name
Definition: metadata.php:230
$log
Definition: result.php:15

References $DIC, $log, $name, $obj_id, encodeuri(), and ilUtil\getWebspaceDir().

+ Here is the call graph for this function:

◆ getOfflineMode()

ilSCORMOfflineMode::getOfflineMode ( )

Definition at line 439 of file class.ilSCORMOfflineMode.php.

References $offlineMode.

◆ getSopManifestEntries()

ilSCORMOfflineMode::getSopManifestEntries ( )

Definition at line 75 of file class.ilSCORMOfflineMode.php.

76 {
77 global $DIC;
78 $log = $DIC['log'];
79 $log->write("getSopManifestEntries ");
80 $manifest_string = "";
81 if (!$this->debug) {
82 // if ($this->type == "scorm2004") {
83 $BASE_DIR = './Modules/Scorm2004/';
84 $manifest_string .= ilUtil::getImagePath("scorm/asset.svg", false) . "\n";
85 $manifest_string .= ilUtil::getImagePath("scorm/completed.svg", false) . "\n";
86 $manifest_string .= ilUtil::getImagePath("scorm/not_attempted.svg", false) . "\n";
87 $manifest_string .= ilUtil::getImagePath("scorm/running.svg", false) . "\n";
88 $manifest_string .= ilUtil::getImagePath("scorm/incomplete.svg", false) . "\n";
89 $manifest_string .= ilUtil::getImagePath("scorm/passed.svg", false) . "\n";
90 $manifest_string .= ilUtil::getImagePath("scorm/failed.svg", false) . "\n";
91 // $manifest_string .= ilUtil::getImagePath("scorm/browsed.svg",false) . "\n";
92 $manifest_string .= ilUtil::getStyleSheetLocation() . "\n";
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";
96 $manifest_string .= iljQueryUtil::getLocaljQueryPath() . "\n";
97 $manifest_string .= $this->player2004_url . "\n";
98 // } else {
99 $manifest_string .= $this->player12_url . "\n";
100 // }
101 $manifest_string .= $this->som_url . "\n";
102 // $log->write("Manifest: ".$manifest_string);
103 $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->sop_dir));
104 foreach ($objects as $name => $object) {
105 if (preg_match('/\/\.+/', $name)) {
106 continue;
107 }
108 //$manifest_string .= preg_replace('/^\./','./Modules/ScormAicc',$name) . "\n"; // for cli
109 $manifest_string .= self::encodeuri($name) . "\n";
110 }
111 $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->som_dir));
112 foreach ($objects as $name => $object) {
113 if (preg_match('/\/\.+/', $name)) {
114 continue;
115 }
116 //$manifest_string .= preg_replace('/^\./','./Modules/ScormAicc',$name) . "\n"; // for cli
117 $manifest_string .= self::encodeuri($name) . "\n";
118 }
119
120 $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->scripts_dir));
121 foreach ($objects as $name => $object) {
122 if (preg_match('/\/\.+/', $name)) { //UK statt .+ .js und SCORM-Scripts weg
123 continue;
124 }
125 //$manifest_string .= preg_replace('/^\./','./Modules/ScormAicc',$name) . "\n"; // for cli
126 $manifest_string .= self::encodeuri($name) . "\n";
127 }
128 $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->images_dir));
129 foreach ($objects as $name => $object) {
130 if (preg_match('/\/\.+/', $name)) {
131 continue;
132 }
133 //$manifest_string .= preg_replace('/^\./','./Modules/ScormAicc',$name) . "\n"; // for cli
134 $manifest_string .= self::encodeuri($name) . "\n";
135 }
136
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";
141 }
142 //$log->write($manifest_string);
143 return $manifest_string;
144 }
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()

References $DIC, $log, $name, encodeuri(), ilUtil\getImagePath(), iljQueryUtil\getLocaljQueryPath(), and ilUtil\getStyleSheetLocation().

+ Here is the call graph for this function:

◆ il2sopSahsUser()

ilSCORMOfflineMode::il2sopSahsUser ( )

Definition at line 273 of file class.ilSCORMOfflineMode.php.

274 {
275 global $DIC;
276 $ilDB = $DIC['ilDB'];
277 $ilUser = $DIC['ilUser'];
278 $package_attempts = 0;
279 $module_version = 1;//if module_version in sop is different...
280 $last_visited = "";
281 $first_access = null;
282 $last_access = null;
283 $last_status_change = null;
284 $total_time_sec = null;
285 $sco_total_time_sec = 0;
286 $status = 0;
287 $percentage_completed = 0;
288 $user_data = "";
289
290 global $DIC;
291 $ilDB = $DIC['ilDB'];
292 $ilUser = $DIC['ilUser'];
293 $res = $ilDB->queryF(
294 'SELECT * FROM sahs_user WHERE obj_id=%s AND user_id=%s',
295 array('integer','integer'),
296 array($this->obj_id,$ilUser->getID())
297 );
298 while ($row = $ilDB->fetchAssoc($res)) {
299 $package_attempts = $row['package_attempts'];
300 $module_version = $row['module_version'];
301 $last_visited = $row['last_visited'];
302 if ($row['first_access'] != null) {
303 $first_access = strtotime($row['first_access']) * 1000;//check Oracle!
304 }
305 if ($row['last_access'] != null) {
306 $last_access = strtotime($row['last_access']) * 1000;//check Oracle!
307 }
308 $total_time_sec = $row['total_time_sec'];
309 $sco_total_time_sec = $row['sco_total_time_sec'];
310 $status = $row['status'];
311 $percentage_completed = $row['percentage_completed'];
312 }
313 if ($first_access == null) {
314 include_once './Services/Tracking/classes/class.ilChangeEvent.php';
315 $all = ilChangeEvent::_lookupReadEvents($this->obj_id, $ilUser->getID());
316 foreach ($all as $event) {
317 $first_access = strtotime($event['first_access']) * 1000;//
318 }
319 }
320 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);
321 }
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 ...
$ilUser
Definition: imgupload.php:18

References $DIC, $ilDB, $ilUser, $res, and ilChangeEvent\_lookupReadEvents().

Referenced by tracking2sop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ il2sopUserData()

ilSCORMOfflineMode::il2sopUserData ( )

Definition at line 259 of file class.ilSCORMOfflineMode.php.

260 {
261 global $DIC;
262 $ilUser = $DIC['ilUser'];
263 return array(
264 $ilUser->getLogin(),
265 "",
266 $ilUser->getFirstname(),
267 $ilUser->getLastname(),
268 $ilUser->getUTitle(),
269 $ilUser->getGender(),
270 $ilUser->getID()
271 );
272 }

References $DIC, and $ilUser.

Referenced by tracking2sop().

+ Here is the caller graph for this function:

◆ read()

ilSCORMOfflineMode::read ( )
private

Definition at line 444 of file class.ilSCORMOfflineMode.php.

445 {
446 global $DIC;
447 $ilDB = $DIC['ilDB'];
448 $ilUser = $DIC['ilUser'];
449 $res = $ilDB->queryF(
450 'SELECT offline_mode FROM sahs_user WHERE obj_id=%s AND user_id=%s',
451 array('integer','integer'),
452 array($this->obj_id,$ilUser->getId())
453 );
454 while ($row = $ilDB->fetchAssoc($res)) {
455 if ($row['offline_mode'] != null && $row['offline_mode'] != '') {
456 $this->offlineMode = $row['offline_mode'];
457 } else {
458 $this->offlineMode = "online";
459 }
460 }
461 }

References $DIC, $ilDB, $ilUser, and $res.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ scormPlayerUnloadForSop2il()

ilSCORMOfflineMode::scormPlayerUnloadForSop2il (   $data)

Definition at line 394 of file class.ilSCORMOfflineMode.php.

395 {
396 global $DIC;
397 $ilDB = $DIC['ilDB'];
398 $ilUser = $DIC['ilUser'];
399 $first_access = null;
400 if ($data->first_access != null) {
401 $first_access = date('Y-m-d H:i:s', round($data->first_access / 1000));
402 }
403 $last_access = null;
404 $i_last_access = null;
405 if ($data->last_access != null) {
406 $i_last_access = round($data->last_access / 1000);
407 $last_access = date('Y-m-d H:i:s', $i_last_access);
408 include_once("./Services/Tracking/classes/class.ilChangeEvent.php");
409 ilChangeEvent::_updateAccessForScormOfflinePlayer($this->obj_id, $ilUser->getId(), $i_last_access, $first_access);
410 }
411 $last_status_change = null;
412 if ($data->last_status_change != null) {
413 $last_status_change = date('Y-m-d H:i:s', round($data->last_status_change / 1000));
414 }
415 $GLOBALS['DIC']['ilLog']->write('first_access=' . $first_access);
416 $res = $ilDB->queryF(
417 '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',
418 array('timestamp','timestamp','timestamp','text','integer','integer','integer'),
419 array($first_access,$last_access,$last_status_change,$data->last_visited,$data->module_version, $this->obj_id,$ilUser->getId())
420 );
421
422 //populate last_status_change
423 return true;
424 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static _updateAccessForScormOfflinePlayer($obj_id, $usr_id, $i_last_access, $t_first_access)
_updateAccessForScormOfflinePlayer needed to synchronize last_access and first_access when learning m...
$data
Definition: storeScorm.php:23

References $data, $DIC, $GLOBALS, $ilDB, $ilUser, $res, and ilChangeEvent\_updateAccessForScormOfflinePlayer().

+ Here is the call graph for this function:

◆ setOfflineMode()

ilSCORMOfflineMode::setOfflineMode (   $a_mode)

Definition at line 427 of file class.ilSCORMOfflineMode.php.

428 {
429 global $DIC;
430 $ilDB = $DIC['ilDB'];
431 $ilUser = $DIC['ilUser'];
432 $res = $ilDB->queryF(
433 'UPDATE sahs_user SET offline_mode=%s WHERE obj_id=%s AND user_id=%s',
434 array('text','integer','integer'),
435 array($a_mode, $this->obj_id,$ilUser->getId())
436 );
437 $this->offlineMode = $a_mode;
438 }

References $DIC, $ilDB, $ilUser, and $res.

◆ sop2il()

ilSCORMOfflineMode::sop2il ( )

Definition at line 323 of file class.ilSCORMOfflineMode.php.

324 {
325 // sleep(5);
326 global $DIC;
327 $ilDB = $DIC['ilDB'];
328 $ilUser = $DIC['ilUser'];
329 $in = file_get_contents("php://input");
330 $GLOBALS['DIC']['ilLog']->write($in);
331 $ret = array('msg' => array(),'err' => array());
332
333 if (!$in || $in == "") {
334 $ret['err'][] = "no post data recieved";
335 print(json_encode($ret));
336 exit;
337 }
338 $userId = $ilUser->getID();
339 $result = true;
340
341 if ($this->type == 'scorm2004') {
342 $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));
343 while ($lm_rec = $ilDB->fetchAssoc($lm_set)) {
344 $defaultLessonMode = ($lm_rec["default_lesson_mode"]);
345 $interactions = (ilUtil::yn2tf($lm_rec["interactions"]));
346 $objectives = (ilUtil::yn2tf($lm_rec["objectives"]));
347 $comments = (ilUtil::yn2tf($lm_rec["comments"]));
348 $time_from_lms = (ilUtil::yn2tf($lm_rec["time_from_lms"]));
349 }
350 include_once './Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
351 $data = json_decode($in);
352 $GLOBALS['DIC']['ilLog']->write('cmi_count=' . count($data->cmi));
353 for ($i = 0; $i < count($data->cmi); $i++) {
354 if ($result == true) {
355 //$a_r=array();
356 $cdata = $data->cmi[$i];
358 $userId,
359 $this->obj_id,
360 $data->cmi[$i],//json_decode($data->cmi[$i]),
361 $comments,
362 $interactions,
363 $objectives
364 );
365 if (!is_array($a_r)) {
366 $result = false;
367 }
368 }
369 }
370 if ($result == true) {
371 $result = ilSCORM2004StoreData::syncGlobalStatus($userId, $this->obj_id, $data, $data->now_global_status, $time_from_lms);
372 }
373 } else {
374 include_once "./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php";
375 $data = json_decode($in);
376 $result = ilObjSCORMTracking::storeJsApiCmi($userId, $this->obj_id, $data);
377 if ($result == true) {
378 $result = ilObjSCORMTracking::syncGlobalStatus($userId, $this->obj_id, $data, $data->now_global_status);
379 }
380 }
381 if ($result == true) {
382 $result = self::scormPlayerUnloadForSOP2il($data);
383 }
384
385 if ($result == false) {
386 $ret['err'][] = "invalid post data recieved";
387 } else {
388 $ret['msg'][] = "post data recieved";
389 }
390 header('Content-Type: text/plain; charset=UTF-8');
391 print json_encode($ret);
392 }
$result
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
if(! $in) print
static syncGlobalStatus($userId, $packageId, $data, $new_global_status)
static storeJsApiCmi($user_id, $obj_id, $data)
static setCMIData($userId, $packageId, $data, $getComments, $getInteractions, $getObjectives)
static syncGlobalStatus($userId, $packageId, $data, $new_global_status, $time_from_lms)
static yn2tf($a_yn)
convert "y"/"n" to true/false
exit
Definition: login.php:29
$i
Definition: metadata.php:24
$ret
Definition: parser.php:6
$lm_set

References $data, $DIC, $GLOBALS, $i, $ilDB, $ilUser, $in, $lm_set, $result, $ret, exit, print, ilSCORM2004StoreData\setCMIData(), ilObjSCORMTracking\storeJsApiCmi(), ilObjSCORMTracking\syncGlobalStatus(), ilSCORM2004StoreData\syncGlobalStatus(), and ilUtil\yn2tf().

+ Here is the call graph for this function:

◆ stopOfflineModeForUser()

static ilSCORMOfflineMode::stopOfflineModeForUser (   $obj_id,
  $user_id 
)
static

Definition at line 496 of file class.ilSCORMOfflineMode.php.

497 {
498 global $DIC;
499 $ilDB = $DIC['ilDB'];
500 $res = $ilDB->queryF(
501 "UPDATE sahs_user SET offline_mode='online' WHERE obj_id=%s AND user_id=%s",
502 array('integer','integer'),
503 array($obj_id,$user_id)
504 );
505 }

References $DIC, $ilDB, $obj_id, and $res.

Referenced by ilObjSCORMLearningModuleGUI\confirmedStopUserOfflineMode().

+ Here is the caller graph for this function:

◆ tracking2sop()

ilSCORMOfflineMode::tracking2sop ( )

Definition at line 169 of file class.ilSCORMOfflineMode.php.

170 {
171 global $DIC;
172 $ilUser = $DIC['ilUser'];
173 $ilias = $DIC['ilias'];
174 // $this->setOfflineMode("il2sop");
175 header('Content-Type: text/javascript; charset=UTF-8');
176
177 include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
178 $ob = new ilObjSAHSLearningModule($this->id);
179 $module_version = $ob->getModuleVersion();
180 $sahs_user = $this->il2sopSahsUser();
181 $support_mail = "";//TODO
182 $scorm_version = "1.2";
183 if ($this->type == "scorm2004") {
184 $scorm_version = "2004";
185 }
186 $tree = "";
187
188 $learning_progress_enabled = 1;
189 include_once './Services/Object/classes/class.ilObjectLP.php';
190 $olp = ilObjectLP::getInstance($this->obj_id);
191 if ($olp->getCurrentMode() == 0) {
192 $learning_progress_enabled = 0;
193 }
194
195 $certificate_enabled = 0;
196
197 $adlact_data = null;
198 $ilias_version = $ilias->getSetting("ilias_version");
199
200 if ($this->type == 'scorm2004') {
201 $ob2004 = new ilSCORM13PlayerGUI();
202 $init_data = json_encode($ob2004->getConfigForPlayer());
203 $resources = json_decode($ob2004->getCPDataInit());
204 $cmi = $ob2004->getCMIData($ilUser->getID(), $this->obj_id);
205 $max_attempt = $ob2004->get_max_attempts();
206 $adlact_data = json_decode($ob2004->getADLActDataInit());
207 //$globalobj_data = $ob2004->readGObjectiveInit();
208 } else {
209 include_once "./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMInitData.php";
210 $slm_obj = new ilObjSCORMLearningModule($_GET["ref_id"]);
211 $init_data = ilObjSCORMInitData::getIliasScormVars($slm_obj);
212 $resources = json_decode(ilObjSCORMInitData::getIliasScormResources($this->obj_id));
213 $tree = json_decode(ilObjSCORMInitData::getIliasScormTree($this->obj_id));
214 $cmi = json_decode(ilObjSCORMInitData::getIliasScormData($this->obj_id));
215 $max_attempt = ilObjSCORMInitData::get_max_attempts($this->obj_id);
216 }
217 //UK max_attempt weg!
218 // if ($max_attempt == null) $max_attempt = 0;
219 $result = array(
220 'client_data' => array(
221 $support_mail
222 ),
223 'user_data' => $this->il2sopUserData(),
224 'lm' => array(
225 ilObject::_lookupTitle($this->obj_id),
226 ilObject::_lookupDescription($this->obj_id),
227 $scorm_version,
228 1,//active
229 $init_data,
230 $resources,
231 $tree,
232 $module_version,
233 "", //offline_zip_created!!!!!!!!
234 $learning_progress_enabled,
235 $certificate_enabled,
236 $max_attempt,
237 $adlact_data,
238 $ilias_version
239 ),
240 'sahs_user' => $sahs_user,
241 'cmi' => $cmi
242 );
243
244 print(json_encode($result));
245 }
Class ilObjSCORMLearningModule.
static getIliasScormData($a_packageId)
static getIliasScormVars($slm_obj)
static get_max_attempts($a_packageId)
Get max.
static getIliasScormResources($a_packageId)
static getIliasScormTree($a_packageId)
Class ilObjSCORMLearningModule.
static getInstance($a_obj_id)
static _lookupTitle($a_id)
lookup object title
static _lookupDescription($a_id)
lookup object description

References $_GET, $DIC, $ilUser, $result, ilObject\_lookupDescription(), ilObject\_lookupTitle(), ilObjSCORMInitData\get_max_attempts(), ilObjSCORMInitData\getIliasScormData(), ilObjSCORMInitData\getIliasScormResources(), ilObjSCORMInitData\getIliasScormTree(), ilObjSCORMInitData\getIliasScormVars(), ilObjectLP\getInstance(), il2sopSahsUser(), il2sopUserData(), and print.

+ Here is the call graph for this function:

◆ usersInOfflineMode()

static ilSCORMOfflineMode::usersInOfflineMode (   $obj_id)
static

Definition at line 479 of file class.ilSCORMOfflineMode.php.

480 {
481 global $DIC;
482 $ilDB = $DIC['ilDB'];
483 $users = array();
484 $res = $ilDB->queryF(
485 "SELECT user_id, lastname, firstname FROM sahs_user, usr_data "
486 . "WHERE sahs_user.obj_id=%s AND sahs_user.offline_mode = 'offline' AND sahs_user.user_id=usr_data.usr_id",
487 array('integer'),
488 array($obj_id)
489 );
490 while ($row = $ilDB->fetchAssoc($res)) {
491 $users[] = $row;
492 }
493 return $users;
494 }

References $DIC, $ilDB, $obj_id, and $res.

Referenced by ilSCORMOfflineModeUsersTableGUI\parse().

+ Here is the caller graph for this function:

Field Documentation

◆ $cmd_url

ilSCORMOfflineMode::$cmd_url

Definition at line 21 of file class.ilSCORMOfflineMode.php.

◆ $debug

ilSCORMOfflineMode::$debug = false

Definition at line 38 of file class.ilSCORMOfflineMode.php.

◆ $imsmanifest

ilSCORMOfflineMode::$imsmanifest

Definition at line 37 of file class.ilSCORMOfflineMode.php.

◆ $lm_appcache

ilSCORMOfflineMode::$lm_appcache

Definition at line 35 of file class.ilSCORMOfflineMode.php.

◆ $lm_cmd_url

ilSCORMOfflineMode::$lm_cmd_url

Definition at line 22 of file class.ilSCORMOfflineMode.php.

◆ $lm_dir

ilSCORMOfflineMode::$lm_dir

Definition at line 33 of file class.ilSCORMOfflineMode.php.

◆ $lm_imsmanifest_xml

ilSCORMOfflineMode::$lm_imsmanifest_xml

Definition at line 36 of file class.ilSCORMOfflineMode.php.

◆ $lm_index

ilSCORMOfflineMode::$lm_index

Definition at line 34 of file class.ilSCORMOfflineMode.php.

◆ $obj_id

ilSCORMOfflineMode::$obj_id

◆ $offlineMode

ilSCORMOfflineMode::$offlineMode

Definition at line 20 of file class.ilSCORMOfflineMode.php.

Referenced by getOfflineMode().

◆ $player12_url

ilSCORMOfflineMode::$player12_url

Definition at line 23 of file class.ilSCORMOfflineMode.php.

◆ $player2004_url

ilSCORMOfflineMode::$player2004_url

Definition at line 24 of file class.ilSCORMOfflineMode.php.

◆ $scripts_dir

ilSCORMOfflineMode::$scripts_dir

Definition at line 29 of file class.ilSCORMOfflineMode.php.

◆ $som_dir

ilSCORMOfflineMode::$som_dir

Definition at line 28 of file class.ilSCORMOfflineMode.php.

◆ $som_url

ilSCORMOfflineMode::$som_url

Definition at line 25 of file class.ilSCORMOfflineMode.php.

◆ $sop_appcache

ilSCORMOfflineMode::$sop_appcache

Definition at line 32 of file class.ilSCORMOfflineMode.php.

◆ $sop_dir

ilSCORMOfflineMode::$sop_dir

Definition at line 27 of file class.ilSCORMOfflineMode.php.

◆ $sop_index

ilSCORMOfflineMode::$sop_index

Definition at line 31 of file class.ilSCORMOfflineMode.php.

◆ $type

ilSCORMOfflineMode::$type

Definition at line 18 of file class.ilSCORMOfflineMode.php.


The documentation for this class was generated from the following file: