26 $ilias = $DIC[
'ilias'];
35 $b_storeObjectives =
'false';
36 if ($slm_obj->getObjectives()) {
37 $b_storeObjectives =
'true';
39 $b_storeInteractions =
'false';
40 if ($slm_obj->getInteractions()) {
41 $b_storeInteractions =
'true';
43 $b_readInteractions =
'false';
44 $c_storeSessionTime =
's';
45 if ($slm_obj->getTime_from_lms()) {
46 $c_storeSessionTime =
'i';
48 $i_lessonScoreMax =
'-1';
49 $i_lessonMasteryScore = $slm_obj->getMasteryScore();
52 $b_messageLog =
'false';
53 if (
$ilLog->current_log_level == 30) {
54 $b_messageLog =
'true';
57 if (
$_GET[
"autolaunch"] !=
"") {
58 $launchId =
$_GET[
"autolaunch"];
61 if ($slm_obj->getSession()) {
62 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
65 if ($session_timeout > $max_idle) {
66 $session_timeout = $max_idle;
69 if ($session_timeout > $min_idle) {
70 $session_timeout = $min_idle;
72 $session_timeout -= 10;
74 $b_autoReview =
'false';
75 if ($slm_obj->getAutoReview()) {
76 $b_autoReview =
'true';
78 $b_autoSuspend =
'false';
79 if ($slm_obj->getAutoSuspend()) {
80 $b_autoSuspend =
'true';
83 if ($slm_obj->getDebug()) {
86 $b_autoContinue =
'false';
87 if ($slm_obj->getAutoContinue()) {
88 $b_autoContinue =
'true';
90 $b_checkSetValues =
'false';
91 if ($slm_obj->getCheck_values()) {
92 $b_checkSetValues =
'true';
94 $b_autoLastVisited =
'false';
95 if ($slm_obj->getAuto_last_visited()) {
96 $b_autoLastVisited =
'true';
97 if ($launchId ==
'0') {
98 $launchId = $slm_obj->getLastVisited(
$ilUser->getID());
102 $b_sessionDeactivated =
'false';
103 if ($slm_obj->getSessionDeactivated()) {
104 $b_sessionDeactivated =
'true';
110 $val_set =
$ilDB->queryF(
112 SELECT sc_item.obj_id,prereq_type,prerequisites,maxtimeallowed,timelimitaction,datafromlms,masteryscore 113 FROM sc_item, scorm_object 114 WHERE scorm_object.obj_id=sc_item.obj_id 115 AND scorm_object.c_type = %s 116 AND scorm_object.slm_id = %s',
117 array(
'text',
'integer'),
118 array(
'sit',$slm_obj->getId())
120 while ($val_rec =
$ilDB->fetchAssoc($val_set)) {
121 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) {
122 $tmp_man = array((
int) $val_rec[
"obj_id"],null,null,null,null,null,null);
123 if ($val_rec[
"prereq_type"] != null) {
124 $tmp_man[1] = self::encodeURIComponent($val_rec[
"prereq_type"]);
126 if ($val_rec[
"prerequisites"] != null) {
127 $tmp_man[2] = self::encodeURIComponent($val_rec[
"prerequisites"]);
129 if ($val_rec[
"maxtimeallowed"] != null) {
130 $tmp_man[3] = self::encodeURIComponent($val_rec[
"maxtimeallowed"]);
132 if ($val_rec[
"timelimitaction"] != null) {
133 $tmp_man[4] = self::encodeURIComponent($val_rec[
"timelimitaction"]);
135 if ($val_rec[
"datafromlms"] != null) {
136 $tmp_man[5] = self::encodeURIComponent($val_rec[
"datafromlms"]);
138 if ($val_rec[
"masteryscore"] != null) {
139 $tmp_man[6] = self::encodeURIComponent($val_rec[
"masteryscore"]);
146 .
'"refId":' .
$_GET[
"ref_id"] .
',' 147 .
'"objId":' . $slm_obj->getId() .
',' 148 .
'"clientId":"' . CLIENT_ID .
'",' 149 .
'"launchId":' . $launchId .
',' 151 .
'"pingSession":' . $session_timeout .
',' 152 .
'"studentId":"' . $slm_obj->getApiStudentId() .
'",' 153 .
'"studentName":"' . self::encodeURIComponent($slm_obj->getApiStudentName()) .
'",' 154 .
'"studentLogin":"' . self::encodeURIComponent($ilias->account->getLogin()) .
'",' 155 .
'"studentOu":"' . self::encodeURIComponent($ilias->account->getDepartment()) .
'",' 156 .
'"credit":"' . str_replace(
"_",
"-", $slm_obj->getCreditMode()) .
'",' 157 .
'"lesson_mode":"' . $slm_obj->getDefaultLessonMode() .
'",' 158 .
'"b_autoReview":' . $b_autoReview .
',' 159 .
'"b_autoSuspend":' . $b_autoSuspend .
',' 160 .
'"b_messageLog":' . $b_messageLog .
',' 161 .
'"b_checkSetValues":' . $b_checkSetValues .
',' 162 .
'"b_storeObjectives":' . $b_storeObjectives .
',' 163 .
'"b_storeInteractions":' . $b_storeInteractions .
',' 164 .
'"b_readInteractions":' . $b_readInteractions .
',' 165 .
'"c_storeSessionTime":"' . $c_storeSessionTime .
'",' 166 .
'"b_autoContinue":' . $b_autoContinue .
',' 167 .
'"b_autoLastVisited":' . $b_autoLastVisited .
',' 168 .
'"b_sessionDeactivated":' . $b_sessionDeactivated .
',' 169 .
'"i_lessonScoreMax":' . $i_lessonScoreMax .
',' 170 .
'"i_lessonMasteryScore":"' . $i_lessonMasteryScore .
'",' 171 .
'"b_debug":' . $b_debug .
',' 172 .
'"a_itemParameter":' . json_encode($a_man) .
',' 173 .
'"status":' . json_encode(self::getStatus($slm_obj->getId(),
$ilUser->getID(), $slm_obj->getAuto_last_visited())) .
',' 174 .
'"dataDirectory":"' . self::encodeURIComponent($slm_obj->getDataDirectory(
"output") .
'/') .
'",' 178 .
'"completed":"' . self::encodeURIComponent(
ilUtil::getImagePath(
'scorm/completed.svg')) .
'",' 180 .
'"incomplete":"' . self::encodeURIComponent(
ilUtil::getImagePath(
'scorm/incomplete.svg')) .
'",' 181 .
'"not_attempted":"' . self::encodeURIComponent(
ilUtil::getImagePath(
'scorm/not_attempted.svg')) .
'",' 186 .
'"wait":"' . self::encodeURIComponent(
$lng->txt(
"please_wait")) .
'",' 187 .
'"status":"' . self::encodeURIComponent(
$lng->txt(
"cont_status")) .
'",' 188 .
'"browsed":"' . self::encodeURIComponent(
$lng->txt(
"cont_sc_stat_browsed")) .
'",' 189 .
'"completed":"' . self::encodeURIComponent(
$lng->txt(
"cont_sc_stat_completed")) .
'",' 190 .
'"failed":"' . self::encodeURIComponent(
$lng->txt(
"cont_sc_stat_failed")) .
'",' 191 .
'"incomplete":"' . self::encodeURIComponent(
$lng->txt(
"cont_sc_stat_incomplete")) .
'",' 192 .
'"not_attempted":"' . self::encodeURIComponent(
$lng->txt(
"cont_sc_stat_not_attempted")) .
'",' 193 .
'"passed":"' . self::encodeURIComponent(
$lng->txt(
"cont_sc_stat_passed")) .
'",' 194 .
'"running":"' . self::encodeURIComponent(
$lng->txt(
"cont_sc_stat_running")) .
'"' static getCookieMaxLifetimeInSeconds()
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getIdleValue($fixedMode=false)
Returns the idle time in seconds.