Class ilSCORMOfflineMode.
More...
◆ __construct()
ilSCORMOfflineMode::__construct |
( |
| ) |
|
◆ checkIfAnyoneIsInOfflineMode()
static ilSCORMOfflineMode::checkIfAnyoneIsInOfflineMode |
( |
|
$obj_id | ) |
|
|
static |
◆ getClientIdSop()
ilSCORMOfflineMode::getClientIdSop |
( |
| ) |
|
Definition at line 110 of file class.ilSCORMOfflineMode.php.
111 $iliasDomain = substr(ILIAS_HTTP_PATH,7);
112 if (substr($iliasDomain,0,1) ==
"\/") $iliasDomain = substr($iliasDomain,1);
113 if (substr($iliasDomain,0,4) ==
"www.") $iliasDomain = substr($iliasDomain,4);
114 return $iliasDomain.
';'.CLIENT_ID;
◆ getOfflineMode()
ilSCORMOfflineMode::getOfflineMode |
( |
| ) |
|
◆ il2sop()
ilSCORMOfflineMode::il2sop |
( |
| ) |
|
Definition at line 39 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(), il2sopUserData(), and setOfflineMode().
42 header(
'Content-Type: text/javascript; charset=UTF-8');
44 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
46 $module_version = $ob->getModuleVersion();
49 $scorm_version =
"1.2";
50 if ($this->type ==
"scorm2004") $scorm_version =
"2004";
53 $learning_progress_enabled = 1;
54 include_once
'./Services/Object/classes/class.ilObjectLP.php';
56 if ($olp->getCurrentMode() == 0) $learning_progress_enabled = 0;
58 $certificate_enabled = 0;
61 $ilias_version = $ilias->getSetting(
"ilias_version");
63 if ($this->type ==
'scorm2004') {
64 include_once
"./Modules/Scorm2004/classes/ilSCORM13Player.php";
66 $init_data = $ob2004->getConfigForPlayer();
67 $resources = json_decode($ob2004->getCPDataInit());
69 $max_attempt = $ob2004->get_max_attempts();
70 $adlact_data = json_decode($ob2004->getADLActDataInit());
73 include_once
"./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMInitData.php";
81 if ($max_attempt == null) $max_attempt = 0;
83 'client_data' =>
array(
97 $learning_progress_enabled,
103 '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)
◆ il2sopSahsUser()
ilSCORMOfflineMode::il2sopSahsUser |
( |
| ) |
|
Definition at line 129 of file class.ilSCORMOfflineMode.php.
References $ilDB, $ilUser, $res, $row, ilChangeEvent\_lookupReadEvents(), and array.
Referenced by il2sop().
131 $package_attempts = 0;
134 $first_access = null;
136 $last_status_change = null;
137 $total_time_sec = null;
138 $sco_total_time_sec = 0;
140 $percentage_completed = 0;
144 $res = $ilDB->queryF(
'SELECT * FROM sahs_user WHERE obj_id=%s AND user_id=%s',
145 array(
'integer',
'integer'),
146 array($this->obj_id,$ilUser->getID())
148 while(
$row = $ilDB->fetchAssoc(
$res))
150 $package_attempts =
$row[
'package_attempts'];
151 $module_version =
$row[
'module_version'];
152 $last_visited =
$row[
'last_visited'];
153 if (
$row[
'first_access'] != null) {
154 $first_access = strtotime(
$row[
'first_access'])*1000;
156 if (
$row[
'last_access'] != null) {
157 $last_access = strtotime(
$row[
'last_access'])*1000;
159 $total_time_sec =
$row[
'total_time_sec'];
160 $sco_total_time_sec =
$row[
'sco_total_time_sec'];
161 $status =
$row[
'status'];
162 $percentage_completed =
$row[
'percentage_completed'];
164 if ($first_access == null) {
165 include_once
'./Services/Tracking/classes/class.ilChangeEvent.php';
167 foreach($all as $event)
169 $first_access = strtotime($event[
'first_access'])*1000;
172 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);
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 |
( |
| ) |
|
Definition at line 117 of file class.ilSCORMOfflineMode.php.
References $ilUser, and array.
Referenced by il2sop().
122 $ilUser->getFirstname(),
123 $ilUser->getLastname(),
124 $ilUser->getUTitle(),
125 $ilUser->getGender(),
Create styles array
The data for the language used.
◆ read()
ilSCORMOfflineMode::read |
( |
| ) |
|
|
private |
Definition at line 279 of file class.ilSCORMOfflineMode.php.
References $ilDB, $ilUser, $res, $row, and array.
Referenced by __construct().
281 $res = $ilDB->queryF(
'SELECT offline_mode FROM sahs_user WHERE obj_id=%s AND user_id=%s',
282 array(
'integer',
'integer'),
283 array($this->obj_id,$ilUser->getId())
285 while(
$row = $ilDB->fetchAssoc(
$res))
287 if (
$row[
'offline_mode'] != null) {
288 $this->offlineMode =
$row[
'offline_mode'];
290 $this->offlineMode =
"online";
Create styles array
The data for the language used.
◆ scormPlayerUnloadForSop2il()
ilSCORMOfflineMode::scormPlayerUnloadForSop2il |
( |
|
$data | ) |
|
Definition at line 242 of file class.ilSCORMOfflineMode.php.
References $data, $GLOBALS, $ilDB, $ilUser, $res, ilChangeEvent\_updateAccessForScormOfflinePlayer(), array, and date.
245 if(
$data->first_access != null) $first_access=
date(
'Y-m-d H:i:s',round(
$data->first_access/1000));
248 if(
$data->last_access != null) {
249 $i_last_access = round(
$data->last_access/1000);
250 $last_access=
date(
'Y-m-d H:i:s',$i_last_access);
251 include_once(
"./Services/Tracking/classes/class.ilChangeEvent.php");
254 $last_status_change=null;
255 if(
$data->last_status_change != null) $last_status_change=
date(
'Y-m-d H:i:s',round(
$data->last_status_change/1000));
256 $GLOBALS[
'ilLog']->write(
'first_access='.$first_access);
257 $res = $ilDB->queryF(
'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',
258 array(
'timestamp',
'timestamp',
'timestamp',
'text',
'integer',
'integer',
'integer'),
259 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...
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.
◆ setOfflineMode()
ilSCORMOfflineMode::setOfflineMode |
( |
|
$a_mode | ) |
|
Definition at line 267 of file class.ilSCORMOfflineMode.php.
References $ilDB, $ilUser, $res, and array.
Referenced by il2sop().
269 $res = $ilDB->queryF(
'UPDATE sahs_user SET offline_mode=%s WHERE obj_id=%s AND user_id=%s',
270 array(
'text',
'integer',
'integer'),
271 array($a_mode, $this->obj_id,$ilUser->getId())
273 $this->offlineMode=$a_mode;
Create styles array
The data for the language used.
◆ sop2il()
ilSCORMOfflineMode::sop2il |
( |
| ) |
|
Definition at line 175 of file class.ilSCORMOfflineMode.php.
References $data, $GLOBALS, $ilDB, $ilUser, $in, $lm_set, $result, $ret, array, exit, header, ilSCORM2004StoreData\setCMIData(), ilObjSCORMTracking\storeJsApiCmi(), ilObjSCORMTracking\syncGlobalStatus(), ilSCORM2004StoreData\syncGlobalStatus(), and ilUtil\yn2tf().
178 $in = file_get_contents(
"php://input");
183 $ret[
'err'][] =
"no post data recieved";
184 print(json_encode(
$ret));
187 $userId=$ilUser->getID();
190 if ($this->type ==
'scorm2004') {
191 $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));
192 while($lm_rec = $ilDB->fetchAssoc(
$lm_set))
194 $defaultLessonMode=($lm_rec[
"default_lesson_mode"]);
200 include_once
'./Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
203 for ($i=0; $i<count(
$data->cmi); $i++) {
206 $cdata=
$data->cmi[$i];
215 if (!is_array($a_r))
$result=
false;
222 include_once
"./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php";
234 $ret[
'err'][] =
"invalid post data recieved";
236 $ret[
'msg'][] =
"post data recieved";
238 header(
'Content-Type: text/plain; charset=UTF-8');
239 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 |
◆ usersInOfflineMode()
static ilSCORMOfflineMode::usersInOfflineMode |
( |
|
$obj_id | ) |
|
|
static |
◆ $obj_id
ilSCORMOfflineMode::$obj_id |
◆ $offlineMode
ilSCORMOfflineMode::$offlineMode |
◆ $type
ilSCORMOfflineMode::$type |
The documentation for this class was generated from the following file: