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';
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;
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;
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,
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;
261 $ilUser->getFirstname(),
262 $ilUser->getLastname(),
263 $ilUser->getUTitle(),
264 $ilUser->getGender(),
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);
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);
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())
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;
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";
449 $res = $ilDB->queryF(
450 "SELECT count(*) cnt FROM sahs_user WHERE obj_id=%s AND offline_mode = 'offline'",
454 $val_rec = $ilDB->fetchAssoc(
$res);
455 if ($val_rec[
"cnt"] == 0) {
465 $res = $ilDB->queryF(
466 "SELECT user_id, lastname, firstname FROM sahs_user, usr_data " 467 .
"WHERE sahs_user.obj_id=%s AND sahs_user.offline_mode = 'offline' AND sahs_user.user_id=usr_data.usr_id",
471 while (
$row = $ilDB->fetchAssoc(
$res)) {
480 $res = $ilDB->queryF(
481 "UPDATE sahs_user SET offline_mode='online' WHERE obj_id=%s AND user_id=%s",
482 array(
'integer',
'integer'),
489 return implode(
'/', array_map(
'rawurlencode', explode(
'/',
$path)));
static getIliasScormData($a_packageId)
static syncGlobalStatus($userId, $packageId, $data, $new_global_status, $time_from_lms)
static storeJsApiCmi($user_id, $obj_id, $data)
static getIliasScormResources($a_packageId)
static stopOfflineModeForUser($obj_id, $user_id)
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
__construct()
Constructor.
static usersInOfflineMode($obj_id)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _lookupTitle($a_id)
lookup object title
static checkIfAnyoneIsInOfflineMode($obj_id)
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, )
static _lookupObjectId($a_ref_id)
lookup object id
static getIliasScormVars($slm_obj)
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
static get_max_attempts($a_packageId)
Get max.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupDescription($a_id)
lookup object description
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
redirection script todo: (a better solution should control the processing via a xml file) ...
Add a drawing to the header
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 ...
scormPlayerUnloadForSop2il($data)
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)
Class ilSCORMOfflineMode.
static yn2tf($a_yn)
convert "y"/"n" to true/false
static getLocaljQueryPath()
static getInstance($a_obj_id)
static getWebspaceDir($mode="filesystem")
get webspace directory
Class ilObjSCORMLearningModule.
Class ilObjSCORMLearningModule.
static getIliasScormTree($a_packageId)