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';
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;
150 $log->write(
"getLmManifestEntries");
152 $manifest_string =
"";
154 foreach ($objects as
$name => $object) {
155 if (preg_match(
'/\/\.+/',
$name)) {
158 if (preg_match(
'/\.zip$/',
$name)) {
162 $manifest_string .= self::encodeuri(
$name) .
"\n";
165 return $manifest_string;
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,
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;
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);
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);
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())
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;
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";
467 $ilDB = $DIC[
'ilDB'];
469 "SELECT count(*) cnt FROM sahs_user WHERE obj_id=%s AND offline_mode = 'offline'",
474 if ($val_rec[
"cnt"] == 0) {
483 $ilDB = $DIC[
'ilDB'];
486 "SELECT user_id, lastname, firstname FROM sahs_user, usr_data " 487 .
"WHERE sahs_user.obj_id=%s AND sahs_user.offline_mode = 'offline' AND sahs_user.user_id=usr_data.usr_id",
500 $ilDB = $DIC[
'ilDB'];
502 "UPDATE sahs_user SET offline_mode='online' WHERE obj_id=%s AND user_id=%s",
503 array(
'integer',
'integer'),
510 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)
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
redirection script todo: (a better solution should control the processing via a xml file) ...
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)
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.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Class ilObjSCORMLearningModule.
static getIliasScormTree($a_packageId)