5 require_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
6 require_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
26 'user_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>user_id),
27 'learner_name' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>learner_name),
28 'slm_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>slm_id),
29 'mode' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>c_mode),
30 'credit' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>credit),
33 'accesscount' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>accesscount),
34 'accessduration' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>accessduration),
35 'accessed' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>accessed),
36 'activityAbsoluteDuration' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>activityabsduration),
37 'activityAttemptCount' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>activityattemptcount),
38 'activityExperiencedDuration' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>activityexpduration),
39 'activityProgressStatus' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>activityprogstatus),
40 'attemptAbsoluteDuration' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>attemptabsduration),
41 'attemptCompletionAmount' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>attemptcomplamount),
42 'attemptCompletionStatus' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>attemptcomplstatus),
43 'attemptExperiencedDuration' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>attemptexpduration),
44 'attemptProgressStatus' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>attemptprogstatus),
45 'audio_captioning' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>audio_captioning),
46 'audio_level' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>audio_level),
47 'availableChildren' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>availablechildren),
48 'cmi_node_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>cmi_node_id),
49 'completion' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>completion),
50 'completion_status' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>completion_status),
51 'completion_threshold' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>completion_threshold),
52 'cp_node_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>cp_node_id),
53 'created' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>created),
54 'credit' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>credit),
55 'delivery_speed' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>delivery_speed),
56 'entry' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>c_entry),
57 'exit' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>c_exit),
58 'language' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>c_language),
59 'launch_data' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>launch_data),
60 'learner_name' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>learner_name),
61 'location' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>location),
62 'max' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>c_max),
63 'min' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>c_min),
64 'mode' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>c_mode),
65 'modified' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>modified),
66 'progress_measure' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>progress_measure),
67 'raw' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>c_raw),
68 'scaled' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>scaled),
69 'scaled_passing_score' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>scaled_passing_score),
70 'session_time' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>session_time),
71 'success_status' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>success_status),
72 'suspend_data' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>suspend_data),
73 'total_time' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>total_time),
74 'user_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>user_id),
77 'cmi_comment_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>cmi_comment_id),
78 'cmi_node_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>cmi_node_id),
79 'comment' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>c_comment),
80 'timestamp' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>c_timestamp),
81 'location' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>location),
82 'sourceIsLMS' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>sourceislms),
84 'correct_response' =>
array(
85 'cmi_correct_response_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>cmi_correct_resp_id),
86 'cmi_interaction_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>cmi_interaction_id),
87 'pattern' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>pattern),
89 'interaction' =>
array(
90 'cmi_interaction_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>cmi_interaction_id),
91 'cmi_node_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>cmi_node_id),
92 'description' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>description),
93 'id' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
id),
94 'latency' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>latency),
95 'learner_response' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>learner_response),
96 'result' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>result),
97 'timestamp' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>c_timestamp),
98 'type' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>c_type),
99 'weighting' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>weighting),
101 'objective' =>
array(
102 'cmi_interaction_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>cmi_interaction_id),
103 'cmi_node_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>cmi_node_id),
104 'cmi_objective_id' =>
array(
'pattern'=>null,
'permission' => self::NONE,
'default'=>null,
'dbfield'=>cmi_objective_id),
105 'completion_status' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>completion_status),
106 'description' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>description),
107 'id' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>
id),
108 'max' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>c_max),
109 'min' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>c_min),
110 'raw' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>c_raw),
111 'scaled' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>scaled),
112 'progress_measure' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>progress_measure),
113 'success_status' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>success_status),
114 'scope' =>
array(
'pattern'=>null,
'permission' => self::READWRITE,
'default'=>null,
'dbfield'=>scope),
132 if ($_REQUEST[
'learnerId']) {
133 $this->userId = $_REQUEST[
'learnerId'];
135 $this->userId =
$GLOBALS[
'USER'][
'usr_id'];
137 $this->packageId = (int) $_REQUEST[
'packageId'];
138 $this->jsMode = strpos(
$_SERVER[
'HTTP_ACCEPT'],
'text/javascript')!==
false;
140 $this->page = $_REQUEST[
'page'];
150 $this->ref_id =
$_GET[
'ref_id'];
151 $this->userId=$ilUser->getID();
153 if (
$_GET[
'envEditor'] != null) {
154 $this->envEditor =
$_GET[
'envEditor'];
156 $this->envEditor = 0;
168 $next_class = $this->ctrl->getNextClass($this);
169 $cmd = $this->ctrl->getCmd();
171 if (!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
173 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->WARNING);
204 case 'getGobjective':
208 case 'getSharedData':
212 case 'setSharedData':
218 if (
$_SERVER[
'REQUEST_METHOD']==
'POST') {
219 include_once
'./Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
221 $this->slm->getDefaultLessonMode(), $this->slm->getComments(),
222 $this->slm->getInteractions(), $this->slm->getObjectives(), $this->slm->getTime_from_lms());
239 case 'liveLogContent':
252 case 'scormPlayerUnload':
253 include_once
'./Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
269 $js_data = file_get_contents(
"./Modules/Scorm2004/scripts/buildrte/rte.js");
270 if (self::ENABLE_GZIP==1) {
271 ob_start(
"ob_gzhandler");
272 header(
'Content-Type: text/javascript; charset=UTF-8');
274 header(
'Content-Type: text/javascript; charset=UTF-8');
282 $webdir=str_replace(
"/ilias.php",
"",
$_SERVER[
"SCRIPT_NAME"]);
284 $lm_dir=$webdir.
"/".ILIAS_WEB_DIR.
"/".$this->
ilias->client_id .
"/lm_data".
"/lm_".$this->packageId;
292 $initSuspendData = null;
293 $cmi_learner_id = (
string) $ilUser->getID();
295 if(
$lm_set->get(
"scorm_login_as_learner_id") == 1) {
296 $cmi_learner_id = (
string) $ilUser->getLogin();
301 'learner_id' => (
string) $ilUser->getID(),
302 'cmi_learner_id' => $cmi_learner_id,
303 'course_id' => (
string) $this->packageId,
304 'learner_name' => $ilUser->getFirstname().
" ".$ilUser->getLastname(),
305 'mode' => $this->slm->getDefaultLessonMode(),
306 'credit' => $this->slm->getCreditMode(),
307 'auto_review' => $this->slm->getAutoReviewChar(),
308 'hide_navig' => $this->slm->getHideNavig(),
309 'hide_menu' => $this->slm->getNoMenu(),
310 'ie_force_render' => $this->slm->getIe_force_render(),
311 'fourth_edition' => $this->slm->getFourth_edition(),
312 'sequencing_enabled' => $this->slm->getSequencing(),
313 'interactions_storable' => $this->slm->getInteractions(),
314 'objectives_storable' => $this->slm->getObjectives(),
315 'comments_storable' => $this->slm->getComments(),
316 'time_from_lms' => $this->slm->getTime_from_lms(),
317 'auto_last_visited' => $this->slm->getAuto_last_visited(),
318 'lesson_mastery_score' => $this->slm->getMasteryScore(),
319 'checkSetValues' => $this->slm->getCheck_values(),
320 'auto_suspend' => $this->slm->getAutoSuspend(),
321 'suspend_data' => $initSuspendData,
324 'adlact_data' => null,
325 'globalobj_data' => null
327 include_once
'./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMInitData.php';
344 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
349 $initSuspendData = null;
350 $initAdlactData = null;
351 if ($this->slm->getSequencing() ==
true) {
360 if ($this->slm->getSession()) {
363 if ($session_timeout > $max_idle) $session_timeout = $max_idle;
365 if ($session_timeout > $min_idle) $session_timeout = $min_idle;
366 $session_timeout -= 10;
368 $session_timeout = 0;
370 $config[
'session_ping'] = $session_timeout;
373 $store_url =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=cmi&ref_id='.
$_GET[
"ref_id"];
374 $unload_url =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=scormPlayerUnload&ref_id='.
$_GET[
"ref_id"];
375 if ($this->slm->getSessionDeactivated()){
376 $store_url =
'storeScorm2004.php?package_id='.$this->packageId.
'&ref_id='.
$_GET[
"ref_id"].
'&client_id='.$this->
ilias->client_id.
'&do=store';
377 $unload_url =
'storeScorm2004.php?package_id='.$this->packageId.
'&ref_id='.
$_GET[
"ref_id"].
'&client_id='.$this->
ilias->client_id.
'&do=unload';
379 $config[
'cp_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=cp&ref_id='.$_GET[
"ref_id"];
380 $config[
'cmi_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=cmi&ref_id='.
$_GET[
"ref_id"];
381 $config[
'store_url'] = $store_url;
382 $config[
'get_adldata_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=getSharedData&ref_id='.
$_GET[
"ref_id"];
383 $config[
'set_adldata_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=setSharedData&ref_id=' .
$_GET[
"ref_id"];
384 $config[
'adlact_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=adlact&ref_id='.
$_GET[
"ref_id"];
385 $config[
'specialpage_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=specialPage&ref_id='.
$_GET[
"ref_id"];
386 $config[
'suspend_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=suspend&ref_id='.
$_GET[
"ref_id"];
387 $config[
'get_suspend_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=getSuspend&ref_id='.
$_GET[
"ref_id"];
389 $config[
'gobjective_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=gobjective&ref_id='.
$_GET[
"ref_id"];
390 $config[
'get_gobjective_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=getGobjective&ref_id='.
$_GET[
"ref_id"];
391 $config[
'ping_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=pingSession&ref_id='.
$_GET[
"ref_id"];
392 $config[
'scorm_player_unload_url']= $unload_url;
393 $config[
'post_log_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=postLogEntry&ref_id='.
$_GET[
"ref_id"];
394 $config[
'livelog_url'] =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=liveLogContent&ref_id='.
$_GET[
"ref_id"];
398 $config[
'envEditor'] = $this->envEditor;
401 $config[
'debug'] = $this->slm->getDebug();
407 $langstrings[
'btnStart'] = $lng->txt(
'scplayer_start');
408 $langstrings[
'btnExit'] = $lng->txt(
'scplayer_exit');
409 $langstrings[
'btnExitAll'] = $lng->txt(
'scplayer_exitall');
410 $langstrings[
'btnSuspendAll'] = $lng->txt(
'scplayer_suspendall');
411 $langstrings[
'btnPrevious'] = $lng->txt(
'scplayer_previous');
412 $langstrings[
'btnContinue'] = $lng->txt(
'scplayer_continue');
413 $langstrings[
'btnhidetree']=$lng->txt(
'scplayer_hidetree');
414 $langstrings[
'btnshowtree']=$lng->txt(
'scplayer_showtree');
415 $langstrings[
'linkexpandTree']=$lng->txt(
'scplayer_expandtree');
416 $langstrings[
'linkcollapseTree']=$lng->txt(
'scplayer_collapsetree');
417 $langstrings[
'contCreditOff']=$lng->txt(
'cont_credit_off');
418 if ($this->slm->getAutoReviewChar() ==
"s") {
419 $langstrings[
'contCreditOff']=$lng->txt(
'cont_sc_score_was_higher_message');
421 $config[
'langstrings'] = $langstrings;
425 $this->tpl =
new ilTemplate(
"tpl.scorm2004.player.html",
true,
true,
"Modules/Scorm2004");
427 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
431 $rte_css = $this->slm->getDataDirectory().
"/ilias_css_4_2/css/style.css";
432 if (is_file($rte_css))
434 $this->tpl->setCurrentBlock(
"rte_css");
435 $this->tpl->setVariable(
"RTE_CSS", $rte_css);
436 $this->tpl->parseCurrentBlock();
440 $this->tpl->setVariable(
'JSON_LANGSTRINGS', json_encode($langstrings));
444 $this->tpl->setVariable(
'TREE_JS',
"./Modules/Scorm2004/scripts/ilNestedList.js");
445 $this->tpl->setVariable($langstrings);
446 $this->tpl->setVariable(
'DOC_TITLE',
'ILIAS SCORM 2004 Player');
447 if ($this->slm->getIe_compatibility()) $this->tpl->setVariable(
'IE_COMPATIBILITY',
'<meta http-equiv="X-UA-Compatible" content="IE=7" />');
449 $this->tpl->setVariable(
'INIT_CP_DATA', json_encode(json_decode($this->
getCPDataInit())));
450 $this->tpl->setVariable(
'INIT_CMI_DATA', json_encode($this->
getCMIData($this->userId, $this->packageId)));
451 $this->tpl->setVariable(
'INIT_ADLACT_DATA', json_encode($initAdlactData));
452 $this->tpl->setVariable(
'INIT_GLOBALOBJ_DATA', json_encode($initGlobalobjData));
453 $this->tpl->setVariable(
'JS_DATA', json_encode(
$config));
454 list($tsfrac, $tsint) = explode(
' ', microtime());
455 $this->tpl->setVariable(
'TIMESTAMP', sprintf(
'%d%03d', $tsint, 1000*(
float)$tsfrac));
456 $this->tpl->setVariable(
'BASE_DIR',
'./Modules/Scorm2004/');
457 $this->tpl->setVariable(
'TXT_COLLAPSE',$lng->txt(
'scplayer_collapsetree'));
458 if ($this->slm->getDebug()) {
459 $this->tpl->setVariable(
'TXT_DEBUGGER',$lng->txt(
'scplayer_debugger'));
460 $this->tpl->setVariable(
'DEBUG_URL',
"PopupCenter('ilias.php?baseClass=ilSAHSPresentationGUI&cmd=debugGUI&ref_id=".
$_GET[
"ref_id"].
"','Debug',800,600);");
462 $this->tpl->setVariable(
'TXT_DEBUGGER',
'');
463 $this->tpl->setVariable(
'DEBUG_URL',
'');
467 $this->tpl->setVariable(
'INLINE_CSS', ilSCORM13Player::getInlineCss());
470 if ($this->slm->getCacheDeactivated()){
471 $this->tpl->setVariable(
'JS_SCRIPTS',
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=getRTEjs&ref_id='.
$_GET[
"ref_id"]);
473 $this->tpl->setVariable(
'JS_SCRIPTS',
'./Modules/Scorm2004/scripts/buildrte/rte-min.js');
477 if ($this->slm->getNoMenu()==
"y") {
478 $this->tpl->setVariable(
"VAL_DISPLAY",
"style=\"display:none;\"");
480 $this->tpl->setVariable(
"VAL_DISPLAY",
"");
487 header(
'Content-Type: text/html; charset=utf-8');
488 echo($lng->txt(
"cont_sc_max_attempt_exceed"));
497 $this->tpl->show(
"DEFAULT",
false);
505 $is_tpl =
new ilTemplate(
"tpl.scorm2004.inlinecss.html",
true,
true,
"Modules/Scorm2004");
514 return $is_tpl->get();
522 header(
'Content-Type: text/javascript; charset=UTF-8');
527 header(
'Content-Type: text/plain; charset=UTF-8');
528 $jsdata = json_decode($jsdata);
536 $res = $ilDB->queryF(
537 'SELECT jsdata FROM cp_package WHERE obj_id = %s',
539 array($this->packageId)
541 $packageData = $ilDB->fetchAssoc(
$res);
543 $jsdata = $packageData[
'jsdata'];
544 if (!$jsdata) $jsdata =
'null';
554 $res = $ilDB->queryF(
555 'SELECT activitytree FROM cp_package WHERE obj_id = %s',
557 array($this->packageId)
561 $activitytree =
$data[
'activitytree'];
565 $activitytree =
'null';
567 return $activitytree;
575 header(
'Content-Type: text/javascript; charset=UTF-8');
576 print($activitytree);
580 header(
'Content-Type: text/plain; charset=UTF-8');
581 $activitytree = json_decode($activitytree);
582 print_r($activitytree);
589 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
592 header(
'Content-Type: text/plain; charset=UTF-8');
600 $res = $ilDB->queryF(
601 'SELECT global_to_system FROM cp_package WHERE obj_id = %s',
603 array($this->packageId)
607 $gystem =
$data[
'global_to_system'];
620 $res = $ilDB->queryF(
621 'SELECT data FROM cp_suspend WHERE obj_id = %s AND user_id = %s',
622 array(
'integer',
'integer'),
623 array($this->packageId, $ilUser->getId())
629 'DELETE FROM cp_suspend WHERE obj_id = %s AND user_id = %s',
630 array(
'integer',
'integer'),
631 array($this->packageId, $ilUser->getId())
633 return $data[
'data'];
641 header(
'Content-Type: text/javascript; charset=UTF-8');
642 print($suspend_data);
646 header(
'Content-Type: text/plain; charset=UTF-8');
647 $suspend_data = json_decode($suspend_data);
648 print_r($suspend_data);
656 $res = $ilDB->queryF(
657 'SELECT * FROM cp_suspend WHERE obj_id = %s AND user_id = %s',
658 array(
'integer',
'integer'),
659 array($this->packageId, $ilUser->getId())
662 if(!$ilDB->numRows(
$res))
664 $ilDB->insert(
'cp_suspend',
array(
665 'data' =>
array(
'clob', file_get_contents(
'php://input')),
666 'obj_id' =>
array(
'integer', $this->packageId),
667 'user_id' =>
array(
'integer', $ilUser->getId())
672 $ilDB->update(
'cp_suspend',
674 'data' =>
array(
'clob', file_get_contents(
'php://input'))
677 'obj_id' =>
array(
'integer', $this->packageId),
678 'user_id' =>
array(
'integer', $ilUser->getId())
689 $g_data =
new stdClass();
691 $global_to_system = 1;
693 $res = $ilDB->queryF(
'SELECT global_to_system FROM cp_package WHERE obj_id = %s',
695 array($this->packageId)
699 $global_to_system =
$data[
'global_to_system'];
702 $query =
'SELECT objective_id, scope_id, satisfied, measure, user_id, 703 score_min, score_max, score_raw, completion_status, 705 .
'FROM cmi_gobjective, cp_node, cp_mapinfo ' 706 .
'WHERE (cmi_gobjective.objective_id <> %s AND cmi_gobjective.status IS NULL ' 707 .
'AND cp_node.slm_id = %s AND cp_node.nodename = %s ' 708 .
'AND cp_node.cp_node_id = cp_mapinfo.cp_node_id ' 709 .
'AND cmi_gobjective.objective_id = cp_mapinfo.targetobjectiveid) ' 710 .
'GROUP BY objective_id, scope_id, satisfied, measure, user_id, 711 score_min, score_max, score_raw, completion_status, 713 $res = $ilDB->queryF(
715 array(
'text',
'integer',
'text'),
716 array(
'-course_overall_status-', $this->packageId,
'mapInfo')
718 while(
$row = $ilDB->fetchAssoc(
$res))
720 if (($global_to_system == 1 &&
$row[
'scope_id'] == 0) || ($global_to_system == 0 &&
$row[
'scope_id'] ==
$this->packageId)) {
721 $learner =
$row[
'user_id'];
722 $objective_id =
$row[
'objective_id'];
723 if(
$row[
'scope_id'] == 0)
729 $scope =
$row[
'scope_id'];
732 if(
$row[
'satisfied'] != NULL)
734 $toset =
$row[
'satisfied'];
735 $g_data->{
"satisfied"}->{$objective_id}->{$learner}->{$scope} = $toset;
738 if(
$row[
'measure'] != NULL)
740 $toset =
$row[
'measure'];
741 $g_data->{
"measure"}->{$objective_id}->{$learner}->{$scope} = $toset;
744 if(
$row[
'score_raw'] != NULL)
746 $toset =
$row[
'score_raw'];
747 $g_data->{
"score_raw"}->{$objective_id}->{$learner}->{$scope} = $toset;
750 if(
$row[
'score_min'] != NULL)
752 $toset =
$row[
'score_min'];
753 $g_data->{
"score_min"}->{$objective_id}->{$learner}->{$scope} = $toset;
756 if(
$row[
'score_max'] != NULL)
758 $toset =
$row[
'score_max'];
759 $g_data->{
"score_max"}->{$objective_id}->{$learner}->{$scope} = $toset;
762 if(
$row[
'progress_measure'] != NULL)
764 $toset =
$row[
'progress_measure'];
765 $g_data->{
"progress_measure"}->{$objective_id}->{$learner}->{$scope} = $toset;
768 if(
$row[
'completion_status'] != NULL)
770 $toset =
$row[
'completion_status'];
771 $g_data->{
"completion_status"}->{$objective_id}->{$learner}->{$scope} = $toset;
784 header(
'Content-Type: text/javascript; charset=UTF-8');
785 print($gobjective_data);
789 header(
'Content-Type: text/plain; charset=UTF-8');
790 $gobjective_data = json_decode($gobjective_data);
791 print_r($gobjective_data);
802 "permissions" =>
array());
803 $readPermissions =
array();
805 $query =
'SELECT target_id, read_shared_data, write_shared_data ' 807 .
'WHERE slm_id = %s ' 808 .
'AND sco_node_id = %s ' 809 .
'GROUP BY target_id, read_shared_data, write_shared_data';
812 $res = $ilDB->queryF(
814 array(
'integer',
'integer'),
815 array($this->packageId, $sco_node_id)
820 while(
$row = $ilDB->fetchAssoc(
$res))
822 $storeVal = (
$row[
'read_shared_data'] == 0 &&
$row[
'write_shared_data'] == 1 )
826 $dataStores[
"data"][
$row[
'target_id']] =
array(
"store" => $storeVal,
827 "readSharedData" => $row[
'read_shared_data'],
828 "writeSharedData" => $row[
'write_shared_data']);
829 $dataStores[
"readPermissions"][$row[
'target_id']] = $row[
'read_shared_data'];
832 if(count($dataStores) < 1)
838 else if ($dataStores[
"readPermissions"] != null && array_sum($dataStores[
"readPermissions"]) != 0)
846 "values" =>
array($this->userId, $this->packageId));
852 foreach($dataStores[
"data"] as $key => $val)
854 if($dataStores[
"readPermissions"][$key] == 1
855 && $dataStores[
"data"][$key][
"store"] !=
'notWritten')
859 $paramTemplate .=
'%s, ';
864 $paramTemplate = substr($paramTemplate, 0, strlen($paramTemplate) - 2);
867 $query =
'SELECT target_id, store ' 868 .
'FROM adl_shared_data ' 869 .
'WHERE user_id = %s ' 871 .
'AND target_id IN (' . $paramTemplate .
')';
874 $res = $ilDB->queryF(
880 while(
$row = $ilDB->fetchAssoc(
$res))
882 $dataStores[
"data"][
$row[
'target_id']][
"store"] = $row[
'store'];
886 header(
'Content-Type: text/javascript; charset=UTF-8');
888 echo json_encode($dataStores[
"data"]);
894 $g_data = json_decode(file_get_contents(
'php://input'));
897 $query =
'SELECT dm.target_id, sd.store ' 898 .
'FROM cp_datamap dm ' 899 .
'LEFT JOIN adl_shared_data sd ' 900 .
'ON(dm.slm_id = sd.slm_id AND dm.target_id = sd.target_id) ' 901 .
'WHERE sco_node_id = %s ' 902 .
'AND dm.slm_id = %s ' 903 .
'AND write_shared_data = 1 ' 904 .
'AND user_id = %s';
906 $res = $ilDB->QueryF(
908 array(
'integer',
'integer',
'integer'),
909 array($sco_node_id, $this->packageId, $this->userId)
912 $dataStores =
array();
913 $originalVals =
array();
914 while(
$row = $ilDB->fetchAssoc(
$res))
916 $id =
$row[
'target_id'];
917 $dataStores[$id] = $g_data->{$id};
918 $originalVals[$id] =
$row[
'store'];
923 foreach($g_data as $key => $obj)
927 if(array_key_exists($key, $dataStores) )
929 if($obj ==
'notWritten')
continue;
931 $query =
'UPDATE adl_shared_data ' 933 .
'WHERE user_id = %s ' 934 .
'AND target_id = %s ' 935 .
'AND slm_id = %s ';
939 array(
'text',
'integer',
'text',
'integer'),
940 array($dataStores[$key], $this->userId, $key, $this->packageId)
946 'SELECT write_shared_data, cp_node_id ' 948 .
'WHERE target_id = %s ' 950 .
'AND sco_node_id = %s',
951 array(
'text',
'integer',
'integer'),
952 array($key, $this->packageId, $sco_node_id));
955 if(
$row[
"write_shared_data"] != 1)
962 'INSERT INTO adl_shared_data (slm_id, user_id, target_id, store, cp_node_id) VALUES (%s, %s, %s, %s, %s)',
963 array(
'integer',
'integer',
'text',
'text',
'integer'),
964 array($this->packageId, $this->userId, $key, $obj,
$row[
"cp_node_id"]));
976 $specialpages =
array (
977 "_COURSECOMPLETE_" =>
"seq_coursecomplete",
978 "_ENDSESSION_" =>
"seq_endsession",
979 "_SEQBLOCKED_" =>
"seq_blocked",
980 "_NOTHING_" =>
"seq_nothing",
981 "_ERROR_" =>
"seq_error",
982 "_DEADLOCK_" =>
"seq_deadlock",
983 "_INVALIDNAVREQ_" =>
"seq_invalidnavreq",
984 "_SEQABANDON_" =>
"seq_abandon",
985 "_SEQABANDONALL_" =>
"seq_abandonall",
989 $this->tpl =
new ilTemplate(
"tpl.scorm2004.specialpages.html",
false,
false,
"Modules/Scorm2004");
991 $this->tpl->setVariable(
'TXT_SPECIALPAGE',$lng->txt($specialpages[$this->page]));
992 if ($this->page!=
"_TOC_" && $this->page!=
"_SEQABANDON_" && $this->page!=
"_SEQABANDONALL_" ) {
993 $this->tpl->setVariable(
'CLOSE_WINDOW',$lng->txt(
'seq_close'));
995 $this->tpl->setVariable(
'CLOSE_WINDOW',
"");
997 $this->tpl->show(
"DEFAULT",
false);
1006 header(
'Content-Type: text/javascript; charset=UTF-8');
1007 print(json_encode(
$data));
1011 header(
'Content-Type: text/plain; charset=UTF-8');
1012 print(var_export(
$data,
true));
1027 if (isset($value) && is_string($v) && !preg_match($v, $value))
1040 'schema' =>
array(),
1046 $result[
'schema'][$k] = array_keys($v);
1051 $q =
'SELECT cmi_node.* 1053 INNER JOIN cp_node ON cmi_node.cp_node_id = cp_node.cp_node_id 1054 WHERE cmi_node.user_id = %s 1055 AND cp_node.slm_id = %s';
1062 if ($this->slm->getComments()) $q =
'SELECT 1063 cmi_comment.cmi_comment_id, 1064 cmi_comment.cmi_node_id, 1065 cmi_comment.c_comment, 1066 cmi_comment.c_timestamp, 1067 cmi_comment.location, 1068 cmi_comment.sourceislms 1070 INNER JOIN cmi_node ON cmi_node.cmi_node_id = cmi_comment.cmi_node_id 1071 INNER JOIN cp_node ON cp_node.cp_node_id = cmi_node.cp_node_id 1072 WHERE cmi_node.user_id = %s 1073 AND cp_node.slm_id = %s 1074 ORDER BY cmi_comment.cmi_comment_id';
1079 case "correct_response":
1082 if ($this->slm->getInteractions()) $q =
'SELECT cmi_correct_response.* 1083 FROM cmi_correct_response 1084 INNER JOIN cmi_interaction 1085 ON cmi_interaction.cmi_interaction_id = cmi_correct_response.cmi_interaction_id 1086 INNER JOIN cmi_node ON cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 1087 INNER JOIN cp_node ON cp_node.cp_node_id = cmi_node.cp_node_id 1088 WHERE cmi_node.user_id = %s 1089 AND cp_node.slm_id = %s 1090 ORDER BY cmi_correct_response.cmi_correct_resp_id';
1097 if ($this->slm->getInteractions()) $q =
'SELECT 1098 cmi_interaction.cmi_interaction_id, 1099 cmi_interaction.cmi_node_id, 1100 cmi_interaction.description, 1102 cmi_interaction.latency, 1103 cmi_interaction.learner_response, 1104 cmi_interaction.result, 1105 cmi_interaction.c_timestamp, 1106 cmi_interaction.c_type, 1107 cmi_interaction.weighting 1108 FROM cmi_interaction 1109 INNER JOIN cmi_node ON cmi_node.cmi_node_id = cmi_interaction.cmi_node_id 1110 INNER JOIN cp_node ON cp_node.cp_node_id = cmi_node.cp_node_id 1111 WHERE cmi_node.user_id = %s 1112 AND cp_node.slm_id = %s 1113 ORDER BY cmi_interaction.cmi_interaction_id';
1119 if ($this->slm->getObjectives()) $q =
'SELECT 1120 cmi_objective.cmi_interaction_id, 1121 cmi_objective.cmi_node_id, 1122 cmi_objective.cmi_objective_id, 1123 cmi_objective.completion_status, 1124 cmi_objective.description, 1126 cmi_objective.c_max, 1127 cmi_objective.c_min, 1128 cmi_objective.c_raw, 1129 cmi_objective.scaled, 1130 cmi_objective.progress_measure, 1131 cmi_objective.success_status, 1134 INNER JOIN cmi_node ON cmi_node.cmi_node_id = cmi_objective.cmi_node_id 1135 INNER JOIN cp_node ON cp_node.cp_node_id = cmi_node.cp_node_id 1136 WHERE cmi_node.user_id = %s 1137 AND cp_node.slm_id = %s 1138 ORDER BY cmi_objective.cmi_objective_id';
1143 $q =
'SELECT usr_data.usr_id user_id, 1144 CONCAT(CONCAT(COALESCE(usr_data.firstname, \'\'), \' \'), COALESCE(usr_data.lastname, \'\')) learner_name, 1145 sahs_lm.id slm_id , sahs_lm.default_lesson_mode "mode", sahs_lm.credit 1146 FROM usr_data, cp_package 1147 INNER JOIN sahs_lm ON cp_package.obj_id = sahs_lm.id 1148 WHERE usr_data.usr_id = %s 1149 AND sahs_lm.id = %s';
1157 $types =
array(
'integer',
'integer');
1159 $res = $ilDB->queryF($q, $types, $values);
1161 while(
$row = $ilDB->fetchAssoc(
$res))
1163 $tmp_result =
array();
1164 foreach(
$row as $key => $value)
1166 if ($k ==
"comment" && $key ==
"c_timestamp" && strpos($value,
' ')==10) $value = str_replace(
' ',
'T',$value);
1167 $tmp_result[] = $value;
1168 if($k==
"node" && $key==
"additional_tables" && $i_check<$value){
1173 $result[
'data'][$k][] = $tmp_result;
1185 if(!is_array($a_array)
or !count($a_array))
1190 foreach($a_array as $k => $item)
1192 if ($item != null) {
1193 $a_array[$k] = $ilDB->quote($item);
1195 $a_array[$k] =
"NULL";
1211 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1221 include_once
"./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMInitData.php";
1229 $res = $ilDB->queryF(
1230 'SELECT module_version FROM sahs_lm WHERE id = %s',
1232 array($this->packageId));
1235 return $row[
'module_version'];
1244 $val_set = $ilDB->queryF(
'SELECT package_attempts FROM sahs_user WHERE obj_id = %s AND user_id = %s',
1245 array(
'integer',
'integer'),
array($this->packageId,$this->userId));
1246 $val_rec = $ilDB->fetchAssoc($val_set);
1247 $attempts = $val_rec[
"package_attempts"];
1248 if ($attempts == null) $attempts = 0;
1258 $res = $ilDB->queryF(
1259 'SELECT package_attempts,count(*) cnt FROM sahs_user WHERE obj_id = %s AND user_id = %s GROUP BY package_attempts',
1260 array(
'integer',
'integer'),
1261 array($this->slm->getId(),$ilUser->getId()));
1262 $val_rec = $ilDB->fetchAssoc(
$res);
1263 if ($val_rec[
"cnt"] == 0) {
1266 'INSERT INTO sahs_user (obj_id,user_id,package_attempts,module_version,last_access) VALUES(%s,%s,%s,%s,%s)',
1267 array(
'integer',
'integer',
'integer',
'integer',
'timestamp'),
1268 array($this->slm->getId(), $ilUser->getId(), $attempts, $this->slm->getModuleVersion(),
date(
'Y-m-d H:i:s')));
1270 $attempts = $val_rec[
"package_attempts"];
1271 if ($attempts == null) $attempts = 0;
1274 'UPDATE sahs_user SET package_attempts = %s, module_version = %s, last_access=%s WHERE obj_id = %s AND user_id = %s ',
1275 array(
'integer',
'integer',
'timestamp',
'integer',
'integer'),
1276 array($attempts, $this->slm->getModuleVersion(),
date(
'Y-m-d H:i:s'), $this->slm->getId(), $ilUser->getId()));
1284 $res = $ilDB->queryF(
' 1285 SELECT shared_data_global_to_system 1289 array($this->packageId)
1292 $shared_global_to_sys = $ilDB->fetchObject(
$res)->shared_data_global_to_system;
1294 $res = $ilDB->queryF(
' 1299 array(
'integer',
'integer'),
1300 array($this->packageId, $this->userId)
1305 $dat = $ilDB->fetchObject(
$res)->data;
1306 if($dat != null && $dat !=
'' ) $suspended =
true;
1308 if($shared_global_to_sys == 0 && !$suspended)
1310 $ilDB->manipulateF(
' 1311 DELETE FROM adl_shared_data 1314 array(
'integer',
'integer'),
1315 array($this->packageId, $this->userId)
1326 $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,".
1327 "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";
1330 $res = $ilDB->queryF(
' 1331 SELECT '.$fieldList.
' 1332 FROM cmi_node,cp_node,cp_item 1333 WHERE cp_node.slm_id = %s 1334 AND cp_node.cp_node_id = cp_item.cp_node_id 1336 AND cmi_node.cp_node_id = cp_item.cp_node_id 1337 AND cmi_node.user_id = %s',
1338 array(
'integer',
'text',
'integer'),
1339 array($this->packageId, $sco_id, $this->userId)
1342 $ilLog->write(
"DEBUG SQL".
$row);
1351 $fHandle = fopen(
$filename,
'a')
or die(
"can't open file");
1352 fwrite($fHandle, $string);
1364 while (file_exists(
$filename.
"_".$adder.$suffix)) {
1368 $retname =
$filename.
"_".$adder.$suffix;
1370 if (!file_exists($retname)) {
1372 $fHandle = fopen($retname,
'a')
or die(
"can't open file");
1373 fwrite($fHandle, $string);
1382 $lng->loadLanguageModule(
"scormdebug");
1387 if (!file_exists($path_csv)) {
1389 $fHandle = fopen($path_csv,
'a')
or die(
"can't open file");
1390 $string =
'"CourseId";"ScoId";"ScoTitle";"Timestamp";"Action";"Key";"Value";"Return Value";"Errorcode";"Timespan";"ErrorDescription"'.
"\n";
1391 fwrite($fHandle, $string);
1394 if (!file_exists($path_txt)) {
1399 $fHandle2 = fopen($path_txt,
'a')
or die(
"can't open file");
1401 $logtpl->setCurrentBlock(
'NewLog');
1402 $logtpl->setVariable(
"COURSETITLE", $this->slm->getTitle());
1403 $logtpl->setVariable(
"COURSEID", $this->packageId);
1404 $logtpl->setVariable(
"TIMESTAMP",
date(
"d.m.Y H:i",
time()));
1406 $logtpl->setVariable(
"error0", $lng->txt(
"error0"));
1407 $logtpl->setVariable(
"error101", $lng->txt(
"error101"));
1408 $logtpl->setVariable(
"error102", $lng->txt(
"error102"));
1409 $logtpl->setVariable(
"error103", $lng->txt(
"error103"));
1410 $logtpl->setVariable(
"error104", $lng->txt(
"error104"));
1411 $logtpl->setVariable(
"error111", $lng->txt(
"error111"));
1412 $logtpl->setVariable(
"error112", $lng->txt(
"error112"));
1413 $logtpl->setVariable(
"error113", $lng->txt(
"error113"));
1414 $logtpl->setVariable(
"error122", $lng->txt(
"error122"));
1415 $logtpl->setVariable(
"error123", $lng->txt(
"error123"));
1416 $logtpl->setVariable(
"error132", $lng->txt(
"error132"));
1417 $logtpl->setVariable(
"error133", $lng->txt(
"error133"));
1418 $logtpl->setVariable(
"error142", $lng->txt(
"error142"));
1419 $logtpl->setVariable(
"error143", $lng->txt(
"error143"));
1420 $logtpl->setVariable(
"error201", $lng->txt(
"error201"));
1421 $logtpl->setVariable(
"error301", $lng->txt(
"error301"));
1422 $logtpl->setVariable(
"error351", $lng->txt(
"error351"));
1423 $logtpl->setVariable(
"error391", $lng->txt(
"error391"));
1424 $logtpl->setVariable(
"error401", $lng->txt(
"error401"));
1425 $logtpl->setVariable(
"error402", $lng->txt(
"error402"));
1426 $logtpl->setVariable(
"error403", $lng->txt(
"error403"));
1427 $logtpl->setVariable(
"error404", $lng->txt(
"error404"));
1428 $logtpl->setVariable(
"error405", $lng->txt(
"error405"));
1429 $logtpl->setVariable(
"error406", $lng->txt(
"error406"));
1430 $logtpl->setVariable(
"error407", $lng->txt(
"error407"));
1431 $logtpl->setVariable(
"error408", $lng->txt(
"error408"));
1432 $logtpl->setVariable(
"SetValue", $lng->txt(
"SetValue"));
1433 $logtpl->setVariable(
"GetValue", $lng->txt(
"GetValue"));
1434 $logtpl->setVariable(
"Commit", $lng->txt(
"Commit"));
1435 $logtpl->setVariable(
"Initialize", $lng->txt(
"Initialize"));
1436 $logtpl->setVariable(
"Terminate", $lng->txt(
"Terminate"));
1437 $logtpl->setVariable(
"GetErrorString", $lng->txt(
"GetErrorString"));
1438 $logtpl->setVariable(
"GetLastError", $lng->txt(
"GetLastError"));
1439 $logtpl->setVariable(
"GetDiagnostic", $lng->txt(
"GetDiagnostic"));
1440 $logtpl->setVariable(
"cmi._version", $lng->txt(
"cmi._version"));
1441 $logtpl->setVariable(
"cmi.comments_from_learner._children", $lng->txt(
"cmi.comments_from_learner._children"));
1442 $logtpl->setVariable(
"cmi.comments_from_learner._count", $lng->txt(
"cmi.comments_from_learner._count"));
1443 $logtpl->setVariable(
"cmi.comments_from_learner.n.comment", $lng->txt(
"cmi.comments_from_learner.n.comment"));
1444 $logtpl->setVariable(
"cmi.comments_from_learner.n.location", $lng->txt(
"cmi.comments_from_learner.n.location"));
1445 $logtpl->setVariable(
"cmi.comments_from_learner.n.timestamp", $lng->txt(
"cmi.comments_from_learner.n.timestamp"));
1446 $logtpl->setVariable(
"cmi.comments_from_lms._children", $lng->txt(
"cmi.comments_from_lms._children"));
1447 $logtpl->setVariable(
"cmi.comments_from_lms._count", $lng->txt(
"cmi.comments_from_lms._count"));
1448 $logtpl->setVariable(
"cmi.comments_from_lms.n.comment", $lng->txt(
"cmi.comments_from_lms.n.comment"));
1449 $logtpl->setVariable(
"cmi.comments_from_lms.n.location", $lng->txt(
"cmi.comments_from_lms.n.location"));
1450 $logtpl->setVariable(
"cmi.comments_from_lms.n.timestamp", $lng->txt(
"cmi.comments_from_lms.n.timestamp"));
1451 $logtpl->setVariable(
"cmi.completion_status", $lng->txt(
"cmi.completion_status"));
1452 $logtpl->setVariable(
"cmi.completion_threshold", $lng->txt(
"cmi.completion_threshold"));
1453 $logtpl->setVariable(
"cmi.credit", $lng->txt(
"cmi.credit"));
1454 $logtpl->setVariable(
"cmi.entry", $lng->txt(
"cmi.entry"));
1455 $logtpl->setVariable(
"cmi.exit", $lng->txt(
"cmi.exit"));
1456 $logtpl->setVariable(
"cmi.interactions._children", $lng->txt(
"cmi.interactions._children"));
1457 $logtpl->setVariable(
"cmi.interactions._count", $lng->txt(
"cmi.interactions._count"));
1458 $logtpl->setVariable(
"cmi.interactions.n.id", $lng->txt(
"cmi.interactions.n.id"));
1459 $logtpl->setVariable(
"cmi.interactions.n.type", $lng->txt(
"cmi.interactions.n.type"));
1460 $logtpl->setVariable(
"cmi.interactions.n.objectives._count", $lng->txt(
"cmi.interactions.n.objectives._count"));
1461 $logtpl->setVariable(
"cmi.interactions.n.objectives.n.id", $lng->txt(
"cmi.interactions.n.objectives.n.id"));
1462 $logtpl->setVariable(
"cmi.interactions.n.timestamp", $lng->txt(
"cmi.interactions.n.timestamp"));
1463 $logtpl->setVariable(
"cmi.interactions.n.correct_responses._count", $lng->txt(
"cmi.interactions.n.correct_responses._count"));
1464 $logtpl->setVariable(
"cmi.interactions.n.correct_responses.n.pattern", $lng->txt(
"cmi.interactions.n.correct_responses.n.pattern"));
1465 $logtpl->setVariable(
"cmi.interactions.n.weighting", $lng->txt(
"cmi.interactions.n.weighting"));
1466 $logtpl->setVariable(
"cmi.interactions.n.learner_response", $lng->txt(
"cmi.interactions.n.learner_response"));
1467 $logtpl->setVariable(
"cmi.interactions.n.result", $lng->txt(
"cmi.interactions.n.result"));
1468 $logtpl->setVariable(
"cmi.interactions.n.latency", $lng->txt(
"cmi.interactions.n.latency"));
1469 $logtpl->setVariable(
"cmi.interactions.n.description", $lng->txt(
"cmi.interactions.n.description"));
1470 $logtpl->setVariable(
"cmi.launch_data", $lng->txt(
"cmi.launch_data"));
1471 $logtpl->setVariable(
"cmi.learner_id", $lng->txt(
"cmi.learner_id"));
1472 $logtpl->setVariable(
"cmi.learner_name", $lng->txt(
"cmi.learner_name"));
1473 $logtpl->setVariable(
"cmi.learner_preference._children", $lng->txt(
"cmi.learner_preference._children"));
1474 $logtpl->setVariable(
"cmi.learner_preference.audio_level", $lng->txt(
"cmi.learner_preference.audio_level"));
1475 $logtpl->setVariable(
"cmi.learner_preference.language", $lng->txt(
"cmi.learner_preference.language"));
1476 $logtpl->setVariable(
"cmi.learner_preference.delivery_speed", $lng->txt(
"cmi.learner_preference.delivery_speed"));
1477 $logtpl->setVariable(
"cmi.learner_preference.audio_captioning", $lng->txt(
"cmi.learner_preference.audio_captioning"));
1478 $logtpl->setVariable(
"cmi.location", $lng->txt(
"cmi.location"));
1479 $logtpl->setVariable(
"cmi.max_time_allowed", $lng->txt(
"cmi.max_time_allowed"));
1480 $logtpl->setVariable(
"cmi.mode", $lng->txt(
"cmi.mode"));
1481 $logtpl->setVariable(
"cmi.objectives._children", $lng->txt(
"cmi.objectives._children"));
1482 $logtpl->setVariable(
"cmi.objectives._count", $lng->txt(
"cmi.objectives._count"));
1483 $logtpl->setVariable(
"cmi.objectives.n.id", $lng->txt(
"cmi.objectives.n.id"));
1484 $logtpl->setVariable(
"cmi.objectives.n.score._children", $lng->txt(
"cmi.objectives.n.score._children"));
1485 $logtpl->setVariable(
"cmi.objectives.n.score.scaled", $lng->txt(
"cmi.objectives.n.score.scaled"));
1486 $logtpl->setVariable(
"cmi.objectives.n.score.raw", $lng->txt(
"cmi.objectives.n.score.raw"));
1487 $logtpl->setVariable(
"cmi.objectives.n.score.min", $lng->txt(
"cmi.objectives.n.score.min"));
1488 $logtpl->setVariable(
"cmi.objectives.n.score.max", $lng->txt(
"cmi.objectives.n.score.max"));
1489 $logtpl->setVariable(
"cmi.objectives.n.success_status", $lng->txt(
"cmi.objectives.n.success_status"));
1490 $logtpl->setVariable(
"cmi.objectives.n.completion_status", $lng->txt(
"cmi.objectives.n.completion_status"));
1491 $logtpl->setVariable(
"cmi.objectives.n.progress_measure", $lng->txt(
"cmi.objectives.n.progress_measure"));
1492 $logtpl->setVariable(
"cmi.objectives.n.description", $lng->txt(
"cmi.objectives.n.description"));
1493 $logtpl->setVariable(
"cmi.progress_measure", $lng->txt(
"cmi.progress_measure"));
1494 $logtpl->setVariable(
"cmi.scaled_passing_score", $lng->txt(
"cmi.scaled_passing_score"));
1495 $logtpl->setVariable(
"cmi.score._children", $lng->txt(
"cmi.score._children"));
1496 $logtpl->setVariable(
"cmi.score.scaled", $lng->txt(
"cmi.score.scaled"));
1497 $logtpl->setVariable(
"cmi.score.raw", $lng->txt(
"cmi.score.raw"));
1498 $logtpl->setVariable(
"cmi.score.min", $lng->txt(
"cmi.score.min"));
1499 $logtpl->setVariable(
"cmi.score.max", $lng->txt(
"cmi.score.max"));
1500 $logtpl->setVariable(
"cmi.session_time", $lng->txt(
"cmi.session_time"));
1501 $logtpl->setVariable(
"cmi.success_status", $lng->txt(
"cmi.success_status"));
1502 $logtpl->setVariable(
"cmi.suspend_data", $lng->txt(
"cmi.suspend_data"));
1503 $logtpl->setVariable(
"cmi.time_limit_action", $lng->txt(
"cmi.time_limit_action"));
1504 $logtpl->setVariable(
"cmi.total_time", $lng->txt(
"cmi.total_time"));
1505 $logtpl->setVariable(
"adl.nav.request", $lng->txt(
"adl.nav.request"));
1506 $logtpl->setVariable(
"adl.nav.request_valid.continue", $lng->txt(
"adl.nav.request_valid.continue"));
1507 $logtpl->setVariable(
"adl.nav.request_valid.previous", $lng->txt(
"adl.nav.request_valid.previous"));
1508 $logtpl->setVariable(
"adl.nav.request_valid.choice", $lng->txt(
"adl.nav.request_valid.choice"));
1509 $logtpl->setVariable(
"i_green", $lng->txt(
"i_green"));
1510 $logtpl->setVariable(
"i_red", $lng->txt(
"i_red"));
1511 $logtpl->setVariable(
"i_orange", $lng->txt(
"i_orange"));
1512 $logtpl->setVariable(
"i_fuchsia", $lng->txt(
"i_fuchsia"));
1513 $logtpl->setVariable(
"i_gray", $lng->txt(
"i_gray"));
1514 $logtpl->setVariable(
"error", $lng->txt(
"error"));
1515 $logtpl->setVariable(
"strange_error", $lng->txt(
"strange_error"));
1516 $logtpl->setVariable(
"strange_API-Call", $lng->txt(
"strange_API-Call"));
1517 $logtpl->setVariable(
"unknown", $lng->txt(
"unknown"));
1518 $logtpl->setVariable(
"undefined_color", $lng->txt(
"undefined_color"));
1519 $logtpl->setVariable(
"description_for", $lng->txt(
"description_for"));
1520 $logtpl->setVariable(
"hide", $lng->txt(
"hide"));
1521 $logtpl->setVariable(
"all_API-calls_shown", $lng->txt(
"all_API-calls_shown"));
1522 $logtpl->setVariable(
"show_only_important_API-calls", $lng->txt(
"show_only_important_API-calls"));
1523 $logtpl->setVariable(
"only_important_API-Calls_shown", $lng->txt(
"only_important_API-Calls_shown"));
1524 $logtpl->setVariable(
"show_all_API-calls", $lng->txt(
"show_all_API-calls"));
1525 $logtpl->setVariable(
"log_for", $lng->txt(
"log_for"));
1526 $logtpl->setVariable(
"started", $lng->txt(
"started"));
1527 $logtpl->setVariable(
"nr_session", $lng->txt(
"nr_session"));
1528 $logtpl->setVariable(
"id_learning_module", $lng->txt(
"id_learning_module"));
1529 if($this->slm->getCheck_values()==
false) $logtpl->setVariable(
"CHECK_VALUES", $lng->txt(
"sent_values_not_checked"));
1530 $logtpl->parseCurrentBlock();
1531 fwrite($fHandle2,$logtpl->get());
1539 $webdir=str_replace(
"/ilias.php",
"",
$_SERVER[
"SCRIPT_NAME"]);
1541 $lm_dir=$webdir.
"/".ILIAS_WEB_DIR.
"/".$this->
ilias->client_id .
"/lm_data".
"/lm_".$this->packageId;
1549 $logDir=$this->slm->getDataDirectory().
"/logs";
1550 if (!file_exists($logDir)) {
1559 header(
'Content-Type: text/html; charset=UTF-8');
1568 header(
"Cache-Control: private");
1569 header(
"Cache-Control: must-revalidate, post-check=0, pre-check=0");
1571 header(
"Content-Description: File Transfer");
1572 header(
"Content-Type: application/octet-stream");
1573 header(
"Content-disposition: attachment; filename=$filename");
1581 foreach (
new DirectoryIterator($this->
logDirectory()) as $fileInfo) {
1582 if ($fileInfo->isDot()) {
1585 $item[
'filename'] = $fileInfo->getFilename();
1586 $parts = pathinfo($item[
'filename']);
1587 $fnameparts = preg_split(
'/_/', $parts[
'filename'], -1, PREG_SPLIT_NO_EMPTY);
1588 $deleteUrl =
' <a href=#'.
" onclick=\"javascript:deleteFile('".$item[
'filename'].
"');\">".$s_delete.
"</a>";
1592 $urlDownload =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=downloadLog&ref_id='.
$_GET[
"ref_id"].
'&logFile='.$fileInfo->getFilename();
1593 $urlOpen =
'ilias.php?baseClass=ilSAHSPresentationGUI' .
'&cmd=openLog&ref_id='.
$_GET[
"ref_id"].
'&logFile='.$fileInfo->getFilename();
1594 $item[
'date'] =
date(
'Y/m/d H:i:s', $fileInfo->getCTime());
1595 if ($parts[
'extension'] ==
"html") {
1596 $item[
'action'] =$deleteUrl.
" <a href=".$urlDownload.
">".$s_download.
"</a> <a target=_new href=".$urlOpen.
">".$s_open.
"</a>";
1598 $item[
'action'] =$deleteUrl.
" <a href=".$urlDownload.
">".$s_download.
"</a>";
1600 if ($parts[
'extension'] ==
"html" || $parts[
'extension'] ==
"csv") {
1601 array_push(
$data,$item);
1604 usort(
$data,
"datecmp");
1610 header(
'Content-Type: text/html; charset=UTF-8');
1611 print file_get_contents($this->
logFileName().
".html");
1617 $lng->loadLanguageModule(
"scormdebug");
1629 $this->tpl =
new ilTemplate(
"tpl.scorm2004.debug.html",
false,
false,
"./Modules/Scorm2004");
1630 $this->tpl->setVariable(
'CONSOLE', $lng->txt(
"debugwindow_console"));
1631 $this->tpl->setVariable(
'LOGS', $lng->txt(
"debugwindow_logs"));
1632 $this->tpl->setVariable(
'COMMENT', $lng->txt(
"debugwindow_comment"));
1633 $this->tpl->setVariable(
'COMMENT_ENTER', $lng->txt(
"debugwindow_comment_enter"));
1634 $this->tpl->setVariable(
'START_RECORDING', $lng->txt(
"debugwindow_start_recording"));
1635 $this->tpl->setVariable(
'STOP_RECORDING', $lng->txt(
"debugwindow_stop_recording"));
1636 $this->tpl->setVariable(
'DELETE_LOGFILE', $lng->txt(
"debugwindow_delete_logfile"));
1637 $this->tpl->setVariable(
'SUBMISSION_FAILED', $lng->txt(
"debugwindow_submission_failed"));
1638 $this->tpl->setVariable(
'SUBMIT', $lng->txt(
"debugwindow_submit"));
1639 $this->tpl->setVariable(
'CANCEL', $lng->txt(
"debugwindow_cancel"));
1640 $this->tpl->setVariable(
'FILENAME', $lng->txt(
"debugwindow_filename"));
1641 $this->tpl->setVariable(
'DATE', $lng->txt(
"debugwindow_date"));
1642 $this->tpl->setVariable(
'ACTION', $lng->txt(
"debugwindow_action"));
1643 $this->tpl->setVariable(
'RECORD_IMG',
ilUtil::getImagePath(
"record.png",
"./Modules/Scorm2004"));
1645 $this->tpl->setVariable(
'COMMENT_IMG',
ilUtil::getImagePath(
"comment.png",
"./Modules/Scorm2004"));
1647 $this->tpl->setVariable(
'LOGFILE',$this->
logFileName().
".html");
1648 $this->tpl->setVariable(
'FILES_DATA', json_encode($this->
getLogFileList($lng->txt(
"debugwindow_delete"), $lng->txt(
"debugwindow_download"), $lng->txt(
"debugwindow_open"))));
1651 include_once
"Services/YUI/classes/class.ilYuiUtil.php";
1654 echo $this->tpl->get(
"DEFAULT",
true);
1659 return new ilTemplate(
"tpl.scorm2004.debugtxt.txt",
true,
true,
"Modules/Scorm2004");
1678 $debug_fields = parse_ini_file(
"./Modules/Scorm2004/scripts/rtemain/debug_default.ini",
true);
1681 $ini_array = $debug_fields[
'test_sco'];
1683 $ini_array = $debug_fields[
'normal_sco'];
1685 foreach ($ini_array as $key => $value) {
1687 array_push($dvalues,$key);
1696 $lng->loadLanguageModule(
"scormdebug");
1698 $logdata = json_decode(file_get_contents(
'php://input'));
1702 $fh_txt = fopen(
$filename.
".html",
'a')
or die(
"can't open txt file");
1703 $fh_csv = fopen(
$filename.
".csv",
'a')
or die(
"can't open csv file");
1704 $fh_tmp = fopen($tmp_name,
'r')
or die(
"can't open tmp file");
1707 if (filesize($tmp_name)>0) {
1708 $tmp_content = unserialize(fread($fh_tmp,filesize($tmp_name)));
1710 $tmp_content = null;
1716 $fh_tmp2 = fopen($tmp_name,
'w')
or die(
"can't open tmp file");
1720 $tmp_content[$logdata->scoid][$logdata->key][
'value'] = $logdata->value;
1721 $tmp_content[$logdata->scoid][$logdata->key][
'status'] = $logdata->result;
1722 $tmp_content[$logdata->scoid][$logdata->key][
'action'] = $logdata->action;
1724 fwrite($fh_tmp2,serialize($tmp_content));
1730 $errorcode = $logdata->errorcode;
1731 $fixedFailure =
false;
1732 $toleratedFailure =
false;
1733 $extraErrorDescription =
"";
1734 if ($errorcode == 200000) {
1736 $toleratedFailure =
true;
1737 $extraErrorDescription =
"tolerated failure";
1739 if ($errorcode>99999) {
1741 $fixedFailure =
true;
1742 $extraErrorDescription =
" failure corrected by ILIAS";
1744 if (strpos($logdata->action,
"ANALYZE")===
false)
1746 $errorDescriptions =
array(
"0" =>
"",
1747 "101" =>
"General Exeption",
1748 "102" =>
"General Initialization Failure",
1749 "103" =>
"Already Initialized",
1750 "104" =>
"Content Instance Terminated",
1751 "111" =>
"General Termination Failure",
1752 "112" =>
"Termination Before Initialization",
1753 "113" =>
"Termination After Termination",
1754 "122" =>
"Retrieve Data Before Initialization",
1755 "123" =>
"Retrieve Data After Termination",
1756 "132" =>
"Store Data Before Initialization",
1757 "133" =>
"Store Data After Termination",
1758 "142" =>
"Commit Before Initialization",
1759 "143" =>
"Commit After Termination",
1760 "201" =>
"General Argument Error",
1761 "301" =>
"General Get Failure",
1762 "351" =>
"General Set Failure",
1763 "391" =>
"General Commit Failure",
1764 "401" =>
"Undefined Data Model Element",
1765 "402" =>
"Unimplemented Data Model Element",
1766 "403" =>
"Data Model Element Value Not Initialized",
1767 "404" =>
"Data Model Element Is Read Only",
1768 "405" =>
"Data Model Element Is Write Only",
1769 "406" =>
"Data Model Element Type Mismatch",
1770 "407" =>
"Data Model Element Value Out Of Range",
1771 "408" =>
"Data Model Dependency Not Established");
1772 $csv_string = $this->packageId.
';"' 1773 .$logdata->scoid.
'";"' 1774 .$logdata->scotitle.
'";' 1775 .date(
"d.m.Y H:i",
time()).
';"' 1776 .$logdata->action.
'";"' 1777 .$logdata->key.
'";"' 1778 .str_replace(
"\"",
"\"\"",$logdata->value).
'";"' 1779 .str_replace(
"\"",
"\"\"",$logdata->result).
'";' 1781 .$logdata->timespan.
';"' 1782 .$errorDescriptions[$errorcode].$extraErrorDescription.
'"'.
"\n";
1783 fwrite($fh_csv,$csv_string);
1787 if($logdata->action ==
"Commit" || $logdata->action ==
"Terminate")
1790 $sql_data = $this->
getNodeData($logdata->scoid,$fh_csv);
1791 foreach ($sql_data as $key => $value) {
1792 $sql_string = $this->packageId.
';"' 1793 .$logdata->scoid.
'";"' 1794 .$logdata->scotitle.
'";' 1795 .$timestamp.
';"SQL";"' 1797 .str_replace(
"\"",
"\"\"",$value).
'";;;;'.
"\n";
1798 fwrite($fh_csv,$sql_string);
1803 if ($logdata->action ==
"DELETE")
1815 $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');
1817 switch ($logdata->action) {
1819 if ($logdata->result ==
"true" && $errorcode == 0) $color =
"green";
1820 if ($color==
"green" && $logdata->key ==
"cmi.exit" && $logdata->value!=
"suspend") $color =
"orange";
1821 if ($fixedFailure ==
false && $errorcode!=406) $logdata->value =
'"'.$logdata->value.
'"';
1822 if ($toleratedFailure ==
true) $color =
"fuchsia";
1823 if ($fixedFailure ==
true) $color =
"gray";
1826 if ($errorcode == 0) $color =
"green";
1829 if ($errorcode == 0)
1832 $logtpl->setCurrentBlock(
"InitializeStart");
1833 $logtpl->setVariable(
"SCO-title", $lng->txt(
"SCO-title"));
1834 $logtpl->setVariable(
"SCO_TITLE", $logdata->scotitle);
1835 $logtpl->setVariable(
"SCO-name", $lng->txt(
"SCO-name"));
1836 $logtpl->setVariable(
"SCO_NAME", $logdata->scoid);
1837 $logtpl->setVariable(
"started", $lng->txt(
"started"));
1838 $logtpl->setVariable(
"TIMESTAMP",
$timestamp);
1839 $logtpl->setVariable(
"milliseconds", $lng->txt(
"milliseconds"));
1840 $logtpl->setVariable(
"API-call", $lng->txt(
"API-call"));
1841 $logtpl->setVariable(
"return_value", $lng->txt(
"return_value"));
1842 $logtpl->setVariable(
"error", $lng->txt(
"error"));
1843 $logtpl->parseCurrentBlock();
1847 if ($errorcode == 0) $color =
"green";
1848 if ($fixedFailure ==
true) $color =
"gray";
1851 if ($errorcode == 0) $color =
"green";
1853 case 'GetErrorString':
1855 if ($errorcode == 0) $color =
"green";
1857 case 'GetLastError':
1858 $logtpl->setCurrentBlock(
"GetLastError");
1859 $logtpl->setVariable(
"TIMESPAN", $logdata->timespan);
1860 $logtpl->setVariable(
"RESULT", $logdata->result);
1861 $logtpl->parseCurrentBlock();
1863 case 'GetDiagnostic':
1864 $logtpl->setCurrentBlock(
"GetDiagnostic");
1865 $logtpl->setVariable(
"TIMESPAN", $logdata->timespan);
1866 $logtpl->setVariable(
"KEY", $logdata->key);
1867 $logtpl->setVariable(
"RESULT", $logdata->result);
1868 $logtpl->parseCurrentBlock();
1871 $logtpl->setCurrentBlock(
"INFO");
1872 $logtpl->setVariable(
"hint", $lng->txt(
"hint"));
1873 $logtpl->setVariable(
"KEY", $lng->txt($logdata->key));
1874 $logtpl->setVariable(
"VALUE", $logdata->value);
1875 $logtpl->parseCurrentBlock();
1878 $logtpl->setCurrentBlock(
"COMMENT");
1879 $logtpl->setVariable(
"comment", $lng->txt(
"comment"));
1880 $logtpl->setVariable(
"generated", $lng->txt(
"generated"));
1881 $logtpl->setVariable(
"TIMESTAMP",
$timestamp);
1882 $logtpl->setVariable(
"VALUE", $logdata->value);
1883 $logtpl->parseCurrentBlock();
1886 $logtpl->setCurrentBlock(
"ANALYZE");
1887 if (count($logdata->value) == 0) {
1889 $logtpl->setVariable(
"ANALYZE_SUMMARY", $lng->txt(
"no_missing_API-calls"));
1890 $logtpl->setVariable(
"VALUE",
"");
1892 $tmpvalue =
"SetValue(\"".implode(
"\", ... ),<br/>SetValue(\"",$logdata->value).
"\", ... )";
1893 for ($i=0; $i <count($ArGetValues); $i++){
1894 $tmpvalue = str_replace(
"SetValue(\"cmi.".$ArGetValues[$i].
"\", ... )",
"GetValue(\"cmi.".$ArGetValues[$i].
"\")",$tmpvalue);
1896 $logtpl->setVariable(
"ANALYZE_SUMMARY", $lng->txt(
"missing_API-calls"));
1897 $logtpl->setVariable(
"VALUE", $tmpvalue);
1899 $logtpl->setVariable(
"summary_for_SCO_without_test", $lng->txt(
"summary_for_SCO_without_test"));
1900 $logtpl->setVariable(
"generated", $lng->txt(
"generated"));
1901 $logtpl->setVariable(
"TIMESTAMP",
$timestamp);
1902 $logtpl->setVariable(
"COLOR", $color);
1903 $logtpl->parseCurrentBlock();
1906 $logtpl->setCurrentBlock(
"ANALYZETEST");
1907 if (count($logdata->value) == 0) {
1909 $logtpl->setVariable(
"ANALYZE_SUMMARY", $lng->txt(
"no_missing_API-calls"));
1910 $logtpl->setVariable(
"VALUE",
"");
1912 $tmpvalue =
"SetValue(\"".implode(
"\", ... ),<br/>SetValue(\"",$logdata->value).
"\", ... )";
1913 for ($i=0; $i <count($ArGetValues); $i++){
1914 $tmpvalue = str_replace(
"SetValue(\"cmi.".$ArGetValues[$i].
"\", ... )",
"GetValue(\"cmi.".$ArGetValues[$i].
"\")",$tmpvalue);
1916 $logtpl->setVariable(
"ANALYZE_SUMMARY", $lng->txt(
"missing_API-calls"));
1917 $logtpl->setVariable(
"VALUE", $tmpvalue);
1919 $logtpl->setVariable(
"summary_for_SCO_with_test", $lng->txt(
"summary_for_SCO_with_test"));
1920 $logtpl->setVariable(
"generated", $lng->txt(
"generated"));
1921 $logtpl->setVariable(
"TIMESTAMP",
$timestamp);
1922 $logtpl->setVariable(
"COLOR", $color);
1923 $logtpl->parseCurrentBlock();
1926 $logtpl->setCurrentBlock(
"SUMMARY");
1927 $logtpl->setVariable(
"summary_csv", $lng->txt(
"summary_csv"));
1928 $logtpl->setVariable(
"TIMESTAMP",
$timestamp);
1929 $logtpl->setVariable(
"summary_download", $lng->txt(
"summary_download"));
1930 $logtpl->parseCurrentBlock();
1937 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]) $importantkey=1;
1951 $logtpl->setVariable(
"IMPORTANTKEY",
"".$importantkey);
1952 $logtpl->setVariable(
"COLOR", $color);
1953 $logtpl->parseCurrentBlock();
1955 else if ($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());
1990 for ($i=0; $i <count(
$data) ; $i++) {
1992 $element[
'title'] =
$data[$i][
'title'];
1993 $element[
'id'] =
$data[$i][
'id'];
1994 if (
$data[$i][
'sco'] == 1) {
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) {
2050 $csv_data = $csv_data.$tree_element[
'id'].
";".$tree_element[
'title'].
";".$tree_element[
'sco'].
";";
2051 if ($api_data[$tree_element[
'id']] != null) {
2052 $csv_data = $csv_data.
"X".
";";
2054 $csv_data = $csv_data.
";";
2058 $id = $tree_element[
'id'];
2059 foreach ($api_keys as $api_element) {
2060 if ($api_data[$id]!=null) {
2061 if ($api_data[$id][$api_element]!=null) {
2062 $csv_data = $csv_data.$api_data[$id][$api_element][
'value'].
";".$api_data[$id][$api_element][
'status'].
";";
2064 $csv_data = $csv_data.
";;";
2068 $csv_data = $csv_data.
"\n";
2072 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
static signFolderOfStartFile($start_file_path, ilWACCookieInterface $ilWACCookieInterface=null)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Add rich text string
The name of the decorator.
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 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)
redirection script todo: (a better solution should control the processing via a xml file) ...
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.
static getLocaljQueryPath()
Get local path of jQuery file.