43 $ilUser = $DIC->user();
44 $lng = $DIC->language();
45 $ilDB = $DIC->database();
50 $b_storeObjectives =
'false';
52 $b_storeObjectives =
'true';
54 $b_storeInteractions =
'false';
56 $b_storeInteractions =
'true';
58 $b_readInteractions =
'false';
59 $c_storeSessionTime =
's';
61 $c_storeSessionTime =
'i';
63 $i_lessonScoreMax =
'-1';
67 $b_messageLog =
'false';
72 if ($DIC->http()->wrapper()->query()->has(
'autolaunch')) {
73 $autoLaunch = $DIC->http()->wrapper()->query()->retrieve(
'autolaunch', $DIC->refinery()->kindlyTo()->string());
74 if ($autoLaunch !=
"") {
75 $launchId = $autoLaunch;
82 if ($session_timeout > $max_idle) {
83 $session_timeout = $max_idle;
86 if ($session_timeout > $min_idle) {
87 $session_timeout = $min_idle;
89 $session_timeout -= 10;
91 $b_autoReview =
'false';
93 $b_autoReview =
'true';
95 $b_autoSuspend =
'false';
97 $b_autoSuspend =
'true';
103 $b_autoContinue =
'false';
105 $b_autoContinue =
'true';
107 $b_checkSetValues =
'false';
109 $b_checkSetValues =
'true';
111 $b_autoLastVisited =
'false';
113 $b_autoLastVisited =
'true';
114 if ($launchId ==
'0') {
119 $b_sessionDeactivated =
'false';
121 $b_sessionDeactivated =
'true';
127 $val_set =
$ilDB->queryF(
129 SELECT sc_item.obj_id,prereq_type,prerequisites,maxtimeallowed,timelimitaction,datafromlms,masteryscore 130 FROM sc_item, scorm_object 131 WHERE scorm_object.obj_id=sc_item.obj_id 132 AND scorm_object.c_type = %s 133 AND scorm_object.slm_id = %s',
134 array(
'text',
'integer'),
135 array(
'sit',$slm_obj->
getId())
137 while ($val_rec =
$ilDB->fetchAssoc($val_set)) {
138 if ($val_rec[
"prereq_type"] !=
null || $val_rec[
"prerequisites"] !=
null || $val_rec[
"maxtimeallowed"] !=
null || $val_rec[
"timelimitaction"] !=
null || $val_rec[
"datafromlms"] !=
null || $val_rec[
"masteryscore"] !=
null) {
140 if ($val_rec[
"prereq_type"] !=
null) {
141 $tmp_man[1] = self::encodeURIComponent($val_rec[
"prereq_type"]);
143 if ($val_rec[
"prerequisites"] !=
null) {
144 $tmp_man[2] = self::encodeURIComponent($val_rec[
"prerequisites"]);
146 if ($val_rec[
"maxtimeallowed"] !=
null) {
147 $tmp_man[3] = self::encodeURIComponent($val_rec[
"maxtimeallowed"]);
149 if ($val_rec[
"timelimitaction"] !=
null) {
150 $tmp_man[4] = self::encodeURIComponent($val_rec[
"timelimitaction"]);
152 if ($val_rec[
"datafromlms"] !=
null) {
153 $tmp_man[5] = self::encodeURIComponent($val_rec[
"datafromlms"]);
155 if ($val_rec[
"masteryscore"] !=
null) {
156 $tmp_man[6] = self::encodeURIComponent($val_rec[
"masteryscore"]);
163 .
'"refId":' . $DIC->http()->wrapper()->query()->retrieve(
'ref_id', $DIC->refinery()->kindlyTo()->string()) .
',' 164 .
'"objId":' . $slm_obj->
getId() .
',' 166 .
'"launchId":' . $launchId .
',' 168 .
'"pingSession":' . $session_timeout .
',' 170 .
'"studentName":"' . self::encodeURIComponent($slm_obj->
getApiStudentName()) .
'",' 171 .
'"studentLogin":"' . self::encodeURIComponent($ilUser->getLogin()) .
'",' 172 .
'"studentOu":"' . self::encodeURIComponent($ilUser->getDepartment()) .
'",' 173 .
'"credit":"' . str_replace(
"_",
"-", $slm_obj->
getCreditMode()) .
'",' 175 .
'"b_autoReview":' . $b_autoReview .
',' 176 .
'"b_autoSuspend":' . $b_autoSuspend .
',' 177 .
'"b_messageLog":' . $b_messageLog .
',' 178 .
'"b_checkSetValues":' . $b_checkSetValues .
',' 179 .
'"b_storeObjectives":' . $b_storeObjectives .
',' 180 .
'"b_storeInteractions":' . $b_storeInteractions .
',' 181 .
'"b_readInteractions":' . $b_readInteractions .
',' 182 .
'"c_storeSessionTime":"' . $c_storeSessionTime .
'",' 183 .
'"b_autoContinue":' . $b_autoContinue .
',' 184 .
'"b_autoLastVisited":' . $b_autoLastVisited .
',' 185 .
'"b_sessionDeactivated":' . $b_sessionDeactivated .
',' 186 .
'"i_lessonScoreMax":' . $i_lessonScoreMax .
',' 187 .
'"i_lessonMasteryScore":"' . $i_lessonMasteryScore .
'",' 188 .
'"b_debug":' . $b_debug .
',' 189 .
'"a_itemParameter":' . json_encode($a_man) .
',' 190 .
'"status":' . json_encode(self::getStatus($slm_obj->
getId(), $ilUser->getID(), $slm_obj->
getAuto_last_visited())) .
',' 191 .
'"dataDirectory":"' . self::encodeURIComponent($slm_obj->
getDataDirectory(
"output") .
'/') .
'",' 195 .
'"completed":"' . self::encodeURIComponent(
ilUtil::getImagePath(
'scorm/completed.svg')) .
'",' 197 .
'"incomplete":"' . self::encodeURIComponent(
ilUtil::getImagePath(
'scorm/incomplete.svg')) .
'",' 198 .
'"not_attempted":"' . self::encodeURIComponent(
ilUtil::getImagePath(
'scorm/not_attempted.svg')) .
'",' 203 .
'"wait":"' . self::encodeURIComponent(
$lng->txt(
"please_wait")) .
'",' 204 .
'"status":"' . self::encodeURIComponent(
$lng->txt(
"cont_status")) .
'",' 205 .
'"browsed":"' . self::encodeURIComponent(
$lng->txt(
"cont_sc_stat_browsed")) .
'",' 206 .
'"completed":"' . self::encodeURIComponent(
$lng->txt(
"cont_sc_stat_completed")) .
'",' 207 .
'"failed":"' . self::encodeURIComponent(
$lng->txt(
"cont_sc_stat_failed")) .
'",' 208 .
'"incomplete":"' . self::encodeURIComponent(
$lng->txt(
"cont_sc_stat_incomplete")) .
'",' 209 .
'"not_attempted":"' . self::encodeURIComponent(
$lng->txt(
"cont_sc_stat_not_attempted")) .
'",' 210 .
'"passed":"' . self::encodeURIComponent(
$lng->txt(
"cont_sc_stat_passed")) .
'",' 211 .
'"running":"' . self::encodeURIComponent(
$lng->txt(
"cont_sc_stat_running")) .
'"' static getCookieMaxLifetimeInSeconds()
static getLogger(string $a_component_id)
Get component logger.
getSessionDeactivated()
sessionDisabled for SCORM 2004
static getIdleValue()
Returns the idle time in seconds.
getAutoReview()
get auto review as true/false for SCORM 1.2
const DEFAULT_MIN_IDLE
default value for settings that have not been defined in setup or administration yet ...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
getApiStudentId()
Get cmi.core.student_id / cmi.learner_id for API.
getLastVisited(int $user_id)
getApiStudentName()
Get cmi.core.student_name / cmi.learner_name for API note: 'lastname, firstname' is required for SCOR...
getDataDirectory(?string $mode="filesystem")
get data directory of lm
getCreditMode()
get credit mode
getDefaultLessonMode()
get default lesson mode