5 require_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
6 require_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
25 'user_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'user_id'),
26 'learner_name' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'learner_name'),
27 'slm_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'slm_id'),
28 'mode' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'c_mode'),
29 'credit' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'credit'),
32 'accesscount' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'accesscount'),
33 'accessduration' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'accessduration'),
34 'accessed' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'accessed'),
35 'activityAbsoluteDuration' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'activityabsduration'),
36 'activityAttemptCount' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'activityattemptcount'),
37 'activityExperiencedDuration' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'activityexpduration'),
38 'activityProgressStatus' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'activityprogstatus'),
39 'attemptAbsoluteDuration' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'attemptabsduration'),
40 'attemptCompletionAmount' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'attemptcomplamount'),
41 'attemptCompletionStatus' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'attemptcomplstatus'),
42 'attemptExperiencedDuration' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'attemptexpduration'),
43 'attemptProgressStatus' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'attemptprogstatus'),
44 'audio_captioning' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'audio_captioning'),
45 'audio_level' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'audio_level'),
46 'availableChildren' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'availablechildren'),
47 'cmi_node_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'cmi_node_id'),
48 'completion' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'completion'),
49 'completion_status' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'completion_status'),
50 'completion_threshold' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'completion_threshold'),
51 'cp_node_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'cp_node_id'),
52 'created' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'created'),
53 'credit' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'credit'),
54 'delivery_speed' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'delivery_speed'),
55 'entry' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'c_entry'),
56 'exit' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'c_exit'),
57 'language' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'c_language'),
58 'launch_data' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'launch_data'),
59 'learner_name' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'learner_name'),
60 'location' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'location'),
61 'max' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'c_max'),
62 'min' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'c_min'),
63 'mode' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'c_mode'),
64 'modified' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'modified'),
65 'progress_measure' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'progress_measure'),
66 'raw' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'c_raw'),
67 'scaled' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'scaled'),
68 'scaled_passing_score' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'scaled_passing_score'),
69 'session_time' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'session_time'),
70 'success_status' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'success_status'),
71 'suspend_data' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'suspend_data'),
72 'total_time' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'total_time'),
73 'user_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'user_id'),
76 'cmi_comment_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'cmi_comment_id'),
77 'cmi_node_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'cmi_node_id'),
78 'comment' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'c_comment'),
79 'timestamp' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'c_timestamp'),
80 'location' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'location'),
81 'sourceIsLMS' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'sourceislms'),
83 'correct_response' =>
array(
84 'cmi_correct_response_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'cmi_correct_resp_id'),
85 'cmi_interaction_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'cmi_interaction_id'),
86 'pattern' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'pattern'),
88 'interaction' =>
array(
89 'cmi_interaction_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'cmi_interaction_id'),
90 'cmi_node_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'cmi_node_id'),
91 'description' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'description'),
92 'id' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'id'),
93 'latency' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'latency'),
94 'learner_response' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'learner_response'),
95 'result' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'result'),
96 'timestamp' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'c_timestamp'),
97 'type' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'c_type'),
98 'weighting' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'weighting'),
100 'objective' =>
array(
101 'cmi_interaction_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'cmi_interaction_id'),
102 'cmi_node_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'cmi_node_id'),
103 'cmi_objective_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>
'cmi_objective_id'),
104 'completion_status' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'completion_status'),
105 'description' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'description'),
106 'id' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'id'),
107 'max' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'c_max'),
108 'min' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'c_min'),
109 'raw' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'c_raw'),
110 'scaled' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'scaled'),
111 'progress_measure' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'progress_measure'),
112 'success_status' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'success_status'),
113 'scope' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
'scope'),
129 if ($_REQUEST[
'learnerId']) {
130 $this->userId = $_REQUEST[
'learnerId'];
132 $this->userId =
$GLOBALS[
'USER'][
'usr_id'];
134 $this->packageId = (int) $_REQUEST[
'packageId'];
135 $this->jsMode = strpos(
$_SERVER[
'HTTP_ACCEPT'],
'text/javascript')!==
false;
137 $this->page = $_REQUEST[
'page'];
146 $this->ref_id =
$_GET[
'ref_id'];
147 $this->userId=$ilUser->getID();
149 if (
$_GET[
'envEditor'] != null) {
150 $this->envEditor =
$_GET[
'envEditor'];
152 $this->envEditor = 0;
163 $next_class = $this->ctrl->getNextClass($this);
164 $cmd = $this->ctrl->getCmd();
166 if (!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])) {
167 $ilErr->raiseError($lng->txt(
"permission_denied"), $ilErr->WARNING);
198 case 'getGobjective':
202 case 'getSharedData':
206 case 'setSharedData':
212 if (
$_SERVER[
'REQUEST_METHOD']==
'POST') {
213 include_once
'./Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
217 $this->slm->getDefaultLessonMode(),
218 $this->slm->getComments(),
219 $this->slm->getInteractions(),
220 $this->slm->getObjectives(),
221 $this->slm->getTime_from_lms()
239 case 'liveLogContent':
252 case 'scormPlayerUnload':
253 include_once
'./Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
268 $js_data = file_get_contents(
"./Modules/Scorm2004/scripts/buildrte/rte.js");
269 if (self::ENABLE_GZIP==1) {
270 ob_start(
"ob_gzhandler");
271 header(
'Content-Type: text/javascript; charset=UTF-8');
273 header(
'Content-Type: text/javascript; charset=UTF-8');
281 $webdir=str_replace(
"/ilias.php",
"",
$_SERVER[
"SCRIPT_NAME"]);
283 $lm_dir=$webdir .
"/" . ILIAS_WEB_DIR .
"/" . CLIENT_ID .
"/lm_data" .
"/lm_" .
$this->packageId;
292 $initSuspendData = null;
295 'learner_id' => (
string) $ilUser->getID(),
296 'cmi_learner_id' => (
string) $this->slm->getApiStudentId(),
297 'course_id' => (
string) $this->packageId,
298 'learner_name' => (
string) $this->slm->getApiStudentName(),
299 'mode' => $this->slm->getDefaultLessonMode(),
300 'credit' => $this->slm->getCreditMode(),
301 'auto_review' => $this->slm->getAutoReviewChar(),
302 'hide_navig' => $this->slm->getHideNavig(),
303 'hide_menu' => $this->slm->getNoMenu(),
304 'ie_force_render' => $this->slm->getIe_force_render(),
305 'fourth_edition' => $this->slm->getFourth_edition(),
306 'sequencing_enabled' => $this->slm->getSequencing(),
307 'interactions_storable' => $this->slm->getInteractions(),
308 'objectives_storable' => $this->slm->getObjectives(),
309 'comments_storable' => $this->slm->getComments(),
310 'time_from_lms' => $this->slm->getTime_from_lms(),
311 'auto_last_visited' => $this->slm->getAuto_last_visited(),
312 'lesson_mastery_score' => $this->slm->getMasteryScore(),
313 'checkSetValues' => $this->slm->getCheck_values(),
314 'auto_suspend' => $this->slm->getAutoSuspend(),
315 'suspend_data' => $initSuspendData,
318 'adlact_data' => null,
319 'globalobj_data' => null
321 include_once
'./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMInitData.php';
338 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
343 $initSuspendData = null;
344 $initAdlactData = null;
345 if ($this->slm->getSequencing() ==
true) {
354 if ($this->slm->getSession()) {
357 if ($session_timeout > $max_idle) {
358 $session_timeout = $max_idle;
361 if ($session_timeout > $min_idle) {
362 $session_timeout = $min_idle;
364 $session_timeout -= 10;
366 $session_timeout = 0;
368 $config[
'session_ping'] = $session_timeout;
371 $store_url =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=cmi&ref_id=' .
$_GET[
"ref_id"];
372 $unload_url =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=scormPlayerUnload&ref_id=' .
$_GET[
"ref_id"];
373 if ($this->slm->getSessionDeactivated()) {
374 $store_url =
'storeScorm2004.php?package_id=' . $this->packageId .
'&ref_id=' .
$_GET[
"ref_id"] .
'&client_id=' . CLIENT_ID .
'&do=store';
375 $unload_url =
'storeScorm2004.php?package_id=' . $this->packageId .
'&ref_id=' .
$_GET[
"ref_id"] .
'&client_id=' . CLIENT_ID .
'&do=unload';
377 $config[
'cp_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=cp&ref_id=' .
$_GET[
"ref_id"];
378 $config[
'cmi_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=cmi&ref_id=' .
$_GET[
"ref_id"];
379 $config[
'store_url'] = $store_url;
380 $config[
'get_adldata_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=getSharedData&ref_id=' .
$_GET[
"ref_id"];
381 $config[
'set_adldata_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=setSharedData&ref_id=' .
$_GET[
"ref_id"];
382 $config[
'adlact_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=adlact&ref_id=' .
$_GET[
"ref_id"];
383 $config[
'specialpage_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=specialPage&ref_id=' .
$_GET[
"ref_id"];
384 $config[
'suspend_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=suspend&ref_id=' .
$_GET[
"ref_id"];
385 $config[
'get_suspend_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=getSuspend&ref_id=' .
$_GET[
"ref_id"];
387 $config[
'gobjective_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=gobjective&ref_id=' .
$_GET[
"ref_id"];
388 $config[
'get_gobjective_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=getGobjective&ref_id=' .
$_GET[
"ref_id"];
389 $config[
'ping_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=pingSession&ref_id=' .
$_GET[
"ref_id"];
390 $config[
'scorm_player_unload_url']= $unload_url;
391 $config[
'post_log_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=postLogEntry&ref_id=' .
$_GET[
"ref_id"];
392 $config[
'livelog_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=liveLogContent&ref_id=' .
$_GET[
"ref_id"];
396 $config[
'envEditor'] = $this->envEditor;
399 $config[
'debug'] = $this->slm->getDebug();
405 $langstrings[
'btnStart'] = $lng->txt(
'scplayer_start');
406 $langstrings[
'btnExit'] = $lng->txt(
'scplayer_exit');
407 $langstrings[
'btnExitAll'] = $lng->txt(
'scplayer_exitall');
408 $langstrings[
'btnSuspendAll'] = $lng->txt(
'scplayer_suspendall');
409 $langstrings[
'btnPrevious'] = $lng->txt(
'scplayer_previous');
410 $langstrings[
'btnContinue'] = $lng->txt(
'scplayer_continue');
411 $langstrings[
'btnhidetree']=$lng->txt(
'scplayer_hidetree');
412 $langstrings[
'btnshowtree']=$lng->txt(
'scplayer_showtree');
413 $langstrings[
'linkexpandTree']=$lng->txt(
'scplayer_expandtree');
414 $langstrings[
'linkcollapseTree']=$lng->txt(
'scplayer_collapsetree');
415 $langstrings[
'contCreditOff']=$lng->txt(
'cont_credit_off');
416 if ($this->slm->getAutoReviewChar() ==
"s") {
417 $langstrings[
'contCreditOff']=$lng->txt(
'cont_sc_score_was_higher_message');
419 $config[
'langstrings'] = $langstrings;
423 $this->tpl =
new ilTemplate(
"tpl.scorm2004.player.html",
true,
true,
"Modules/Scorm2004");
425 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
429 $rte_css = $this->slm->getDataDirectory() .
"/ilias_css_4_2/css/style.css";
430 if (is_file($rte_css)) {
431 $this->tpl->setCurrentBlock(
"rte_css");
432 $this->tpl->setVariable(
"RTE_CSS", $rte_css);
433 $this->tpl->parseCurrentBlock();
437 $this->tpl->setVariable(
'JSON_LANGSTRINGS', json_encode($langstrings));
441 $this->tpl->setVariable(
'TREE_JS',
"./Modules/Scorm2004/scripts/ilNestedList.js");
442 $this->tpl->setVariable($langstrings);
443 $this->tpl->setVariable(
'DOC_TITLE',
'ILIAS SCORM 2004 Player');
445 $this->tpl->setVariable(
'INIT_CP_DATA', json_encode(json_decode($this->
getCPDataInit())));
446 $this->tpl->setVariable(
'INIT_CMI_DATA', json_encode($this->
getCMIData($this->userId, $this->packageId)));
447 $this->tpl->setVariable(
'INIT_ADLACT_DATA', json_encode($initAdlactData));
448 $this->tpl->setVariable(
'INIT_GLOBALOBJ_DATA', json_encode($initGlobalobjData));
449 $this->tpl->setVariable(
'JS_DATA', json_encode(
$config));
450 list($tsfrac, $tsint) = explode(
' ', microtime());
451 $this->tpl->setVariable(
'TIMESTAMP', sprintf(
'%d%03d', $tsint, 1000*(
float) $tsfrac));
452 $this->tpl->setVariable(
'BASE_DIR',
'./Modules/Scorm2004/');
453 $this->tpl->setVariable(
'TXT_COLLAPSE', $lng->txt(
'scplayer_collapsetree'));
454 if ($this->slm->getDebug()) {
455 $this->tpl->setVariable(
'TXT_DEBUGGER', $lng->txt(
'scplayer_debugger'));
456 $this->tpl->setVariable(
'DEBUG_URL',
"PopupCenter('ilias.php?baseClass=ilSAHSPresentationGUI&cmd=debugGUI&ref_id=" .
$_GET[
"ref_id"] .
"','Debug',800,600);");
458 $this->tpl->setVariable(
'TXT_DEBUGGER',
'');
459 $this->tpl->setVariable(
'DEBUG_URL',
'');
463 $this->tpl->setVariable(
'INLINE_CSS', ilSCORM13Player::getInlineCss());
466 if ($this->slm->getCacheDeactivated()) {
467 $this->tpl->setVariable(
'JS_SCRIPTS',
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=getRTEjs&ref_id=' .
$_GET[
"ref_id"]);
469 $this->tpl->setVariable(
'JS_SCRIPTS',
'./Modules/Scorm2004/scripts/buildrte/rte-min.js');
473 if ($this->slm->getNoMenu()==
"y") {
474 $this->tpl->setVariable(
"VAL_DISPLAY",
"style=\"display:none;\"");
476 $this->tpl->setVariable(
"VAL_DISPLAY",
"");
483 header(
'Content-Type: text/html; charset=utf-8');
484 echo($lng->txt(
"cont_sc_max_attempt_exceed"));
493 $this->tpl->show(
"DEFAULT",
false);
501 $is_tpl =
new ilTemplate(
"tpl.scorm2004.inlinecss.html",
true,
true,
"Modules/Scorm2004");
504 $is_tpl->setVariable(
'IC_NOTATTEMPTED',
ilUtil::getImagePath(
"scorm/not_attempted.svg",
false));
510 return $is_tpl->get();
517 header(
'Content-Type: text/javascript; charset=UTF-8');
520 header(
'Content-Type: text/plain; charset=UTF-8');
521 $jsdata = json_decode($jsdata);
529 $res = $ilDB->queryF(
530 'SELECT jsdata FROM cp_package WHERE obj_id = %s',
532 array($this->packageId)
534 $packageData = $ilDB->fetchAssoc(
$res);
536 $jsdata = $packageData[
'jsdata'];
549 $res = $ilDB->queryF(
550 'SELECT activitytree FROM cp_package WHERE obj_id = %s',
552 array($this->packageId)
556 $activitytree =
$data[
'activitytree'];
558 if (!$activitytree) {
559 $activitytree =
'null';
561 return $activitytree;
568 header(
'Content-Type: text/javascript; charset=UTF-8');
569 print($activitytree);
571 header(
'Content-Type: text/plain; charset=UTF-8');
572 $activitytree = json_decode($activitytree);
573 print_r($activitytree);
580 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
583 header(
'Content-Type: text/plain; charset=UTF-8');
591 $res = $ilDB->queryF(
592 'SELECT global_to_system FROM cp_package WHERE obj_id = %s',
594 array($this->packageId)
598 $gystem =
$data[
'global_to_system'];
612 $res = $ilDB->queryF(
613 'SELECT data FROM cp_suspend WHERE obj_id = %s AND user_id = %s',
614 array(
'integer',
'integer'),
615 array($this->packageId, $ilUser->getId())
621 'DELETE FROM cp_suspend WHERE obj_id = %s AND user_id = %s',
622 array(
'integer',
'integer'),
623 array($this->packageId, $ilUser->getId())
625 return $data[
'data'];
632 header(
'Content-Type: text/javascript; charset=UTF-8');
633 print($suspend_data);
635 header(
'Content-Type: text/plain; charset=UTF-8');
636 $suspend_data = json_decode($suspend_data);
637 print_r($suspend_data);
645 $res = $ilDB->queryF(
646 'SELECT * FROM cp_suspend WHERE obj_id = %s AND user_id = %s',
647 array(
'integer',
'integer'),
648 array($this->packageId, $ilUser->getId())
651 if (!$ilDB->numRows(
$res)) {
652 $ilDB->insert(
'cp_suspend',
array(
653 'data' =>
array(
'clob', file_get_contents(
'php://input')),
654 'obj_id' =>
array(
'integer', $this->packageId),
655 'user_id' =>
array(
'integer', $ilUser->getId())
661 'data' =>
array(
'clob', file_get_contents(
'php://input'))
664 'obj_id' =>
array(
'integer', $this->packageId),
665 'user_id' =>
array(
'integer', $ilUser->getId())
678 $global_to_system = 1;
680 $res = $ilDB->queryF(
681 'SELECT global_to_system FROM cp_package WHERE obj_id = %s',
683 array($this->packageId)
685 while (
$data = $ilDB->fetchAssoc(
$res)) {
686 $global_to_system =
$data[
'global_to_system'];
689 $query =
'SELECT objective_id, scope_id, satisfied, measure, user_id, 690 score_min, score_max, score_raw, completion_status, 692 .
'FROM cmi_gobjective, cp_node, cp_mapinfo ' 693 .
'WHERE (cmi_gobjective.objective_id <> %s AND cmi_gobjective.status IS NULL ' 694 .
'AND cp_node.slm_id = %s AND cp_node.nodename = %s ' 695 .
'AND cp_node.cp_node_id = cp_mapinfo.cp_node_id ' 696 .
'AND cmi_gobjective.objective_id = cp_mapinfo.targetobjectiveid) ' 697 .
'GROUP BY objective_id, scope_id, satisfied, measure, user_id, 698 score_min, score_max, score_raw, completion_status, 700 $res = $ilDB->queryF(
702 array(
'text',
'integer',
'text'),
703 array(
'-course_overall_status-', $this->packageId,
'mapInfo')
705 while (
$row = $ilDB->fetchAssoc(
$res)) {
706 if (($global_to_system == 1 &&
$row[
'scope_id'] == 0) || ($global_to_system == 0 &&
$row[
'scope_id'] ==
$this->packageId)) {
707 $learner =
$row[
'user_id'];
708 $objective_id =
$row[
'objective_id'];
709 if (
$row[
'scope_id'] == 0) {
712 $scope =
$row[
'scope_id'];
715 if (
$row[
'satisfied'] != null) {
716 $toset =
$row[
'satisfied'];
717 $g_data[
"satisfied"][$objective_id][$learner][$scope] = $toset;
720 if (
$row[
'measure'] != null) {
721 $toset =
$row[
'measure'];
722 $g_data[
"measure"][$objective_id][$learner][$scope] = $toset;
725 if (
$row[
'score_raw'] != null) {
726 $toset =
$row[
'score_raw'];
727 $g_data[
"score_raw"][$objective_id][$learner][$scope] = $toset;
730 if (
$row[
'score_min'] != null) {
731 $toset =
$row[
'score_min'];
732 $g_data[
"score_min"][$objective_id][$learner][$scope] = $toset;
735 if (
$row[
'score_max'] != null) {
736 $toset =
$row[
'score_max'];
737 $g_data[
"score_max"][$objective_id][$learner][$scope] = $toset;
740 if (
$row[
'progress_measure'] != null) {
741 $toset =
$row[
'progress_measure'];
742 $g_data[
"progress_measure"][$objective_id][$learner][$scope] = $toset;
745 if (
$row[
'completion_status'] != null) {
746 $toset =
$row[
'completion_status'];
747 $g_data[
"completion_status"][$objective_id][$learner][$scope] = $toset;
758 header(
'Content-Type: text/javascript; charset=UTF-8');
759 print($gobjective_data);
761 header(
'Content-Type: text/plain; charset=UTF-8');
762 $gobjective_data = json_decode($gobjective_data);
763 print_r($gobjective_data);
773 "permissions" =>
array());
774 $readPermissions =
array();
776 $query =
'SELECT target_id, read_shared_data, write_shared_data ' 778 .
'WHERE slm_id = %s ' 779 .
'AND sco_node_id = %s ' 780 .
'GROUP BY target_id, read_shared_data, write_shared_data';
783 $res = $ilDB->queryF(
785 array(
'integer',
'integer'),
786 array($this->packageId, $sco_node_id)
791 while (
$row = $ilDB->fetchAssoc(
$res)) {
792 $storeVal = (
$row[
'read_shared_data'] == 0 &&
$row[
'write_shared_data'] == 1)
796 $dataStores[
"data"][
$row[
'target_id']] =
array(
"store" => $storeVal,
797 "readSharedData" => $row[
'read_shared_data'],
798 "writeSharedData" => $row[
'write_shared_data']);
799 $dataStores[
"readPermissions"][$row[
'target_id']] = $row[
'read_shared_data'];
802 if (count($dataStores) < 1) {
806 } elseif ($dataStores[
"readPermissions"] != null && array_sum($dataStores[
"readPermissions"]) != 0) {
813 "values" =>
array($this->userId, $this->packageId));
819 foreach ($dataStores[
"data"] as
$key => $val) {
820 if ($dataStores[
"readPermissions"][
$key] == 1
821 && $dataStores[
"data"][
$key][
"store"] !=
'notWritten') {
824 $paramTemplate .=
'%s, ';
829 $paramTemplate = substr($paramTemplate, 0, strlen($paramTemplate) - 2);
832 $query =
'SELECT target_id, store ' 833 .
'FROM adl_shared_data ' 834 .
'WHERE user_id = %s ' 836 .
'AND target_id IN (' . $paramTemplate .
')';
839 $res = $ilDB->queryF(
845 while (
$row = $ilDB->fetchAssoc(
$res)) {
846 $dataStores[
"data"][
$row[
'target_id']][
"store"] = $row[
'store'];
850 header(
'Content-Type: text/javascript; charset=UTF-8');
852 echo json_encode($dataStores[
"data"]);
858 $g_data = json_decode(file_get_contents(
'php://input'));
861 $query =
'SELECT dm.target_id, sd.store ' 862 .
'FROM cp_datamap dm ' 863 .
'LEFT JOIN adl_shared_data sd ' 864 .
'ON(dm.slm_id = sd.slm_id AND dm.target_id = sd.target_id) ' 865 .
'WHERE sco_node_id = %s ' 866 .
'AND dm.slm_id = %s ' 867 .
'AND write_shared_data = 1 ' 868 .
'AND user_id = %s';
870 $res = $ilDB->QueryF(
872 array(
'integer',
'integer',
'integer'),
873 array($sco_node_id, $this->packageId, $this->userId)
876 $dataStores =
array();
877 $originalVals =
array();
878 while (
$row = $ilDB->fetchAssoc(
$res)) {
880 $dataStores[
$id] = $g_data->{
$id};
881 $originalVals[
$id] =
$row[
'store'];
886 foreach ($g_data as
$key => $obj) {
889 if (array_key_exists(
$key, $dataStores)) {
890 if ($obj ==
'notWritten') {
894 $query =
'UPDATE adl_shared_data ' 896 .
'WHERE user_id = %s ' 897 .
'AND target_id = %s ' 898 .
'AND slm_id = %s ';
902 array(
'text',
'integer',
'text',
'integer'),
903 array($dataStores[
$key], $this->userId, $key, $this->packageId)
908 'SELECT write_shared_data, cp_node_id ' 910 .
'WHERE target_id = %s ' 912 .
'AND sco_node_id = %s',
913 array(
'text',
'integer',
'integer'),
914 array(
$key, $this->packageId, $sco_node_id)
918 if (
$row[
"write_shared_data"] != 1) {
924 'INSERT INTO adl_shared_data (slm_id, user_id, target_id, store, cp_node_id) VALUES (%s, %s, %s, %s, %s)',
925 array(
'integer',
'integer',
'text',
'text',
'integer'),
926 array($this->packageId, $this->userId,
$key, $obj,
$row[
"cp_node_id"])
938 $specialpages =
array(
939 "_COURSECOMPLETE_" =>
"seq_coursecomplete",
940 "_ENDSESSION_" =>
"seq_endsession",
941 "_SEQBLOCKED_" =>
"seq_blocked",
942 "_NOTHING_" =>
"seq_nothing",
943 "_ERROR_" =>
"seq_error",
944 "_DEADLOCK_" =>
"seq_deadlock",
945 "_INVALIDNAVREQ_" =>
"seq_invalidnavreq",
946 "_SEQABANDON_" =>
"seq_abandon",
947 "_SEQABANDONALL_" =>
"seq_abandonall",
951 $this->tpl =
new ilTemplate(
"tpl.scorm2004.specialpages.html",
false,
false,
"Modules/Scorm2004");
953 $this->tpl->setVariable(
'TXT_SPECIALPAGE', $lng->txt($specialpages[$this->page]));
954 if ($this->page!=
"_TOC_" && $this->page!=
"_SEQABANDON_" && $this->page!=
"_SEQABANDONALL_") {
955 $this->tpl->setVariable(
'CLOSE_WINDOW', $lng->txt(
'seq_close'));
957 $this->tpl->setVariable(
'CLOSE_WINDOW',
"");
959 $this->tpl->show(
"DEFAULT",
false);
967 header(
'Content-Type: text/javascript; charset=UTF-8');
968 print(json_encode(
$data));
970 header(
'Content-Type: text/plain; charset=UTF-8');
971 print(var_export(
$data,
true));
985 if (isset($value) && is_string($v) && !preg_match($v, $value)) {
1002 $result[
'schema'][$k] = array_keys($v);
1006 $q =
'SELECT cmi_node.* 1008 INNER JOIN cp_node ON cmi_node.cp_node_id = cp_node.cp_node_id 1009 WHERE cmi_node.user_id = %s 1010 AND cp_node.slm_id = %s';
1017 if ($this->slm->getComments()) {
1019 cmi_comment.cmi_comment_id, 1020 cmi_comment.cmi_node_id, 1021 cmi_comment.c_comment, 1022 cmi_comment.c_timestamp, 1023 cmi_comment.location, 1024 cmi_comment.sourceislms 1026 INNER JOIN cmi_node ON cmi_node.cmi_node_id = cmi_comment.cmi_node_id 1027 INNER JOIN cp_node ON cp_node.cp_node_id = cmi_node.cp_node_id 1028 WHERE cmi_node.user_id = %s 1029 AND cp_node.slm_id = %s 1030 ORDER BY cmi_comment.cmi_comment_id';
1036 case "correct_response":
1039 if ($this->slm->getInteractions()) {
1040 $q =
'SELECT cmi_correct_response.* 1041 FROM cmi_correct_response 1042 INNER JOIN cmi_interaction 1043 ON cmi_interaction.cmi_interaction_id = cmi_correct_response.cmi_interaction_id 1044 INNER JOIN cmi_node ON cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 1045 INNER JOIN cp_node ON cp_node.cp_node_id = cmi_node.cp_node_id 1046 WHERE cmi_node.user_id = %s 1047 AND cp_node.slm_id = %s 1048 ORDER BY cmi_correct_response.cmi_correct_resp_id';
1056 if ($this->slm->getInteractions()) {
1058 cmi_interaction.cmi_interaction_id, 1059 cmi_interaction.cmi_node_id, 1060 cmi_interaction.description, 1062 cmi_interaction.latency, 1063 cmi_interaction.learner_response, 1064 cmi_interaction.result, 1065 cmi_interaction.c_timestamp, 1066 cmi_interaction.c_type, 1067 cmi_interaction.weighting 1068 FROM cmi_interaction 1069 INNER JOIN cmi_node ON cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 1070 INNER JOIN cp_node ON cp_node.cp_node_id = cmi_node.cp_node_id 1071 WHERE cmi_node.user_id = %s 1072 AND cp_node.slm_id = %s 1073 ORDER BY cmi_interaction.cmi_interaction_id';
1080 if ($this->slm->getObjectives()) {
1082 cmi_objective.cmi_interaction_id, 1083 cmi_objective.cmi_node_id, 1084 cmi_objective.cmi_objective_id, 1085 cmi_objective.completion_status, 1086 cmi_objective.description, 1088 cmi_objective.c_max, 1089 cmi_objective.c_min, 1090 cmi_objective.c_raw, 1091 cmi_objective.scaled, 1092 cmi_objective.progress_measure, 1093 cmi_objective.success_status, 1096 INNER JOIN cmi_node ON cmi_node.cmi_node_id = cmi_objective.cmi_node_id 1097 INNER JOIN cp_node ON cp_node.cp_node_id = cmi_node.cp_node_id 1098 WHERE cmi_node.user_id = %s 1099 AND cp_node.slm_id = %s 1100 ORDER BY cmi_objective.cmi_objective_id';
1106 $q =
'SELECT usr_data.usr_id user_id, 1107 CONCAT(CONCAT(COALESCE(usr_data.firstname, \'\'), \' \'), COALESCE(usr_data.lastname, \'\')) learner_name, 1108 sahs_lm.id slm_id , sahs_lm.default_lesson_mode "mode", sahs_lm.credit 1109 FROM usr_data, cp_package 1110 INNER JOIN sahs_lm ON cp_package.obj_id = sahs_lm.id 1111 WHERE usr_data.usr_id = %s 1112 AND sahs_lm.id = %s';
1120 $types =
array(
'integer',
'integer');
1122 $res = $ilDB->queryF($q, $types, $values);
1124 while (
$row = $ilDB->fetchAssoc(
$res)) {
1125 $tmp_result =
array();
1127 if ($k ==
"comment" &&
$key ==
"c_timestamp" && strpos($value,
' ')==10) {
1128 $value = str_replace(
' ',
'T', $value);
1130 $tmp_result[] = $value;
1131 if ($k==
"node" &&
$key==
"additional_tables" && $i_check<$value) {
1136 $result[
'data'][$k][] = $tmp_result;
1148 if (!is_array($a_array) or !count($a_array)) {
1152 foreach ($a_array as $k => $item) {
1153 if ($item != null) {
1154 $a_array[$k] = $ilDB->quote($item);
1156 $a_array[$k] =
"NULL";
1172 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1182 include_once
"./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMInitData.php";
1190 $res = $ilDB->queryF(
1191 'SELECT module_version FROM sahs_lm WHERE id = %s',
1193 array($this->packageId)
1197 return $row[
'module_version'];
1206 $val_set = $ilDB->queryF(
1207 'SELECT package_attempts FROM sahs_user WHERE obj_id = %s AND user_id = %s',
1208 array(
'integer',
'integer'),
1209 array($this->packageId,$this->userId)
1211 $val_rec = $ilDB->fetchAssoc($val_set);
1212 $attempts = $val_rec[
"package_attempts"];
1213 if ($attempts == null) {
1225 $res = $ilDB->queryF(
1226 'SELECT package_attempts,count(*) cnt FROM sahs_user WHERE obj_id = %s AND user_id = %s GROUP BY package_attempts',
1227 array(
'integer',
'integer'),
1228 array($this->slm->getId(),$ilUser->getId())
1230 $val_rec = $ilDB->fetchAssoc(
$res);
1231 if ($val_rec[
"cnt"] == 0) {
1234 'INSERT INTO sahs_user (obj_id,user_id,package_attempts,module_version,last_access) VALUES(%s,%s,%s,%s,%s)',
1235 array(
'integer',
'integer',
'integer',
'integer',
'timestamp'),
1236 array($this->slm->getId(), $ilUser->getId(), $attempts, $this->slm->getModuleVersion(),
date(
'Y-m-d H:i:s'))
1239 $attempts = $val_rec[
"package_attempts"];
1240 if ($attempts == null) {
1245 'UPDATE sahs_user SET package_attempts = %s, module_version = %s, last_access=%s WHERE obj_id = %s AND user_id = %s ',
1246 array(
'integer',
'integer',
'timestamp',
'integer',
'integer'),
1247 array($attempts, $this->slm->getModuleVersion(),
date(
'Y-m-d H:i:s'), $this->slm->getId(), $ilUser->getId())
1256 $res = $ilDB->queryF(
1258 SELECT shared_data_global_to_system 1262 array($this->packageId)
1265 $shared_global_to_sys = $ilDB->fetchObject(
$res)->shared_data_global_to_system;
1267 $res = $ilDB->queryF(
1273 array(
'integer',
'integer'),
1274 array($this->packageId, $this->userId)
1279 $dat = $ilDB->fetchObject(
$res)->data;
1280 if ($dat != null && $dat !=
'') {
1284 if ($shared_global_to_sys == 0 && !$suspended) {
1287 DELETE FROM adl_shared_data 1290 array(
'integer',
'integer'),
1291 array($this->packageId, $this->userId)
1302 $fieldList =
"cmi_node.cp_node_id, cmi_node.completion_threshold, cmi_node.c_exit, cmi_node.completion_status, cmi_node.progress_measure, cmi_node.success_status, cmi_node.scaled, cmi_node.session_time," .
1303 "cmi_node.c_min, cmi_node.c_max, cmi_node.c_raw, cmi_node.location, cmi_node.suspend_data, cmi_node.scaled_passing_score, cmi_node.total_time";
1306 $res = $ilDB->queryF(
1308 SELECT ' . $fieldList .
' 1309 FROM cmi_node,cp_node,cp_item 1310 WHERE cp_node.slm_id = %s 1311 AND cp_node.cp_node_id = cp_item.cp_node_id 1313 AND cmi_node.cp_node_id = cp_item.cp_node_id 1314 AND cmi_node.user_id = %s',
1315 array(
'integer',
'text',
'integer'),
1316 array($this->packageId, $sco_id, $this->userId)
1319 $ilLog->write(
"DEBUG SQL" .
$row);
1328 $fHandle = fopen(
$filename,
'a') or die(
"can't open file");
1329 fwrite($fHandle, $string);
1341 while (file_exists(
$filename .
"_" . $adder . $suffix)) {
1345 $retname =
$filename .
"_" . $adder . $suffix;
1347 if (!file_exists($retname)) {
1349 $fHandle = fopen($retname,
'a') or die(
"can't open file");
1350 fwrite($fHandle, $string);
1359 $lng->loadLanguageModule(
"scormdebug");
1364 if (!file_exists($path_csv)) {
1366 $fHandle = fopen($path_csv,
'a') or die(
"can't open file");
1367 $string =
'"CourseId";"ScoId";"ScoTitle";"Timestamp";"Action";"Key";"Value";"Return Value";"Errorcode";"Timespan";"ErrorDescription"' .
"\n";
1368 fwrite($fHandle, $string);
1371 if (!file_exists($path_txt)) {
1376 $fHandle2 = fopen($path_txt,
'a') or die(
"can't open file");
1378 $logtpl->setCurrentBlock(
'NewLog');
1379 $logtpl->setVariable(
"COURSETITLE", $this->slm->getTitle());
1380 $logtpl->setVariable(
"COURSEID", $this->packageId);
1381 $logtpl->setVariable(
"TIMESTAMP",
date(
"d.m.Y H:i",
time()));
1383 $logtpl->setVariable(
"error0", $lng->txt(
"error0"));
1384 $logtpl->setVariable(
"error101", $lng->txt(
"error101"));
1385 $logtpl->setVariable(
"error102", $lng->txt(
"error102"));
1386 $logtpl->setVariable(
"error103", $lng->txt(
"error103"));
1387 $logtpl->setVariable(
"error104", $lng->txt(
"error104"));
1388 $logtpl->setVariable(
"error111", $lng->txt(
"error111"));
1389 $logtpl->setVariable(
"error112", $lng->txt(
"error112"));
1390 $logtpl->setVariable(
"error113", $lng->txt(
"error113"));
1391 $logtpl->setVariable(
"error122", $lng->txt(
"error122"));
1392 $logtpl->setVariable(
"error123", $lng->txt(
"error123"));
1393 $logtpl->setVariable(
"error132", $lng->txt(
"error132"));
1394 $logtpl->setVariable(
"error133", $lng->txt(
"error133"));
1395 $logtpl->setVariable(
"error142", $lng->txt(
"error142"));
1396 $logtpl->setVariable(
"error143", $lng->txt(
"error143"));
1397 $logtpl->setVariable(
"error201", $lng->txt(
"error201"));
1398 $logtpl->setVariable(
"error301", $lng->txt(
"error301"));
1399 $logtpl->setVariable(
"error351", $lng->txt(
"error351"));
1400 $logtpl->setVariable(
"error391", $lng->txt(
"error391"));
1401 $logtpl->setVariable(
"error401", $lng->txt(
"error401"));
1402 $logtpl->setVariable(
"error402", $lng->txt(
"error402"));
1403 $logtpl->setVariable(
"error403", $lng->txt(
"error403"));
1404 $logtpl->setVariable(
"error404", $lng->txt(
"error404"));
1405 $logtpl->setVariable(
"error405", $lng->txt(
"error405"));
1406 $logtpl->setVariable(
"error406", $lng->txt(
"error406"));
1407 $logtpl->setVariable(
"error407", $lng->txt(
"error407"));
1408 $logtpl->setVariable(
"error408", $lng->txt(
"error408"));
1409 $logtpl->setVariable(
"SetValue", $lng->txt(
"SetValue"));
1410 $logtpl->setVariable(
"GetValue", $lng->txt(
"GetValue"));
1411 $logtpl->setVariable(
"Commit", $lng->txt(
"Commit"));
1412 $logtpl->setVariable(
"Initialize", $lng->txt(
"Initialize"));
1413 $logtpl->setVariable(
"Terminate", $lng->txt(
"Terminate"));
1414 $logtpl->setVariable(
"GetErrorString", $lng->txt(
"GetErrorString"));
1415 $logtpl->setVariable(
"GetLastError", $lng->txt(
"GetLastError"));
1416 $logtpl->setVariable(
"GetDiagnostic", $lng->txt(
"GetDiagnostic"));
1417 $logtpl->setVariable(
"cmi._version", $lng->txt(
"cmi._version"));
1418 $logtpl->setVariable(
"cmi.comments_from_learner._children", $lng->txt(
"cmi.comments_from_learner._children"));
1419 $logtpl->setVariable(
"cmi.comments_from_learner._count", $lng->txt(
"cmi.comments_from_learner._count"));
1420 $logtpl->setVariable(
"cmi.comments_from_learner.n.comment", $lng->txt(
"cmi.comments_from_learner.n.comment"));
1421 $logtpl->setVariable(
"cmi.comments_from_learner.n.location", $lng->txt(
"cmi.comments_from_learner.n.location"));
1422 $logtpl->setVariable(
"cmi.comments_from_learner.n.timestamp", $lng->txt(
"cmi.comments_from_learner.n.timestamp"));
1423 $logtpl->setVariable(
"cmi.comments_from_lms._children", $lng->txt(
"cmi.comments_from_lms._children"));
1424 $logtpl->setVariable(
"cmi.comments_from_lms._count", $lng->txt(
"cmi.comments_from_lms._count"));
1425 $logtpl->setVariable(
"cmi.comments_from_lms.n.comment", $lng->txt(
"cmi.comments_from_lms.n.comment"));
1426 $logtpl->setVariable(
"cmi.comments_from_lms.n.location", $lng->txt(
"cmi.comments_from_lms.n.location"));
1427 $logtpl->setVariable(
"cmi.comments_from_lms.n.timestamp", $lng->txt(
"cmi.comments_from_lms.n.timestamp"));
1428 $logtpl->setVariable(
"cmi.completion_status", $lng->txt(
"cmi.completion_status"));
1429 $logtpl->setVariable(
"cmi.completion_threshold", $lng->txt(
"cmi.completion_threshold"));
1430 $logtpl->setVariable(
"cmi.credit", $lng->txt(
"cmi.credit"));
1431 $logtpl->setVariable(
"cmi.entry", $lng->txt(
"cmi.entry"));
1432 $logtpl->setVariable(
"cmi.exit", $lng->txt(
"cmi.exit"));
1433 $logtpl->setVariable(
"cmi.interactions._children", $lng->txt(
"cmi.interactions._children"));
1434 $logtpl->setVariable(
"cmi.interactions._count", $lng->txt(
"cmi.interactions._count"));
1435 $logtpl->setVariable(
"cmi.interactions.n.id", $lng->txt(
"cmi.interactions.n.id"));
1436 $logtpl->setVariable(
"cmi.interactions.n.type", $lng->txt(
"cmi.interactions.n.type"));
1437 $logtpl->setVariable(
"cmi.interactions.n.objectives._count", $lng->txt(
"cmi.interactions.n.objectives._count"));
1438 $logtpl->setVariable(
"cmi.interactions.n.objectives.n.id", $lng->txt(
"cmi.interactions.n.objectives.n.id"));
1439 $logtpl->setVariable(
"cmi.interactions.n.timestamp", $lng->txt(
"cmi.interactions.n.timestamp"));
1440 $logtpl->setVariable(
"cmi.interactions.n.correct_responses._count", $lng->txt(
"cmi.interactions.n.correct_responses._count"));
1441 $logtpl->setVariable(
"cmi.interactions.n.correct_responses.n.pattern", $lng->txt(
"cmi.interactions.n.correct_responses.n.pattern"));
1442 $logtpl->setVariable(
"cmi.interactions.n.weighting", $lng->txt(
"cmi.interactions.n.weighting"));
1443 $logtpl->setVariable(
"cmi.interactions.n.learner_response", $lng->txt(
"cmi.interactions.n.learner_response"));
1444 $logtpl->setVariable(
"cmi.interactions.n.result", $lng->txt(
"cmi.interactions.n.result"));
1445 $logtpl->setVariable(
"cmi.interactions.n.latency", $lng->txt(
"cmi.interactions.n.latency"));
1446 $logtpl->setVariable(
"cmi.interactions.n.description", $lng->txt(
"cmi.interactions.n.description"));
1447 $logtpl->setVariable(
"cmi.launch_data", $lng->txt(
"cmi.launch_data"));
1448 $logtpl->setVariable(
"cmi.learner_id", $lng->txt(
"cmi.learner_id"));
1449 $logtpl->setVariable(
"cmi.learner_name", $lng->txt(
"cmi.learner_name"));
1450 $logtpl->setVariable(
"cmi.learner_preference._children", $lng->txt(
"cmi.learner_preference._children"));
1451 $logtpl->setVariable(
"cmi.learner_preference.audio_level", $lng->txt(
"cmi.learner_preference.audio_level"));
1452 $logtpl->setVariable(
"cmi.learner_preference.language", $lng->txt(
"cmi.learner_preference.language"));
1453 $logtpl->setVariable(
"cmi.learner_preference.delivery_speed", $lng->txt(
"cmi.learner_preference.delivery_speed"));
1454 $logtpl->setVariable(
"cmi.learner_preference.audio_captioning", $lng->txt(
"cmi.learner_preference.audio_captioning"));
1455 $logtpl->setVariable(
"cmi.location", $lng->txt(
"cmi.location"));
1456 $logtpl->setVariable(
"cmi.max_time_allowed", $lng->txt(
"cmi.max_time_allowed"));
1457 $logtpl->setVariable(
"cmi.mode", $lng->txt(
"cmi.mode"));
1458 $logtpl->setVariable(
"cmi.objectives._children", $lng->txt(
"cmi.objectives._children"));
1459 $logtpl->setVariable(
"cmi.objectives._count", $lng->txt(
"cmi.objectives._count"));
1460 $logtpl->setVariable(
"cmi.objectives.n.id", $lng->txt(
"cmi.objectives.n.id"));
1461 $logtpl->setVariable(
"cmi.objectives.n.score._children", $lng->txt(
"cmi.objectives.n.score._children"));
1462 $logtpl->setVariable(
"cmi.objectives.n.score.scaled", $lng->txt(
"cmi.objectives.n.score.scaled"));
1463 $logtpl->setVariable(
"cmi.objectives.n.score.raw", $lng->txt(
"cmi.objectives.n.score.raw"));
1464 $logtpl->setVariable(
"cmi.objectives.n.score.min", $lng->txt(
"cmi.objectives.n.score.min"));
1465 $logtpl->setVariable(
"cmi.objectives.n.score.max", $lng->txt(
"cmi.objectives.n.score.max"));
1466 $logtpl->setVariable(
"cmi.objectives.n.success_status", $lng->txt(
"cmi.objectives.n.success_status"));
1467 $logtpl->setVariable(
"cmi.objectives.n.completion_status", $lng->txt(
"cmi.objectives.n.completion_status"));
1468 $logtpl->setVariable(
"cmi.objectives.n.progress_measure", $lng->txt(
"cmi.objectives.n.progress_measure"));
1469 $logtpl->setVariable(
"cmi.objectives.n.description", $lng->txt(
"cmi.objectives.n.description"));
1470 $logtpl->setVariable(
"cmi.progress_measure", $lng->txt(
"cmi.progress_measure"));
1471 $logtpl->setVariable(
"cmi.scaled_passing_score", $lng->txt(
"cmi.scaled_passing_score"));
1472 $logtpl->setVariable(
"cmi.score._children", $lng->txt(
"cmi.score._children"));
1473 $logtpl->setVariable(
"cmi.score.scaled", $lng->txt(
"cmi.score.scaled"));
1474 $logtpl->setVariable(
"cmi.score.raw", $lng->txt(
"cmi.score.raw"));
1475 $logtpl->setVariable(
"cmi.score.min", $lng->txt(
"cmi.score.min"));
1476 $logtpl->setVariable(
"cmi.score.max", $lng->txt(
"cmi.score.max"));
1477 $logtpl->setVariable(
"cmi.session_time", $lng->txt(
"cmi.session_time"));
1478 $logtpl->setVariable(
"cmi.success_status", $lng->txt(
"cmi.success_status"));
1479 $logtpl->setVariable(
"cmi.suspend_data", $lng->txt(
"cmi.suspend_data"));
1480 $logtpl->setVariable(
"cmi.time_limit_action", $lng->txt(
"cmi.time_limit_action"));
1481 $logtpl->setVariable(
"cmi.total_time", $lng->txt(
"cmi.total_time"));
1482 $logtpl->setVariable(
"adl.nav.request", $lng->txt(
"adl.nav.request"));
1483 $logtpl->setVariable(
"adl.nav.request_valid.continue", $lng->txt(
"adl.nav.request_valid.continue"));
1484 $logtpl->setVariable(
"adl.nav.request_valid.previous", $lng->txt(
"adl.nav.request_valid.previous"));
1485 $logtpl->setVariable(
"adl.nav.request_valid.choice", $lng->txt(
"adl.nav.request_valid.choice"));
1486 $logtpl->setVariable(
"i_green", $lng->txt(
"i_green"));
1487 $logtpl->setVariable(
"i_red", $lng->txt(
"i_red"));
1488 $logtpl->setVariable(
"i_orange", $lng->txt(
"i_orange"));
1489 $logtpl->setVariable(
"i_fuchsia", $lng->txt(
"i_fuchsia"));
1490 $logtpl->setVariable(
"i_gray", $lng->txt(
"i_gray"));
1491 $logtpl->setVariable(
"error", $lng->txt(
"error"));
1492 $logtpl->setVariable(
"strange_error", $lng->txt(
"strange_error"));
1493 $logtpl->setVariable(
"strange_API-Call", $lng->txt(
"strange_API-Call"));
1494 $logtpl->setVariable(
"unknown", $lng->txt(
"unknown"));
1495 $logtpl->setVariable(
"undefined_color", $lng->txt(
"undefined_color"));
1496 $logtpl->setVariable(
"description_for", $lng->txt(
"description_for"));
1497 $logtpl->setVariable(
"hide", $lng->txt(
"hide"));
1498 $logtpl->setVariable(
"all_API-calls_shown", $lng->txt(
"all_API-calls_shown"));
1499 $logtpl->setVariable(
"show_only_important_API-calls", $lng->txt(
"show_only_important_API-calls"));
1500 $logtpl->setVariable(
"only_important_API-Calls_shown", $lng->txt(
"only_important_API-Calls_shown"));
1501 $logtpl->setVariable(
"show_all_API-calls", $lng->txt(
"show_all_API-calls"));
1502 $logtpl->setVariable(
"log_for", $lng->txt(
"log_for"));
1503 $logtpl->setVariable(
"started", $lng->txt(
"started"));
1504 $logtpl->setVariable(
"nr_session", $lng->txt(
"nr_session"));
1505 $logtpl->setVariable(
"id_learning_module", $lng->txt(
"id_learning_module"));
1506 if ($this->slm->getCheck_values()==
false) {
1507 $logtpl->setVariable(
"CHECK_VALUES", $lng->txt(
"sent_values_not_checked"));
1509 $logtpl->parseCurrentBlock();
1510 fwrite($fHandle2, $logtpl->get());
1518 $webdir=str_replace(
"/ilias.php",
"",
$_SERVER[
"SCRIPT_NAME"]);
1520 $lm_dir=$webdir .
"/" . ILIAS_WEB_DIR .
"/" . CLIENT_ID .
"/lm_data" .
"/lm_" .
$this->packageId;
1528 $logDir=$this->slm->getDataDirectory() .
"/logs";
1529 if (!file_exists($logDir)) {
1539 header(
'Content-Type: text/html; charset=UTF-8');
1549 header(
"Cache-Control: private");
1550 header(
"Cache-Control: must-revalidate, post-check=0, pre-check=0");
1552 header(
"Content-Description: File Transfer");
1553 header(
"Content-Type: application/octet-stream");
1554 header(
"Content-disposition: attachment; filename=$filename");
1563 if ($fileInfo->isDot()) {
1566 $item[
'filename'] = $fileInfo->getFilename();
1567 $parts = pathinfo($item[
'filename']);
1568 $fnameparts = preg_split(
'/_/', $parts[
'filename'], -1, PREG_SPLIT_NO_EMPTY);
1569 $deleteUrl =
' <a href=#' .
" onclick=\"javascript:deleteFile('" . $item[
'filename'] .
"');\">" . $s_delete .
"</a>";
1575 $urlDownload =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=downloadLog&ref_id=' .
$_GET[
"ref_id"] .
'&logFile=' . $fileInfo->getFilename();
1576 $urlOpen =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=openLog&ref_id=' .
$_GET[
"ref_id"] .
'&logFile=' . $fileInfo->getFilename();
1577 $item[
'date'] =
date(
'Y/m/d H:i:s', $fileInfo->getCTime());
1578 if ($parts[
'extension'] ==
"html") {
1579 $item[
'action'] =$deleteUrl .
" <a href=" . $urlDownload .
">" . $s_download .
"</a> <a target=_new href=" . $urlOpen .
">" . $s_open .
"</a>";
1581 $item[
'action'] =$deleteUrl .
" <a href=" . $urlDownload .
">" . $s_download .
"</a>";
1583 if ($parts[
'extension'] ==
"html" || $parts[
'extension'] ==
"csv") {
1584 array_push(
$data, $item);
1587 usort(
$data,
"datecmp");
1593 header(
'Content-Type: text/html; charset=UTF-8');
1594 print file_get_contents($this->
logFileName() .
".html");
1600 $lng->loadLanguageModule(
"scormdebug");
1612 $this->tpl =
new ilTemplate(
"tpl.scorm2004.debug.html",
false,
false,
"./Modules/Scorm2004");
1613 $this->tpl->setVariable(
'CONSOLE', $lng->txt(
"debugwindow_console"));
1614 $this->tpl->setVariable(
'LOGS', $lng->txt(
"debugwindow_logs"));
1615 $this->tpl->setVariable(
'COMMENT', $lng->txt(
"debugwindow_comment"));
1616 $this->tpl->setVariable(
'COMMENT_ENTER', $lng->txt(
"debugwindow_comment_enter"));
1617 $this->tpl->setVariable(
'START_RECORDING', $lng->txt(
"debugwindow_start_recording"));
1618 $this->tpl->setVariable(
'STOP_RECORDING', $lng->txt(
"debugwindow_stop_recording"));
1619 $this->tpl->setVariable(
'DELETE_LOGFILE', $lng->txt(
"debugwindow_delete_logfile"));
1620 $this->tpl->setVariable(
'SUBMISSION_FAILED', $lng->txt(
"debugwindow_submission_failed"));
1621 $this->tpl->setVariable(
'SUBMIT', $lng->txt(
"debugwindow_submit"));
1622 $this->tpl->setVariable(
'CANCEL', $lng->txt(
"debugwindow_cancel"));
1623 $this->tpl->setVariable(
'FILENAME', $lng->txt(
"debugwindow_filename"));
1624 $this->tpl->setVariable(
'DATE', $lng->txt(
"debugwindow_date"));
1625 $this->tpl->setVariable(
'ACTION', $lng->txt(
"debugwindow_action"));
1626 $this->tpl->setVariable(
'RECORD_IMG',
ilUtil::getImagePath(
"record.png",
"./Modules/Scorm2004"));
1628 $this->tpl->setVariable(
'COMMENT_IMG',
ilUtil::getImagePath(
"comment.png",
"./Modules/Scorm2004"));
1630 $this->tpl->setVariable(
'LOGFILE', $this->
logFileName() .
".html");
1631 $this->tpl->setVariable(
'FILES_DATA', json_encode($this->
getLogFileList($lng->txt(
"debugwindow_delete"), $lng->txt(
"debugwindow_download"), $lng->txt(
"debugwindow_open"))));
1634 include_once
"Services/YUI/classes/class.ilYuiUtil.php";
1637 echo $this->tpl->get(
"DEFAULT",
true);
1642 return new ilTemplate(
"tpl.scorm2004.debugtxt.txt",
true,
true,
"Modules/Scorm2004");
1661 $debug_fields = parse_ini_file(
"./Modules/Scorm2004/scripts/rtemain/debug_default.ini",
true);
1664 $ini_array = $debug_fields[
'test_sco'];
1666 $ini_array = $debug_fields[
'normal_sco'];
1668 foreach ($ini_array as
$key => $value) {
1670 array_push($dvalues,
$key);
1679 $lng->loadLanguageModule(
"scormdebug");
1681 $logdata = json_decode(file_get_contents(
'php://input'));
1685 $fh_txt = fopen(
$filename .
".html",
'a') or die(
"can't open txt file");
1686 $fh_csv = fopen(
$filename .
".csv",
'a') or die(
"can't open csv file");
1687 $fh_tmp = fopen($tmp_name,
'r') or die(
"can't open tmp file");
1690 if (filesize($tmp_name)>0) {
1691 $tmp_content = unserialize(fread($fh_tmp, filesize($tmp_name)));
1693 $tmp_content = null;
1699 $fh_tmp2 = fopen($tmp_name,
'w') or die(
"can't open tmp file");
1703 $tmp_content[$logdata->scoid][$logdata->key][
'value'] = $logdata->value;
1704 $tmp_content[$logdata->scoid][$logdata->key][
'status'] = $logdata->result;
1705 $tmp_content[$logdata->scoid][$logdata->key][
'action'] = $logdata->action;
1707 fwrite($fh_tmp2, serialize($tmp_content));
1713 $errorcode = $logdata->errorcode;
1714 $fixedFailure =
false;
1715 $toleratedFailure =
false;
1716 $extraErrorDescription =
"";
1717 if ($errorcode == 200000) {
1719 $toleratedFailure =
true;
1720 $extraErrorDescription =
"tolerated failure";
1722 if ($errorcode>99999) {
1724 $fixedFailure =
true;
1725 $extraErrorDescription =
" failure corrected by ILIAS";
1727 if (strpos($logdata->action,
"ANALYZE")===
false) {
1728 $errorDescriptions =
array(
"0" =>
"",
1729 "101" =>
"General Exeption",
1730 "102" =>
"General Initialization Failure",
1731 "103" =>
"Already Initialized",
1732 "104" =>
"Content Instance Terminated",
1733 "111" =>
"General Termination Failure",
1734 "112" =>
"Termination Before Initialization",
1735 "113" =>
"Termination After Termination",
1736 "122" =>
"Retrieve Data Before Initialization",
1737 "123" =>
"Retrieve Data After Termination",
1738 "132" =>
"Store Data Before Initialization",
1739 "133" =>
"Store Data After Termination",
1740 "142" =>
"Commit Before Initialization",
1741 "143" =>
"Commit After Termination",
1742 "201" =>
"General Argument Error",
1743 "301" =>
"General Get Failure",
1744 "351" =>
"General Set Failure",
1745 "391" =>
"General Commit Failure",
1746 "401" =>
"Undefined Data Model Element",
1747 "402" =>
"Unimplemented Data Model Element",
1748 "403" =>
"Data Model Element Value Not Initialized",
1749 "404" =>
"Data Model Element Is Read Only",
1750 "405" =>
"Data Model Element Is Write Only",
1751 "406" =>
"Data Model Element Type Mismatch",
1752 "407" =>
"Data Model Element Value Out Of Range",
1753 "408" =>
"Data Model Dependency Not Established");
1754 $csv_string = $this->packageId .
';"' 1755 . $logdata->scoid .
'";"' 1756 . $logdata->scotitle .
'";' 1758 . $logdata->action .
'";"' 1759 . $logdata->key .
'";"' 1760 . str_replace(
"\"",
"\"\"", $logdata->value) .
'";"' 1761 . str_replace(
"\"",
"\"\"", $logdata->result) .
'";' 1763 . $logdata->timespan .
';"' 1764 . $errorDescriptions[$errorcode] . $extraErrorDescription .
'"' .
"\n";
1765 fwrite($fh_csv, $csv_string);
1769 if ($logdata->action ==
"Commit" || $logdata->action ==
"Terminate") {
1771 $sql_data = $this->
getNodeData($logdata->scoid, $fh_csv);
1772 if (count($sql_data) != 0) {
1773 foreach ($sql_data as
$key => $value) {
1774 $sql_string = $this->packageId .
';"' 1775 . $logdata->scoid .
'";"' 1776 . $logdata->scotitle .
'";' 1779 . str_replace(
"\"",
"\"\"", $value) .
'";;;;' .
"\n";
1780 fwrite($fh_csv, $sql_string);
1786 if ($logdata->action ==
"DELETE") {
1797 $ArGetValues =
array(
'comments_from_lms',
'completion_threshold',
'credit',
'entry',
'launch_data',
'learner_id',
'learner_name',
'max_time_allowed',
'mode',
'scaled_passing_score',
'time_limit_action',
'total_time');
1799 switch ($logdata->action) {
1801 if ($logdata->result ==
"true" && $errorcode == 0) {
1804 if ($color==
"green" && $logdata->key ==
"cmi.exit" && $logdata->value!=
"suspend") {
1807 if ($fixedFailure ==
false && $errorcode!=406) {
1808 $logdata->value =
'"' . $logdata->value .
'"';
1810 if ($toleratedFailure ==
true) {
1813 if ($fixedFailure ==
true) {
1818 if ($errorcode == 0) {
1823 if ($errorcode == 0) {
1825 $logtpl->setCurrentBlock(
"InitializeStart");
1826 $logtpl->setVariable(
"SCO-title", $lng->txt(
"SCO-title"));
1827 $logtpl->setVariable(
"SCO_TITLE", $logdata->scotitle);
1828 $logtpl->setVariable(
"SCO-name", $lng->txt(
"SCO-name"));
1829 $logtpl->setVariable(
"SCO_NAME", $logdata->scoid);
1830 $logtpl->setVariable(
"started", $lng->txt(
"started"));
1831 $logtpl->setVariable(
"TIMESTAMP",
$timestamp);
1832 $logtpl->setVariable(
"milliseconds", $lng->txt(
"milliseconds"));
1833 $logtpl->setVariable(
"API-call", $lng->txt(
"API-call"));
1834 $logtpl->setVariable(
"return_value", $lng->txt(
"return_value"));
1835 $logtpl->setVariable(
"error", $lng->txt(
"error"));
1836 $logtpl->parseCurrentBlock();
1840 if ($errorcode == 0) {
1843 if ($fixedFailure ==
true) {
1848 if ($errorcode == 0) {
1852 case 'GetErrorString':
1854 if ($errorcode == 0) {
1858 case 'GetLastError':
1859 $logtpl->setCurrentBlock(
"GetLastError");
1860 $logtpl->setVariable(
"TIMESPAN", $logdata->timespan);
1861 $logtpl->setVariable(
"RESULT", $logdata->result);
1862 $logtpl->parseCurrentBlock();
1864 case 'GetDiagnostic':
1865 $logtpl->setCurrentBlock(
"GetDiagnostic");
1866 $logtpl->setVariable(
"TIMESPAN", $logdata->timespan);
1867 $logtpl->setVariable(
"KEY", $logdata->key);
1868 $logtpl->setVariable(
"RESULT", $logdata->result);
1869 $logtpl->parseCurrentBlock();
1872 $logtpl->setCurrentBlock(
"INFO");
1873 $logtpl->setVariable(
"hint", $lng->txt(
"hint"));
1874 $logtpl->setVariable(
"KEY", $lng->txt($logdata->key));
1875 $logtpl->setVariable(
"VALUE", $logdata->value);
1876 $logtpl->parseCurrentBlock();
1879 $logtpl->setCurrentBlock(
"COMMENT");
1880 $logtpl->setVariable(
"comment", $lng->txt(
"comment"));
1881 $logtpl->setVariable(
"generated", $lng->txt(
"generated"));
1882 $logtpl->setVariable(
"TIMESTAMP",
$timestamp);
1883 $logtpl->setVariable(
"VALUE", $logdata->value);
1884 $logtpl->parseCurrentBlock();
1887 $logtpl->setCurrentBlock(
"ANALYZE");
1888 if (count($logdata->value) == 0) {
1890 $logtpl->setVariable(
"ANALYZE_SUMMARY", $lng->txt(
"no_missing_API-calls"));
1891 $logtpl->setVariable(
"VALUE",
"");
1893 $tmpvalue =
"SetValue(\"" . implode(
"\", ... ),<br/>SetValue(\"", $logdata->value) .
"\", ... )";
1894 for (
$i=0;
$i <count($ArGetValues);
$i++) {
1895 $tmpvalue = str_replace(
"SetValue(\"cmi." . $ArGetValues[
$i] .
"\", ... )",
"GetValue(\"cmi." . $ArGetValues[$i] .
"\")", $tmpvalue);
1897 $logtpl->setVariable(
"ANALYZE_SUMMARY", $lng->txt(
"missing_API-calls"));
1898 $logtpl->setVariable(
"VALUE", $tmpvalue);
1900 $logtpl->setVariable(
"summary_for_SCO_without_test", $lng->txt(
"summary_for_SCO_without_test"));
1901 $logtpl->setVariable(
"generated", $lng->txt(
"generated"));
1902 $logtpl->setVariable(
"TIMESTAMP",
$timestamp);
1903 $logtpl->setVariable(
"COLOR", $color);
1904 $logtpl->parseCurrentBlock();
1907 $logtpl->setCurrentBlock(
"ANALYZETEST");
1908 if (count($logdata->value) == 0) {
1910 $logtpl->setVariable(
"ANALYZE_SUMMARY", $lng->txt(
"no_missing_API-calls"));
1911 $logtpl->setVariable(
"VALUE",
"");
1913 $tmpvalue =
"SetValue(\"" . implode(
"\", ... ),<br/>SetValue(\"", $logdata->value) .
"\", ... )";
1914 for (
$i=0;
$i <count($ArGetValues);
$i++) {
1915 $tmpvalue = str_replace(
"SetValue(\"cmi." . $ArGetValues[
$i] .
"\", ... )",
"GetValue(\"cmi." . $ArGetValues[$i] .
"\")", $tmpvalue);
1917 $logtpl->setVariable(
"ANALYZE_SUMMARY", $lng->txt(
"missing_API-calls"));
1918 $logtpl->setVariable(
"VALUE", $tmpvalue);
1920 $logtpl->setVariable(
"summary_for_SCO_with_test", $lng->txt(
"summary_for_SCO_with_test"));
1921 $logtpl->setVariable(
"generated", $lng->txt(
"generated"));
1922 $logtpl->setVariable(
"TIMESTAMP",
$timestamp);
1923 $logtpl->setVariable(
"COLOR", $color);
1924 $logtpl->parseCurrentBlock();
1927 $logtpl->setCurrentBlock(
"SUMMARY");
1928 $logtpl->setVariable(
"summary_csv", $lng->txt(
"summary_csv"));
1929 $logtpl->setVariable(
"TIMESTAMP",
$timestamp);
1930 $logtpl->setVariable(
"summary_download", $lng->txt(
"summary_download"));
1931 $logtpl->parseCurrentBlock();
1938 if ($logdata->action ==
'SetValue' || $logdata->action ==
'GetValue') {
1939 $logtpl->setCurrentBlock($logdata->action);
1940 $logtpl->setVariable(
"ACTION", $logdata->action);
1941 $logtpl->setVariable(
"TIMESPAN", $logdata->timespan);
1942 $logtpl->setVariable(
"KEY", $logdata->key);
1943 $logtpl->setVariable(
"VALUE", $logdata->value);
1944 $logtpl->setVariable(
"RESULT", $logdata->result);
1945 $logtpl->setVariable(
"ERRORCODE", $errorcode);
1948 for (
$i=0;
$i <count($debugfields) ;
$i++) {
1949 if ($logdata->key == $debugfields[
$i]) {
1953 $logtpl->setVariable(
"IMPORTANTKEY",
"" . $importantkey);
1954 $logtpl->setVariable(
"COLOR", $color);
1955 $logtpl->parseCurrentBlock();
1956 } elseif ($logdata->action !=
'INFO' && $logdata->action !=
'ANALYZE' && $logdata->action !=
'ANALYZETEST' && $logdata->action !=
'SUMMARY' && $logdata->action !=
'COMMENT' && $logdata->action !=
'GetDiagnostic' && $logdata->action !=
'GetLastError') {
1957 $logtpl->setCurrentBlock(
"defaultCall");
1958 $logtpl->setVariable(
"ACTION", $logdata->action);
1959 $logtpl->setVariable(
"TIMESPAN", $logdata->timespan);
1960 $logtpl->setVariable(
"KEY", $logdata->key);
1961 $logtpl->setVariable(
"VALUE", $logdata->value);
1962 $logtpl->setVariable(
"RESULT", $logdata->result);
1963 $logtpl->setVariable(
"ERRORCODE", $errorcode);
1964 $logtpl->setVariable(
"IMPORTANTKEY",
"" . $importantkey);
1965 $logtpl->setVariable(
"COLOR", $color);
1966 $logtpl->parseCurrentBlock();
1979 if ($logdata->action ==
"SUMMARY") {
1983 fwrite($fh_txt, $logtpl->get());
1992 $element[
'title'] =
$data[
$i][
'title'];
1993 $element[
'id'] =
$data[
$i][
'id'];
1995 $element[
'sco'] =
"sco";
1997 $element[
'sco'] =
"assset";
1999 if (
$data[
$i][
'href'] !=null) {
2000 array_push($this->flat_structure, $element);
2002 if (
$data[
$i][
'item']!=null) {
2014 $columns_fixed =
array(
'id',
'title',
'type',
'attempted');
2016 $ini_data = parse_ini_file(
"./Modules/Scorm2004/scripts/rtemain/debug_default.ini",
true);
2017 $ini_array = $ini_data[
'summary'];
2018 $colums_variable =
array();
2019 $api_keys =
array();
2021 foreach ($ini_array as
$key => $value) {
2023 array_push($colums_variable,
$key);
2024 array_push($api_keys,
$key);
2025 array_push($colums_variable,
"Status");
2029 $header_array = array_merge($columns_fixed, $colums_variable);
2031 $csv_header = implode(
";", $header_array);
2034 $res = $ilDB->queryF(
2035 'SELECT jsdata FROM cp_package WHERE obj_id = %s',
2037 array($this->packageId)
2040 $packageData = $ilDB->fetchAssoc(
$res);
2042 $structure = json_decode($packageData[
'jsdata'],
true);
2045 $this->flat_structure =
array();
2048 foreach ($this->flat_structure as $tree_element) {
2049 $csv_data = $csv_data . $tree_element[
'id'] .
";" . $tree_element[
'title'] .
";" . $tree_element[
'sco'] .
";";
2050 if ($api_data[$tree_element[
'id']] != null) {
2051 $csv_data = $csv_data .
"X" .
";";
2053 $csv_data = $csv_data .
";";
2057 $id = $tree_element[
'id'];
2058 foreach ($api_keys as $api_element) {
2059 if ($api_data[
$id]!=null) {
2060 if ($api_data[
$id][$api_element]!=null) {
2061 $csv_data = $csv_data . $api_data[
$id][$api_element][
'value'] .
";" . $api_data[
$id][$api_element][
'status'] .
";";
2063 $csv_data = $csv_data .
";;";
2067 $csv_data = $csv_data .
"\n";
2071 fwrite(
$fh, $csv_header .
"\n" . $csv_data);
2093 if (strtotime($a[
'date']) == strtotime($b[
'date'])) {
2096 return (strtotime($a[
'date']) < strtotime($b[
'date'])) ? 1 :-1;
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
static getCookieMaxLifetimeInSeconds()
& executeCommand()
execute command
getDebugValues($test_sco=false)
get_actual_attempts()
Get number of actual attempts for the user.
normalizeFields($table, &$node)
maps API data structure type to internal datatype on a node and accepts only valid values...
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
if(!array_key_exists('StateId', $_REQUEST)) $id
getLogFileList($s_delete, $s_download, $s_open)
getCMIData($userId, $packageId)
static scormPlayerUnload($userId=null, $packageId, $time_from_lms)
static _lookupObjectId($a_ref_id)
lookup object id
writeSharedData($sco_node_id)
static signFolderOfStartFile($start_file_path)
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)
getNodeData($sco_id, $fh)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
special template class to simplify handling of ITX/PEAR
static persistCMIData($userId=null, $packageId, $defaultLessonMode, $comments, $interactions, $objectives, $time_from_lms, $data=null)
getMimetype($filename)
estimate content type for a filename by extension first do it for common static web files from extern...
Add a drawing to the header
static getIdleValue($fixedMode=false)
Returns the idle time in seconds.
Create styles array
The data for the language used.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
foreach($mandatory_scripts as $file) $timestamp
static getLocalPath($a_name="")
Get local path of a YUI js file.
increase_attemptAndsave_module_version()
Increases attempts by one and saves module_version for this package.
static getInlineCSS()
Get inline css.
Class ilObjSCORM2004LearningModule.
static getStatus($a_packageId, $a_user_id, $auto_last_visited, $scormType="1.2")
get_max_attempts()
Get max.
readSharedData($sco_node_id)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(empty($password)) $table
static getLocaljQueryPath()