3 declare(strict_types=1);
    45             'user_id' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'user_id'),
    46             'learner_name' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'learner_name'),
    47             'slm_id' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'slm_id'),
    48             'mode' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'c_mode'),
    49             'credit' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'credit'),
    52             'accesscount' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'accesscount'),
    53             'accessduration' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'accessduration'),
    54             'accessed' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'accessed'),
    55             'activityAbsoluteDuration' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'activityabsduration'),
    56             'activityAttemptCount' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'activityattemptcount'),
    57             'activityExperiencedDuration' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'activityexpduration'),
    58             'activityProgressStatus' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'activityprogstatus'),
    59             'attemptAbsoluteDuration' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'attemptabsduration'),
    60             'attemptCompletionAmount' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'attemptcomplamount'),
    61             'attemptCompletionStatus' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'attemptcomplstatus'),
    62             'attemptExperiencedDuration' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'attemptexpduration'),
    63             'attemptProgressStatus' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'attemptprogstatus'),
    64             'audio_captioning' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'audio_captioning'),
    65             'audio_level' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'audio_level'),
    66             'availableChildren' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'availablechildren'),
    67             'cmi_node_id' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'cmi_node_id'),
    68             'completion' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'completion'),
    69             'completion_status' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'completion_status'),
    70             'completion_threshold' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'completion_threshold'),
    71             'cp_node_id' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'cp_node_id'),
    72             'created' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'created'),
    73             'credit' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'credit'),
    74             'delivery_speed' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'delivery_speed'),
    75             'entry' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'c_entry'),
    76             'exit' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'c_exit'),
    77             'language' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'c_language'),
    78             'launch_data' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'launch_data'),
    79             'learner_name' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'learner_name'),
    80             'location' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'location'),
    81             'max' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'c_max'),
    82             'min' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'c_min'),
    83             'mode' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'c_mode'),
    84             'modified' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'modified'),
    85             'progress_measure' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'progress_measure'),
    86             'raw' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'c_raw'),
    87             'scaled' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'scaled'),
    88             'scaled_passing_score' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'scaled_passing_score'),
    89             'session_time' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'session_time'),
    90             'success_status' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'success_status'),
    91             'suspend_data' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'suspend_data'),
    92             'total_time' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'total_time'),
    93             'user_id' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'user_id'),
    96             'cmi_comment_id' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'cmi_comment_id'),
    97             'cmi_node_id' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'cmi_node_id'),
    98             'comment' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'c_comment'),
    99             'timestamp' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'c_timestamp'),
   100             'location' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'location'),
   101             'sourceIsLMS' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'sourceislms'),
   103         'correct_response' => array(
   104             'cmi_correct_response_id' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'cmi_correct_resp_id'),
   105             'cmi_interaction_id' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'cmi_interaction_id'),
   106             'pattern' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'pattern'),
   108         'interaction' => array(
   109             'cmi_interaction_id' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'cmi_interaction_id'),
   110             'cmi_node_id' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'cmi_node_id'),
   111             'description' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'description'),
   112             'id' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'id'),
   113             'latency' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'latency'),
   114             'learner_response' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'learner_response'),
   115             'result' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'result'),
   116             'timestamp' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'c_timestamp'),
   117             'type' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'c_type'),
   118             'weighting' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'weighting'),
   120         'objective' => array(
   121             'cmi_interaction_id' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'cmi_interaction_id'),
   122             'cmi_node_id' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'cmi_node_id'),
   123             'cmi_objective_id' => array(
'pattern' => null, 
'permission' => self::NONE, 
'default' => null, 
'dbfield' => 
'cmi_objective_id'),
   124             'completion_status' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'completion_status'),
   125             'description' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'description'),
   126             'id' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'id'),
   127             'max' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'c_max'),
   128             'min' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'c_min'),
   129             'raw' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'c_raw'),
   130             'scaled' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'scaled'),
   131             'progress_measure' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'progress_measure'),
   132             'success_status' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'success_status'),
   133             'scope' => array(
'pattern' => null, 
'permission' => self::READWRITE, 
'default' => null, 
'dbfield' => 
'scope'),
   152         $this->
ctrl = $DIC->ctrl();
   153         $this->userId = $DIC->user()->getId();
   154         $this->
lng = $DIC->language();
   157         $this->jsMode = strpos(
$_SERVER[
'HTTP_ACCEPT'], 
'text/javascript') !== 
false;
   159         if ($DIC->http()->wrapper()->query()->has(
'page')) {
   160             $this->page = $DIC->http()->wrapper()->query()->retrieve(
'page', $DIC->refinery()->kindlyTo()->string());
   163         $this->ref_id = $DIC->http()->wrapper()->query()->retrieve(
'ref_id', $DIC->refinery()->kindlyTo()->int());
   175         $ilAccess = $DIC->access();
   176         $lng = $DIC->language();
   179         $next_class = $this->
ctrl->getNextClass($this);
   180         $cmd = $this->
ctrl->getCmd();
   182         if (!$ilAccess->checkAccess(
"read", 
"", $this->ref_id)) {
   187         if ($DIC->http()->wrapper()->query()->has(
'node_id')) {
   188             $nodeId = $DIC->http()->wrapper()->query()->retrieve(
'node_id', $DIC->refinery()->kindlyTo()->int());
   219             case 'getGobjective':
   223             case 'getSharedData':
   227             case 'setSharedData':
   233                 if (
$_SERVER[
'REQUEST_METHOD'] === 
'POST') {
   237                         $this->slm->getDefaultLessonMode(),
   238                         $this->slm->getComments(),
   239                         $this->slm->getInteractions(),
   240                         $this->slm->getObjectives(),
   241                         $this->slm->getTime_from_lms(),
   261             case 'liveLogContent':
   274             case 'scormPlayerUnload':
   289         $js_data = file_get_contents(
"./Modules/Scorm2004/scripts/buildrte/rte.js");
   290         if (self::ENABLE_GZIP == 1) {
   291             ob_start(
"ob_gzhandler");
   293         header(
'Content-Type: text/javascript; charset=UTF-8');
   300         $webdir = str_replace(
"/ilias.php", 
"", 
$_SERVER[
"SCRIPT_NAME"]);
   302         $lm_dir = $webdir . 
"/" . 
ILIAS_WEB_DIR . 
"/" . 
CLIENT_ID . 
"/lm_data" . 
"/lm_" . (string) $this->packageId;
   313         $ilUser = $DIC->user();
   315         $initSuspendData = null;
   318             'learner_id' => (
string) $ilUser->getID(),
   319             'cmi_learner_id' => (string) $this->slm->getApiStudentId(),
   320             'course_id' => (string) $this->packageId,
   321             'learner_name' => (
string) $this->slm->getApiStudentName(),
   322             'mode' => $this->slm->getDefaultLessonMode(),
   323             'credit' => $this->slm->getCreditMode(),
   324             'auto_review' => $this->slm->getAutoReviewChar(),
   325             'hide_navig' => $this->slm->getHideNavig(),
   326             'hide_menu' => $this->slm->getNoMenu(),
   327             'ie_force_render' => $this->slm->getIe_force_render(),
   328             'fourth_edition' => $this->slm->getFourth_edition(),
   329             'sequencing_enabled' => $this->slm->getSequencing(),
   330             'interactions_storable' => $this->slm->getInteractions(),
   331             'objectives_storable' => $this->slm->getObjectives(),
   332             'comments_storable' => $this->slm->getComments(),
   333             'time_from_lms' => $this->slm->getTime_from_lms(),
   334             'auto_last_visited' => $this->slm->getAuto_last_visited(),
   335             'lesson_mastery_score' => $this->slm->getMasteryScore(),
   336             'checkSetValues' => $this->slm->getCheck_values(),
   337             'auto_suspend' => $this->slm->getAutoSuspend(),
   338             'suspend_data' => $initSuspendData,
   341             'adlact_data' => null,
   342             'globalobj_data' => null
   358         $lng = $DIC->language();
   364         $initSuspendData = null;
   365         $initAdlactData = null;
   366         $initGlobalobjData = null;
   367         if ($this->slm->getSequencing() == 
true) {
   376         if ($this->slm->getSession()) {
   379             if ($session_timeout > $max_idle) {
   380                 $session_timeout = $max_idle;
   383             if ($session_timeout > $min_idle) {
   384                 $session_timeout = $min_idle;
   386             if ($session_timeout > 10) { 
   387                 $session_timeout -= 10;
   390             $session_timeout = 0;
   392         $config[
'session_ping'] = $session_timeout;
   395         $store_url = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=cmi&ref_id=' . 
$this->ref_id;
   396         $unload_url = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=scormPlayerUnload&ref_id=' . 
$this->ref_id;
   397         if ($this->slm->getSessionDeactivated()) {
   398             $store_url = 
'storeScorm2004.php?package_id=' . $this->packageId . 
'&ref_id=' . $this->ref_id . 
'&client_id=' . 
CLIENT_ID . 
'&do=store';
   399             $unload_url = 
'storeScorm2004.php?package_id=' . $this->packageId . 
'&ref_id=' . $this->ref_id . 
'&client_id=' . 
CLIENT_ID . 
'&do=unload';
   401         $config[
'cp_url'] = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=cp&ref_id=' . 
$this->ref_id;
   402         $config[
'cmi_url'] = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=cmi&ref_id=' . 
$this->ref_id;
   403         $config[
'store_url'] = $store_url;
   404         $config[
'get_adldata_url'] = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=getSharedData&ref_id=' . 
$this->ref_id;
   405         $config[
'set_adldata_url'] = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=setSharedData&ref_id=' . 
$this->ref_id;
   406         $config[
'adlact_url'] = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=adlact&ref_id=' . 
$this->ref_id;
   407         $config[
'specialpage_url'] = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=specialPage&ref_id=' . 
$this->ref_id;
   408         $config[
'suspend_url'] = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=suspend&ref_id=' . 
$this->ref_id;
   409         $config[
'get_suspend_url'] = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=getSuspend&ref_id=' . 
$this->ref_id;
   411         $config[
'gobjective_url'] = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=gobjective&ref_id=' . 
$this->ref_id;
   412         $config[
'get_gobjective_url'] = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=getGobjective&ref_id=' . 
$this->ref_id;
   413         $config[
'ping_url'] = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=pingSession&ref_id=' . 
$this->ref_id;
   414         $config[
'scorm_player_unload_url'] = $unload_url;
   415         $config[
'post_log_url'] = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=postLogEntry&ref_id=' . 
$this->ref_id;
   416         $config[
'livelog_url'] = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=liveLogContent&ref_id=' . 
$this->ref_id;
   420         $config[
'envEditor'] = 0;
   423         $config[
'debug'] = $this->slm->getDebug();
   428         $langstrings[
'btnStart'] = $lng->
txt(
'scplayer_start');
   429         $langstrings[
'btnExit'] = $lng->
txt(
'scplayer_exit');
   430         $langstrings[
'btnExitAll'] = $lng->
txt(
'scplayer_exitall');
   431         $langstrings[
'btnSuspendAll'] = $lng->
txt(
'scplayer_suspendall');
   432         $langstrings[
'btnPrevious'] = $lng->
txt(
'scplayer_previous');
   433         $langstrings[
'btnContinue'] = $lng->
txt(
'scplayer_continue');
   434         $langstrings[
'btnhidetree'] = $lng->
txt(
'scplayer_hidetree');
   435         $langstrings[
'btnshowtree'] = $lng->
txt(
'scplayer_showtree');
   436         $langstrings[
'linkexpandTree'] = $lng->
txt(
'scplayer_expandtree');
   437         $langstrings[
'linkcollapseTree'] = $lng->
txt(
'scplayer_collapsetree');
   438         $langstrings[
'contCreditOff'] = $lng->
txt(
'cont_credit_off');
   439         if ($this->slm->getAutoReviewChar() === 
"s") {
   440             $langstrings[
'contCreditOff'] = $lng->
txt(
'cont_sc_score_was_higher_message');
   442         $config[
'langstrings'] = $langstrings;
   446         $this->tpl = 
new ilGlobalTemplate(
"tpl.scorm2004.player.html", 
true, 
true, 
"Modules/Scorm2004");
   450         $rte_css = $this->slm->getDataDirectory() . 
"/ilias_css_4_2/css/style.css";
   451         if (is_file($rte_css)) {
   452             $this->tpl->setCurrentBlock(
"rte_css");
   453             $this->tpl->setVariable(
"RTE_CSS", $rte_css);
   454             $this->tpl->parseCurrentBlock();
   458         $this->tpl->setVariable(
'JSON_LANGSTRINGS', json_encode($langstrings));
   462         $this->tpl->setVariable(
'TREE_JS', 
"./Modules/Scorm2004/scripts/ilNestedList.js");
   463         foreach ($langstrings as 
$key => $value) {
   464             $this->tpl->setVariable(
$key, $value);
   466         $this->tpl->setVariable(
'DOC_TITLE', 
'ILIAS: ' . $this->slm->getTitle());
   468         $this->tpl->setVariable(
'INIT_CP_DATA', json_encode(json_decode($this->
getCPDataInit())));
   469         $this->tpl->setVariable(
'INIT_CMI_DATA', json_encode($this->
getCMIData($this->userId, $this->packageId)));
   470         $this->tpl->setVariable(
'INIT_ADLACT_DATA', json_encode($initAdlactData));
   471         $this->tpl->setVariable(
'INIT_GLOBALOBJ_DATA', json_encode($initGlobalobjData));
   472         $this->tpl->setVariable(
'JS_DATA', json_encode($config));
   473         list($tsfrac, $tsint) = explode(
' ', microtime());
   474         $this->tpl->setVariable(
'TIMESTAMP', sprintf(
'%d%03d', $tsint, 1000 * (
float) $tsfrac));
   475         $this->tpl->setVariable(
'BASE_DIR', 
'./Modules/Scorm2004/');
   476         $this->tpl->setVariable(
'TXT_COLLAPSE', $lng->
txt(
'scplayer_collapsetree'));
   477         if ($this->slm->getDebug()) {
   478             $this->tpl->setVariable(
'TXT_DEBUGGER', $lng->
txt(
'scplayer_debugger'));
   479             $this->tpl->setVariable(
'DEBUG_URL', 
"PopupCenter('ilias.php?baseClass=ilSAHSPresentationGUI&cmd=debugGUI&ref_id=" . $this->ref_id . 
"','Debug',800,600);");
   481             $this->tpl->setVariable(
'TXT_DEBUGGER', 
'');
   482             $this->tpl->setVariable(
'DEBUG_URL', 
'');
   486         $this->tpl->setVariable(
'INLINE_CSS', ilSCORM13PlayerGUI::getInlineCss());
   489         if ($this->slm->getCacheDeactivated()) {
   490             $this->tpl->setVariable(
'JS_SCRIPTS', 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=getRTEjs&ref_id=' . $this->ref_id);
   492             $this->tpl->setVariable(
'JS_SCRIPTS', 
'./Modules/Scorm2004/scripts/buildrte/rte-min.js');
   496         if ($this->slm->getNoMenu() === 
true) {
   497             $this->tpl->setVariable(
"VAL_DISPLAY", 
"style=\"display:none;\"");
   499             $this->tpl->setVariable(
"VAL_DISPLAY", 
"");
   516         $this->tpl->printToStdout(
"DEFAULT", 
false);
   521         $is_tpl = 
new ilTemplate(
"tpl.scorm2004.inlinecss.html", 
true, 
true, 
"Modules/Scorm2004");
   530         return $is_tpl->get();
   537             header(
'Content-Type: text/javascript; charset=UTF-8');
   540             header(
'Content-Type: text/plain; charset=UTF-8');
   541             $jsdata = json_decode($jsdata);
   549         $ilDB = $DIC->database();
   552             'SELECT jsdata FROM cp_package WHERE obj_id = %s',
   554             array($this->packageId)
   558         $jsdata = $packageData[
'jsdata'];
   570         $ilDB = $DIC->database();
   573             'SELECT activitytree FROM cp_package WHERE obj_id = %s',
   575             array($this->packageId)
   579         $activitytree = 
$data[
'activitytree'];
   581         if (!$activitytree) {
   582             $activitytree = 
'null';
   584         return $activitytree;
   591             header(
'Content-Type: text/javascript; charset=UTF-8');
   592             print($activitytree);
   594             header(
'Content-Type: text/plain; charset=UTF-8');
   595             $activitytree = json_decode($activitytree);
   596             print_r($activitytree);
   604         header(
'Content-Type: text/plain; charset=UTF-8');
   611         $ilDB = $DIC->database();
   612         $ilUser = $DIC->user();
   615             'SELECT global_to_system FROM cp_package WHERE obj_id = %s',
   617             array($this->packageId)
   621         $gystem = 
$data[
'global_to_system'];
   625             $gsystem = (string) $this->packageId;
   634         $ilDB = $DIC->database();
   635         $ilUser = $DIC->user();
   638             'SELECT data FROM cp_suspend WHERE obj_id = %s AND user_id = %s',
   639             array(
'integer', 
'integer'),
   640             array($this->packageId, $ilUser->getId())
   646             'DELETE FROM cp_suspend WHERE obj_id = %s AND user_id = %s',
   647             array(
'integer', 
'integer'),
   648             array($this->packageId, $ilUser->getId())
   650         if (is_array(
$data)) {
   651             return $data[
'data'];
   660             header(
'Content-Type: text/javascript; charset=UTF-8');
   661             print($suspend_data);
   663             header(
'Content-Type: text/plain; charset=UTF-8');
   664             $suspend_data = json_decode($suspend_data);
   665             print_r($suspend_data);
   672         $ilDB = $DIC->database();
   673         $ilUser = $DIC->user();
   676             'SELECT * FROM cp_suspend WHERE obj_id = %s AND user_id = %s',
   677             array(
'integer', 
'integer'),
   678             array($this->packageId, $ilUser->getId())
   682             $ilDB->insert(
'cp_suspend', array(
   683                 'data' => array(
'clob', file_get_contents(
'php://input')),
   684                 'obj_id' => array(
'integer', $this->packageId),
   685                 'user_id' => array(
'integer', $ilUser->getId())
   691                     'data' => array(
'clob', file_get_contents(
'php://input'))
   694                     'obj_id' => array(
'integer', $this->packageId),
   695                     'user_id' => array(
'integer', $ilUser->getId())
   704         $ilDB = $DIC->database();
   705         $ilUser = $DIC->user();
   710         $global_to_system = 1;
   713             'SELECT global_to_system FROM cp_package WHERE obj_id = %s',
   715             array($this->packageId)
   718             $global_to_system = 
$data[
'global_to_system'];
   721         $query = 
'SELECT objective_id, scope_id, satisfied, measure, user_id,    722                                                  score_min, score_max, score_raw, completion_status,    724                . 
'FROM cmi_gobjective, cp_node, cp_mapinfo '   725                . 
'WHERE (cmi_gobjective.objective_id <> %s AND cmi_gobjective.status IS NULL '   726                . 
'AND cp_node.slm_id = %s AND cp_node.nodename = %s '   727                . 
'AND cp_node.cp_node_id = cp_mapinfo.cp_node_id '   728                . 
'AND cmi_gobjective.objective_id = cp_mapinfo.targetobjectiveid) '   729                . 
'GROUP BY objective_id, scope_id, satisfied, measure, user_id,   730                                        score_min, score_max, score_raw, completion_status,    734             array(
'text', 
'integer', 
'text'),
   735             array(
'-course_overall_status-', $this->packageId, 
'mapInfo')
   738             if (($global_to_system == 1 && $row[
'scope_id'] == 0) || ($global_to_system == 0 && $row[
'scope_id'] == 
$this->packageId)) {
   739                 $learner = $row[
'user_id'];
   740                 $objective_id = $row[
'objective_id'];
   741                 if ($row[
'scope_id'] == 0) {
   744                     $scope = $row[
'scope_id'];
   747                 if ($row[
'satisfied'] != null) {
   748                     $toset = $row[
'satisfied'];
   749                     $g_data[
"satisfied"][$objective_id][$learner][
$scope] = $toset;
   752                 if ($row[
'measure'] != null) {
   753                     $toset = $row[
'measure'];
   754                     $g_data[
"measure"][$objective_id][$learner][
$scope] = $toset;
   757                 if ($row[
'score_raw'] != null) {
   758                     $toset = $row[
'score_raw'];
   759                     $g_data[
"score_raw"][$objective_id][$learner][
$scope] = $toset;
   762                 if ($row[
'score_min'] != null) {
   763                     $toset = $row[
'score_min'];
   764                     $g_data[
"score_min"][$objective_id][$learner][
$scope] = $toset;
   767                 if ($row[
'score_max'] != null) {
   768                     $toset = $row[
'score_max'];
   769                     $g_data[
"score_max"][$objective_id][$learner][
$scope] = $toset;
   772                 if ($row[
'progress_measure'] != null) {
   773                     $toset = $row[
'progress_measure'];
   774                     $g_data[
"progress_measure"][$objective_id][$learner][
$scope] = $toset;
   777                 if ($row[
'completion_status'] != null) {
   778                     $toset = $row[
'completion_status'];
   779                     $g_data[
"completion_status"][$objective_id][$learner][
$scope] = $toset;
   790             header(
'Content-Type: text/javascript; charset=UTF-8');
   791             print($gobjective_data);
   793             header(
'Content-Type: text/plain; charset=UTF-8');
   794             $gobjective_data = json_decode($gobjective_data);
   795             print_r($gobjective_data);
   804         $ilDB = $DIC->database();
   805         $ilUser = $DIC->user();
   806         $dataStores = array( 
"data" => array(),
   807                              "permissions" => array());
   808         $readPermissions = array();
   810         $query = 
'SELECT target_id, read_shared_data, write_shared_data '   812                . 
'WHERE slm_id = %s '   813                . 
'AND sco_node_id = %s '   814                . 
'GROUP BY target_id, read_shared_data, write_shared_data';
   819             array(
'integer', 
'integer'),
   820             array($this->packageId, $sco_node_id)
   826             $storeVal = ($row[
'read_shared_data'] == 0 && $row[
'write_shared_data'] == 1)
   830             $dataStores[
"data"][$row[
'target_id']] = array( 
"store" => $storeVal,
   831                                     "readSharedData" => $row[
'read_shared_data'],
   832                                     "writeSharedData" => $row[
'write_shared_data']);
   833             $dataStores[
"readPermissions"][$row[
'target_id']] = $row[
'read_shared_data'];
   836         if (count($dataStores) < 1) {
   842         if (isset($dataStores[
"readPermissions"]) && $dataStores[
"readPermissions"] != null && array_sum($dataStores[
"readPermissions"]) != 0) {
   847             $params = array(
"types" => array(
"integer", 
"integer"),
   848                             "values" => array($this->userId, $this->packageId));
   854             foreach ($dataStores[
"data"] as 
$key => $val) {
   855                 if ($dataStores[
"readPermissions"][(
string) 
$key] == 1
   856                     && $dataStores[
"data"][(
string) 
$key][
"store"] !== 
'notWritten') {
   859                     $paramTemplate .= 
'%s, ';
   864             $paramTemplate = substr($paramTemplate, 0, -2);
   867             $query = 
'SELECT target_id, store '   868                    . 
'FROM adl_shared_data '   869                    . 
'WHERE user_id = %s '   871                    . 
'AND target_id IN (' . $paramTemplate . 
')';
   881                 $dataStores[
"data"][$row[
'target_id']][
"store"] = $row[
'store'];
   885         header(
'Content-Type: text/javascript; charset=UTF-8');
   887         echo json_encode($dataStores[
"data"]);
   893         $ilDB = $DIC->database();
   894         $ilUser = $DIC->user();
   895         $g_data = json_decode(file_get_contents(
'php://input'));
   897         if ($g_data == null) 
return;
   900         $query = 
'SELECT dm.target_id, sd.store '   901                . 
'FROM cp_datamap dm '   902                . 
'LEFT JOIN adl_shared_data sd '   903                . 
'ON(dm.slm_id = sd.slm_id AND dm.target_id = sd.target_id) '   904                . 
'WHERE sco_node_id = %s '   905                . 
'AND dm.slm_id = %s '   906                . 
'AND write_shared_data = 1 '   907                . 
'AND user_id = %s';
   911             array(
'integer', 
'integer', 
'integer'),
   912             array($sco_node_id, $this->packageId, $this->userId)
   915         $dataStores = array();
   916         $originalVals = array();
   918             $id = $row[
'target_id'];
   919             $dataStores[
$id] = $g_data->{
$id};
   920             $originalVals[
$id] = $row[
'store'];
   925         foreach ($g_data as 
$key => $obj) {
   928             if (array_key_exists(
$key, $dataStores)) {
   929                 if ($obj === 
'notWritten') {
   933                 $query = 
'UPDATE adl_shared_data '   935                        . 
'WHERE user_id = %s '   936                        . 
'AND target_id = %s '   937                        . 
'AND slm_id = %s ';
   941                     array(
'text', 
'integer', 
'text', 
'integer'),
   942                     array($dataStores[
$key], $this->userId, $key, $this->packageId)
   947                     'SELECT write_shared_data, cp_node_id '   949                       . 
'WHERE target_id = %s '   951                       . 
'AND sco_node_id = %s',
   952                     array(
'text', 
'integer', 
'integer'),
   953                     array(
$key, $this->packageId, $sco_node_id)
   957                 if ($row[
"write_shared_data"] != 1) {
   963                     'INSERT INTO adl_shared_data (slm_id, user_id, target_id, store, cp_node_id) VALUES (%s, %s, %s, %s, %s)',
   964                     array(
'integer', 
'integer', 
'text', 
'text', 
'integer'),
   965                     array($this->packageId, $this->userId, 
$key, $obj, $row[
"cp_node_id"])
   976         $lng = $DIC->language();
   978         $specialpages = array(
   979             "_COURSECOMPLETE_" => 
"seq_coursecomplete",
   980             "_ENDSESSION_" => 
"seq_endsession",
   981             "_SEQBLOCKED_" => 
"seq_blocked",
   982             "_NOTHING_" => 
"seq_nothing",
   983             "_ERROR_" => 
"seq_error",
   984             "_DEADLOCK_" => 
"seq_deadlock",
   985             "_INVALIDNAVREQ_" => 
"seq_invalidnavreq",
   986             "_SEQABANDON_" => 
"seq_abandon",
   987             "_SEQABANDONALL_" => 
"seq_abandonall",
   988             "_TOC_" => 
"seq_toc",
   992         $this->tpl = 
new ilGlobalTemplate(
"tpl.scorm2004.specialpages.html", 
false, 
false, 
"Modules/Scorm2004");
   994         $this->tpl->setVariable(
'TXT_SPECIALPAGE', 
$lng->
txt($specialpages[$this->page]));
   995         if ($this->page !== 
"_TOC_" && $this->page !== 
"_SEQABANDON_" && $this->page !== 
"_SEQABANDONALL_") {
   996             $this->tpl->setVariable(
'CLOSE_WINDOW', 
$lng->
txt(
'seq_close'));
   998             $this->tpl->setVariable(
'CLOSE_WINDOW', 
"");
  1000         $this->tpl->printToStdout(
"DEFAULT", 
false);
  1007         if ($this->jsMode) {
  1008             header(
'Content-Type: text/javascript; charset=UTF-8');
  1009             print(json_encode(
$data));
  1011             header(
'Content-Type: text/plain; charset=UTF-8');
  1012             print(var_export(
$data, 
true));
  1038         $ilDB = $DIC->database();
  1042             'schema' => array(),
  1046         foreach (self::$schema as $k => &$v) {
  1047             $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()) {
  1064                                                         cmi_comment.cmi_comment_id,   1065                                                         cmi_comment.cmi_node_id,   1066                                                         cmi_comment.c_comment,   1067                                                         cmi_comment.c_timestamp,   1068                                                         cmi_comment.location,   1069                                                         cmi_comment.sourceislms   1071                                                         INNER JOIN cmi_node ON cmi_node.cmi_node_id = cmi_comment.cmi_node_id   1072                                                         INNER JOIN cp_node ON cp_node.cp_node_id = cmi_node.cp_node_id  1073                                                         WHERE cmi_node.user_id = %s  1074                                                         AND cp_node.slm_id = %s   1075                                                         ORDER BY cmi_comment.cmi_comment_id';
  1081                 case "correct_response":
  1084                         if ($this->slm->getInteractions()) {
  1085                             $q = 
'SELECT cmi_correct_response.*   1086                                                         FROM cmi_correct_response   1087                                                         INNER JOIN cmi_interaction   1088                                                         ON cmi_interaction.cmi_interaction_id = cmi_correct_response.cmi_interaction_id   1089                                                         INNER JOIN cmi_node ON cmi_node.cmi_node_id = cmi_interaction.cmi_node_id   1090                                                         INNER JOIN cp_node ON cp_node.cp_node_id = cmi_node.cp_node_id  1091                                                         WHERE cmi_node.user_id = %s  1092                                                         AND cp_node.slm_id = %s   1093                                                         ORDER BY cmi_correct_response.cmi_correct_resp_id';
  1101                         if ($this->slm->getInteractions()) {
  1103                                                         cmi_interaction.cmi_interaction_id,   1104                                                         cmi_interaction.cmi_node_id,   1105                                                         cmi_interaction.description,   1107                                                         cmi_interaction.latency,   1108                                                         cmi_interaction.learner_response,   1109                                                         cmi_interaction.result,   1110                                                         cmi_interaction.c_timestamp,   1111                                                         cmi_interaction.c_type,   1112                                                         cmi_interaction.weighting  1113                                                         FROM cmi_interaction   1114                                                         INNER JOIN cmi_node ON cmi_node.cmi_node_id = cmi_interaction.cmi_node_id   1115                                                         INNER JOIN cp_node ON cp_node.cp_node_id = cmi_node.cp_node_id  1116                                                         WHERE cmi_node.user_id = %s  1117                                                         AND cp_node.slm_id = %s   1118                                                         ORDER BY cmi_interaction.cmi_interaction_id';
  1125                         if ($this->slm->getObjectives()) {
  1127                                                         cmi_objective.cmi_interaction_id,   1128                                                         cmi_objective.cmi_node_id,   1129                                                         cmi_objective.cmi_objective_id,   1130                                                         cmi_objective.completion_status,   1131                                                         cmi_objective.description,   1133                                                         cmi_objective.c_max,   1134                                                         cmi_objective.c_min,   1135                                                         cmi_objective.c_raw,   1136                                                         cmi_objective.scaled,   1137                                                         cmi_objective.progress_measure,   1138                                                         cmi_objective.success_status,   1141                                                         INNER JOIN cmi_node ON cmi_node.cmi_node_id = cmi_objective.cmi_node_id   1142                                                         INNER JOIN cp_node ON cp_node.cp_node_id = cmi_node.cp_node_id  1143                                                         WHERE cmi_node.user_id = %s  1144                                                         AND cp_node.slm_id = %s   1145                                                         ORDER BY cmi_objective.cmi_objective_id';
  1151                     $q = 
'SELECT usr_data.usr_id user_id,   1152                                                 CONCAT(CONCAT(COALESCE(usr_data.firstname, \'\'), \' \'), COALESCE(usr_data.lastname, \'\')) learner_name,   1153                                                 sahs_lm.id slm_id , sahs_lm.default_lesson_mode "mode", sahs_lm.credit  1154                                                 FROM usr_data, cp_package  1155                                                 INNER JOIN sahs_lm ON cp_package.obj_id = sahs_lm.id   1156                                                 WHERE usr_data.usr_id = %s  1157                                                 AND sahs_lm.id = %s';
  1162             $result[
'data'][$k] = array();
  1164                 $types = array(
'integer', 
'integer');
  1165                 $values = array($userId, $packageId);
  1168                 while ($row = 
$ilDB->fetchAssoc(
$res)) {
  1169                     $tmp_result = array();
  1170                     foreach ($row as 
$key => $value) {
  1171                         if ($k === 
"comment" && 
$key === 
"c_timestamp" && strpos((
string) $value, 
' ') == 10) {
  1172                             $value = str_replace(
' ', 
'T', $value);
  1174                         $tmp_result[] = $value;
  1175                         if ($k === 
"node" && 
$key === 
"additional_tables" && $i_check < $value) {
  1180                     $result[
'data'][$k][] = $tmp_result;
  1193         $ilDB = $DIC->database();
  1195         if (!is_array($a_array) or !count($a_array)) {
  1199         foreach ($a_array as $k => $item) {
  1200             if ($item != null) {
  1201                 $a_array[$k] = 
$ilDB->quote($item);
  1203                 $a_array[$k] = 
"NULL";
  1236         $ilDB = $DIC->database();
  1239             'SELECT module_version FROM sahs_lm WHERE id = %s',
  1241             array($this->packageId)
  1245         return (
int) $row[
'module_version'];
  1254         $ilDB = $DIC->database();
  1255         $ilUser = $DIC->user();
  1256         $val_set = 
$ilDB->queryF(
  1257             'SELECT package_attempts FROM sahs_user WHERE obj_id = %s AND user_id = %s',
  1258             array(
'integer',
'integer'),
  1259             array($this->packageId,$this->userId)
  1261         $val_rec = 
$ilDB->fetchAssoc($val_set);
  1262         $attempts = $val_rec[
"package_attempts"];
  1263         if ($attempts == null) {
  1266         return (
int) $attempts;
  1275         $ilDB = $DIC->database();
  1276         $ilUser = $DIC->user();
  1278             'SELECT package_attempts,count(*) cnt FROM sahs_user WHERE obj_id = %s AND user_id = %s GROUP BY package_attempts',
  1279             array(
'integer',
'integer'),
  1280             array($this->slm->getId(),$ilUser->getId())
  1283         if ($val_rec[
"cnt"] == 0) { 
  1286                 'INSERT INTO sahs_user (obj_id,user_id,package_attempts,module_version,last_access) VALUES(%s,%s,%s,%s,%s)',
  1287                 array(
'integer', 
'integer', 
'integer', 
'integer', 
'timestamp'),
  1288                 array($this->slm->getId(), $ilUser->getId(), $attempts, $this->slm->getModuleVersion(), date(
'Y-m-d H:i:s'))
  1291             $attempts = $val_rec[
"package_attempts"];
  1292             if ($attempts == null) {
  1297                 'UPDATE sahs_user SET package_attempts = %s, module_version = %s, last_access=%s WHERE obj_id = %s AND user_id = %s ',
  1298                 array(
'integer', 
'integer', 
'timestamp', 
'integer', 
'integer'),
  1299                 array($attempts, $this->slm->getModuleVersion(), date(
'Y-m-d H:i:s'), $this->slm->getId(), $ilUser->getId())
  1307         $ilDB = $DIC->database();
  1310             'SELECT shared_data_global_to_system FROM cp_package WHERE obj_id = %s',
  1312             array($this->packageId)
  1315         $shared_global_to_sys = 
$ilDB->fetchObject(
$res)->shared_data_global_to_system;
  1318             'SELECT data FROM cp_suspend WHERE obj_id = %s AND user_id = %s',
  1319             array(
'integer', 
'integer'),
  1320             array($this->packageId, $this->userId)
  1325             $dat = 
$data[
'data'];
  1326             if ($dat != null && $dat != 
'') {
  1331         if ($shared_global_to_sys == 0 && !$suspended) {
  1333                 'DELETE FROM adl_shared_data WHERE slm_id = %s AND user_id = %s',
  1334                 array(
'integer', 
'integer'),
  1335                 array($this->packageId, $this->userId)
  1347         $ilDB = $DIC->database();
  1350         $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," .
  1351                      "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";
  1356                                           SELECT ' . $fieldList . 
'  1357                                           FROM cmi_node,cp_node,cp_item  1358                                           WHERE cp_node.slm_id = %s  1359                                           AND cp_node.cp_node_id = cp_item.cp_node_id  1361                                           AND cmi_node.cp_node_id = cp_item.cp_node_id  1362                                           AND cmi_node.user_id = %s',
  1363             array(
'integer',
'text',
'integer'),
  1364             array($this->packageId, $sco_id, $this->userId)
  1375             $fHandle = fopen(
$filename, 
'a') or die(
"can't open file");
  1376             fwrite($fHandle, 
"");
  1388         while (file_exists(
$filename . 
"_" . $adder . $suffix)) {
  1390             $adder = (string) $i;
  1392         $retname = 
$filename . 
"_" . $adder . $suffix;
  1394         if (!file_exists($retname)) {
  1396             $fHandle = fopen($retname, 
'a') or die(
"can't open file");
  1397             fwrite($fHandle, 
"");
  1406         $lng = $DIC->language();
  1412         if (!file_exists($path_csv)) {
  1414             $fHandle = fopen($path_csv, 
'a') or die(
"can't open file");
  1415             $string = 
'"CourseId";"ScoId";"ScoTitle";"Timestamp";"Action";"Key";"Value";"Return Value";"Errorcode";"Timespan";"ErrorDescription"' . 
"\n";
  1416             fwrite($fHandle, $string);
  1419         if (!file_exists($path_txt)) {
  1424             $fHandle2 = fopen($path_txt, 
'a') or die(
"can't open file");
  1426             $logtpl->setCurrentBlock(
'NewLog');
  1427             $logtpl->setVariable(
"COURSETITLE", $this->slm->getTitle());
  1428             $logtpl->setVariable(
"COURSEID", $this->packageId);
  1429             $logtpl->setVariable(
"TIMESTAMP", date(
"d.m.Y H:i", time()));
  1431             $logtpl->setVariable(
"error0", 
$lng->
txt(
"error0"));
  1432             $logtpl->setVariable(
"error101", 
$lng->
txt(
"error101"));
  1433             $logtpl->setVariable(
"error102", 
$lng->
txt(
"error102"));
  1434             $logtpl->setVariable(
"error103", 
$lng->
txt(
"error103"));
  1435             $logtpl->setVariable(
"error104", 
$lng->
txt(
"error104"));
  1436             $logtpl->setVariable(
"error111", 
$lng->
txt(
"error111"));
  1437             $logtpl->setVariable(
"error112", 
$lng->
txt(
"error112"));
  1438             $logtpl->setVariable(
"error113", 
$lng->
txt(
"error113"));
  1439             $logtpl->setVariable(
"error122", 
$lng->
txt(
"error122"));
  1440             $logtpl->setVariable(
"error123", 
$lng->
txt(
"error123"));
  1441             $logtpl->setVariable(
"error132", 
$lng->
txt(
"error132"));
  1442             $logtpl->setVariable(
"error133", 
$lng->
txt(
"error133"));
  1443             $logtpl->setVariable(
"error142", 
$lng->
txt(
"error142"));
  1444             $logtpl->setVariable(
"error143", 
$lng->
txt(
"error143"));
  1445             $logtpl->setVariable(
"error201", 
$lng->
txt(
"error201"));
  1446             $logtpl->setVariable(
"error301", 
$lng->
txt(
"error301"));
  1447             $logtpl->setVariable(
"error351", 
$lng->
txt(
"error351"));
  1448             $logtpl->setVariable(
"error391", 
$lng->
txt(
"error391"));
  1449             $logtpl->setVariable(
"error401", 
$lng->
txt(
"error401"));
  1450             $logtpl->setVariable(
"error402", 
$lng->
txt(
"error402"));
  1451             $logtpl->setVariable(
"error403", 
$lng->
txt(
"error403"));
  1452             $logtpl->setVariable(
"error404", 
$lng->
txt(
"error404"));
  1453             $logtpl->setVariable(
"error405", 
$lng->
txt(
"error405"));
  1454             $logtpl->setVariable(
"error406", 
$lng->
txt(
"error406"));
  1455             $logtpl->setVariable(
"error407", 
$lng->
txt(
"error407"));
  1456             $logtpl->setVariable(
"error408", 
$lng->
txt(
"error408"));
  1457             $logtpl->setVariable(
"SetValue", 
$lng->
txt(
"SetValue"));
  1458             $logtpl->setVariable(
"GetValue", 
$lng->
txt(
"GetValue"));
  1459             $logtpl->setVariable(
"Commit", 
$lng->
txt(
"Commit"));
  1460             $logtpl->setVariable(
"Initialize", 
$lng->
txt(
"Initialize"));
  1461             $logtpl->setVariable(
"Terminate", 
$lng->
txt(
"Terminate"));
  1462             $logtpl->setVariable(
"GetErrorString", 
$lng->
txt(
"GetErrorString"));
  1463             $logtpl->setVariable(
"GetLastError", 
$lng->
txt(
"GetLastError"));
  1464             $logtpl->setVariable(
"GetDiagnostic", 
$lng->
txt(
"GetDiagnostic"));
  1465             $logtpl->setVariable(
"cmi._version", 
$lng->
txt(
"cmi._version"));
  1466             $logtpl->setVariable(
"cmi.comments_from_learner._children", 
$lng->
txt(
"cmi.comments_from_learner._children"));
  1467             $logtpl->setVariable(
"cmi.comments_from_learner._count", 
$lng->
txt(
"cmi.comments_from_learner._count"));
  1468             $logtpl->setVariable(
"cmi.comments_from_learner.n.comment", 
$lng->
txt(
"cmi.comments_from_learner.n.comment"));
  1469             $logtpl->setVariable(
"cmi.comments_from_learner.n.location", 
$lng->
txt(
"cmi.comments_from_learner.n.location"));
  1470             $logtpl->setVariable(
"cmi.comments_from_learner.n.timestamp", 
$lng->
txt(
"cmi.comments_from_learner.n.timestamp"));
  1471             $logtpl->setVariable(
"cmi.comments_from_lms._children", 
$lng->
txt(
"cmi.comments_from_lms._children"));
  1472             $logtpl->setVariable(
"cmi.comments_from_lms._count", 
$lng->
txt(
"cmi.comments_from_lms._count"));
  1473             $logtpl->setVariable(
"cmi.comments_from_lms.n.comment", 
$lng->
txt(
"cmi.comments_from_lms.n.comment"));
  1474             $logtpl->setVariable(
"cmi.comments_from_lms.n.location", 
$lng->
txt(
"cmi.comments_from_lms.n.location"));
  1475             $logtpl->setVariable(
"cmi.comments_from_lms.n.timestamp", 
$lng->
txt(
"cmi.comments_from_lms.n.timestamp"));
  1476             $logtpl->setVariable(
"cmi.completion_status", 
$lng->
txt(
"cmi.completion_status"));
  1477             $logtpl->setVariable(
"cmi.completion_threshold", 
$lng->
txt(
"cmi.completion_threshold"));
  1478             $logtpl->setVariable(
"cmi.credit", 
$lng->
txt(
"cmi.credit"));
  1479             $logtpl->setVariable(
"cmi.entry", 
$lng->
txt(
"cmi.entry"));
  1480             $logtpl->setVariable(
"cmi.exit", 
$lng->
txt(
"cmi.exit"));
  1481             $logtpl->setVariable(
"cmi.interactions._children", 
$lng->
txt(
"cmi.interactions._children"));
  1482             $logtpl->setVariable(
"cmi.interactions._count", 
$lng->
txt(
"cmi.interactions._count"));
  1483             $logtpl->setVariable(
"cmi.interactions.n.id", 
$lng->
txt(
"cmi.interactions.n.id"));
  1484             $logtpl->setVariable(
"cmi.interactions.n.type", 
$lng->
txt(
"cmi.interactions.n.type"));
  1485             $logtpl->setVariable(
"cmi.interactions.n.objectives._count", 
$lng->
txt(
"cmi.interactions.n.objectives._count"));
  1486             $logtpl->setVariable(
"cmi.interactions.n.objectives.n.id", 
$lng->
txt(
"cmi.interactions.n.objectives.n.id"));
  1487             $logtpl->setVariable(
"cmi.interactions.n.timestamp", 
$lng->
txt(
"cmi.interactions.n.timestamp"));
  1488             $logtpl->setVariable(
"cmi.interactions.n.correct_responses._count", 
$lng->
txt(
"cmi.interactions.n.correct_responses._count"));
  1489             $logtpl->setVariable(
"cmi.interactions.n.correct_responses.n.pattern", 
$lng->
txt(
"cmi.interactions.n.correct_responses.n.pattern"));
  1490             $logtpl->setVariable(
"cmi.interactions.n.weighting", 
$lng->
txt(
"cmi.interactions.n.weighting"));
  1491             $logtpl->setVariable(
"cmi.interactions.n.learner_response", 
$lng->
txt(
"cmi.interactions.n.learner_response"));
  1492             $logtpl->setVariable(
"cmi.interactions.n.result", 
$lng->
txt(
"cmi.interactions.n.result"));
  1493             $logtpl->setVariable(
"cmi.interactions.n.latency", 
$lng->
txt(
"cmi.interactions.n.latency"));
  1494             $logtpl->setVariable(
"cmi.interactions.n.description", 
$lng->
txt(
"cmi.interactions.n.description"));
  1495             $logtpl->setVariable(
"cmi.launch_data", 
$lng->
txt(
"cmi.launch_data"));
  1496             $logtpl->setVariable(
"cmi.learner_id", 
$lng->
txt(
"cmi.learner_id"));
  1497             $logtpl->setVariable(
"cmi.learner_name", 
$lng->
txt(
"cmi.learner_name"));
  1498             $logtpl->setVariable(
"cmi.learner_preference._children", 
$lng->
txt(
"cmi.learner_preference._children"));
  1499             $logtpl->setVariable(
"cmi.learner_preference.audio_level", 
$lng->
txt(
"cmi.learner_preference.audio_level"));
  1500             $logtpl->setVariable(
"cmi.learner_preference.language", 
$lng->
txt(
"cmi.learner_preference.language"));
  1501             $logtpl->setVariable(
"cmi.learner_preference.delivery_speed", 
$lng->
txt(
"cmi.learner_preference.delivery_speed"));
  1502             $logtpl->setVariable(
"cmi.learner_preference.audio_captioning", 
$lng->
txt(
"cmi.learner_preference.audio_captioning"));
  1503             $logtpl->setVariable(
"cmi.location", 
$lng->
txt(
"cmi.location"));
  1504             $logtpl->setVariable(
"cmi.max_time_allowed", 
$lng->
txt(
"cmi.max_time_allowed"));
  1505             $logtpl->setVariable(
"cmi.mode", 
$lng->
txt(
"cmi.mode"));
  1506             $logtpl->setVariable(
"cmi.objectives._children", 
$lng->
txt(
"cmi.objectives._children"));
  1507             $logtpl->setVariable(
"cmi.objectives._count", 
$lng->
txt(
"cmi.objectives._count"));
  1508             $logtpl->setVariable(
"cmi.objectives.n.id", 
$lng->
txt(
"cmi.objectives.n.id"));
  1509             $logtpl->setVariable(
"cmi.objectives.n.score._children", 
$lng->
txt(
"cmi.objectives.n.score._children"));
  1510             $logtpl->setVariable(
"cmi.objectives.n.score.scaled", 
$lng->
txt(
"cmi.objectives.n.score.scaled"));
  1511             $logtpl->setVariable(
"cmi.objectives.n.score.raw", 
$lng->
txt(
"cmi.objectives.n.score.raw"));
  1512             $logtpl->setVariable(
"cmi.objectives.n.score.min", 
$lng->
txt(
"cmi.objectives.n.score.min"));
  1513             $logtpl->setVariable(
"cmi.objectives.n.score.max", 
$lng->
txt(
"cmi.objectives.n.score.max"));
  1514             $logtpl->setVariable(
"cmi.objectives.n.success_status", 
$lng->
txt(
"cmi.objectives.n.success_status"));
  1515             $logtpl->setVariable(
"cmi.objectives.n.completion_status", 
$lng->
txt(
"cmi.objectives.n.completion_status"));
  1516             $logtpl->setVariable(
"cmi.objectives.n.progress_measure", 
$lng->
txt(
"cmi.objectives.n.progress_measure"));
  1517             $logtpl->setVariable(
"cmi.objectives.n.description", 
$lng->
txt(
"cmi.objectives.n.description"));
  1518             $logtpl->setVariable(
"cmi.progress_measure", 
$lng->
txt(
"cmi.progress_measure"));
  1519             $logtpl->setVariable(
"cmi.scaled_passing_score", 
$lng->
txt(
"cmi.scaled_passing_score"));
  1520             $logtpl->setVariable(
"cmi.score._children", 
$lng->
txt(
"cmi.score._children"));
  1521             $logtpl->setVariable(
"cmi.score.scaled", 
$lng->
txt(
"cmi.score.scaled"));
  1522             $logtpl->setVariable(
"cmi.score.raw", 
$lng->
txt(
"cmi.score.raw"));
  1523             $logtpl->setVariable(
"cmi.score.min", 
$lng->
txt(
"cmi.score.min"));
  1524             $logtpl->setVariable(
"cmi.score.max", 
$lng->
txt(
"cmi.score.max"));
  1525             $logtpl->setVariable(
"cmi.session_time", 
$lng->
txt(
"cmi.session_time"));
  1526             $logtpl->setVariable(
"cmi.success_status", 
$lng->
txt(
"cmi.success_status"));
  1527             $logtpl->setVariable(
"cmi.suspend_data", 
$lng->
txt(
"cmi.suspend_data"));
  1528             $logtpl->setVariable(
"cmi.time_limit_action", 
$lng->
txt(
"cmi.time_limit_action"));
  1529             $logtpl->setVariable(
"cmi.total_time", 
$lng->
txt(
"cmi.total_time"));
  1530             $logtpl->setVariable(
"adl.nav.request", 
$lng->
txt(
"adl.nav.request"));
  1531             $logtpl->setVariable(
"adl.nav.request_valid.continue", 
$lng->
txt(
"adl.nav.request_valid.continue"));
  1532             $logtpl->setVariable(
"adl.nav.request_valid.previous", 
$lng->
txt(
"adl.nav.request_valid.previous"));
  1533             $logtpl->setVariable(
"adl.nav.request_valid.choice", 
$lng->
txt(
"adl.nav.request_valid.choice"));
  1534             $logtpl->setVariable(
"i_green", 
$lng->
txt(
"i_green"));
  1535             $logtpl->setVariable(
"i_red", 
$lng->
txt(
"i_red"));
  1536             $logtpl->setVariable(
"i_orange", 
$lng->
txt(
"i_orange"));
  1537             $logtpl->setVariable(
"i_fuchsia", 
$lng->
txt(
"i_fuchsia"));
  1538             $logtpl->setVariable(
"i_gray", 
$lng->
txt(
"i_gray"));
  1539             $logtpl->setVariable(
"error", 
$lng->
txt(
"error"));
  1540             $logtpl->setVariable(
"strange_error", 
$lng->
txt(
"strange_error"));
  1541             $logtpl->setVariable(
"strange_API-Call", 
$lng->
txt(
"strange_API-Call"));
  1542             $logtpl->setVariable(
"unknown", 
$lng->
txt(
"unknown"));
  1543             $logtpl->setVariable(
"undefined_color", 
$lng->
txt(
"undefined_color"));
  1544             $logtpl->setVariable(
"description_for", 
$lng->
txt(
"description_for"));
  1545             $logtpl->setVariable(
"hide", 
$lng->
txt(
"hide"));
  1546             $logtpl->setVariable(
"all_API-calls_shown", 
$lng->
txt(
"all_API-calls_shown"));
  1547             $logtpl->setVariable(
"show_only_important_API-calls", 
$lng->
txt(
"show_only_important_API-calls"));
  1548             $logtpl->setVariable(
"only_important_API-Calls_shown", 
$lng->
txt(
"only_important_API-Calls_shown"));
  1549             $logtpl->setVariable(
"show_all_API-calls", 
$lng->
txt(
"show_all_API-calls"));
  1550             $logtpl->setVariable(
"log_for", 
$lng->
txt(
"log_for"));
  1551             $logtpl->setVariable(
"started", 
$lng->
txt(
"started"));
  1552             $logtpl->setVariable(
"nr_session", 
$lng->
txt(
"nr_session"));
  1553             $logtpl->setVariable(
"id_learning_module", 
$lng->
txt(
"id_learning_module"));
  1554             if ($this->slm->getCheck_values() == 
false) {
  1555                 $logtpl->setVariable(
"CHECK_VALUES", 
$lng->
txt(
"sent_values_not_checked"));
  1557             $logtpl->parseCurrentBlock();
  1558             fwrite($fHandle2, $logtpl->get());
  1566         $webdir = str_replace(
"/ilias.php", 
"", 
$_SERVER[
"SCRIPT_NAME"]);
  1576         $logDir = $this->slm->getDataDirectory() . 
"/logs";
  1577         if (!file_exists($logDir)) {
  1589         header(
'Content-Type: text/html; charset=UTF-8');
  1601         header(
"Cache-Control: private");
  1602         header(
"Cache-Control: must-revalidate, post-check=0, pre-check=0");
  1604         header(
"Content-Description: File Transfer");
  1605         header(
"Content-Type: application/octet-stream");
  1606         header(
"Content-disposition: attachment; filename=$filename");
  1614     private function getLogFileList(
string $s_delete, 
string $s_download, 
string $s_open): array
  1617         foreach (
new DirectoryIterator($this->
logDirectory()) as $fileInfo) {
  1618             if ($fileInfo->isDot()) {
  1621             $item[
'filename'] = $fileInfo->getFilename();
  1622             $parts = pathinfo($item[
'filename']);
  1623             $fnameparts = preg_split(
'/_/', 
$parts[
'filename'], -1, PREG_SPLIT_NO_EMPTY);
  1624             $deleteUrl = 
' <a href=#' . 
" onclick=\"javascript:deleteFile('" . $item[
'filename'] . 
"');\">" . $s_delete . 
"</a>";
  1630             $urlDownload = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=downloadLog&ref_id=' . $this->ref_id . 
'&logFile=' . $fileInfo->getFilename();
  1631             $urlOpen = 
'ilias.php?baseClass=ilSAHSPresentationGUI' . 
'&cmd=openLog&ref_id=' . $this->ref_id . 
'&logFile=' . $fileInfo->getFilename();
  1632             $item[
'date'] = date(
'Y/m/d H:i:s', $fileInfo->getCTime());
  1633             if (
$parts[
'extension'] === 
"html") {
  1634                 $item[
'action'] = $deleteUrl . 
" <a href=" . $urlDownload . 
">" . $s_download . 
"</a> <a target=_new href=" . $urlOpen . 
">" . $s_open . 
"</a>";
  1636                 $item[
'action'] = $deleteUrl . 
" <a href=" . $urlDownload . 
">" . $s_download . 
"</a>";
  1638             if (
$parts[
'extension'] === 
"html" || 
$parts[
'extension'] === 
"csv") {
  1642         usort(
$data, 
"datecmp");
  1648         header(
'Content-Type: text/html; charset=UTF-8');
  1649         print file_get_contents($this->
logFileName() . 
".html");
  1655         $lng = $DIC->language();
  1668         $this->tpl = 
new ilGlobalTemplate(
"tpl.scorm2004.debug.html", 
false, 
false, 
"./Modules/Scorm2004");
  1669         $this->tpl->setVariable(
'CONSOLE', 
$lng->
txt(
"debugwindow_console"));
  1670         $this->tpl->setVariable(
'LOGS', 
$lng->
txt(
"debugwindow_logs"));
  1671         $this->tpl->setVariable(
'COMMENT', 
$lng->
txt(
"debugwindow_comment"));
  1672         $this->tpl->setVariable(
'COMMENT_ENTER', 
$lng->
txt(
"debugwindow_comment_enter"));
  1673         $this->tpl->setVariable(
'START_RECORDING', 
$lng->
txt(
"debugwindow_start_recording"));
  1674         $this->tpl->setVariable(
'STOP_RECORDING', 
$lng->
txt(
"debugwindow_stop_recording"));
  1675         $this->tpl->setVariable(
'DELETE_LOGFILE', 
$lng->
txt(
"debugwindow_delete_logfile"));
  1676         $this->tpl->setVariable(
'SUBMISSION_FAILED', 
$lng->
txt(
"debugwindow_submission_failed"));
  1677         $this->tpl->setVariable(
'SUBMIT', 
$lng->
txt(
"debugwindow_submit"));
  1678         $this->tpl->setVariable(
'CANCEL', 
$lng->
txt(
"debugwindow_cancel"));
  1679         $this->tpl->setVariable(
'FILENAME', 
$lng->
txt(
"debugwindow_filename"));
  1680         $this->tpl->setVariable(
'DATE', 
$lng->
txt(
"debugwindow_date"));
  1681         $this->tpl->setVariable(
'ACTION', 
$lng->
txt(
"debugwindow_action"));
  1682         $this->tpl->setVariable(
'RECORD_IMG', 
ilUtil::getImagePath(
"record.png", 
"./Modules/Scorm2004"));
  1684         $this->tpl->setVariable(
'COMMENT_IMG', 
ilUtil::getImagePath(
"comment.png", 
"./Modules/Scorm2004"));
  1686         $this->tpl->setVariable(
'LOGFILE', $this->
logFileName() . 
".html");
  1687         $this->tpl->setVariable(
'FILES_DATA', json_encode($this->
getLogFileList(
$lng->
txt(
"debugwindow_delete"), 
$lng->
txt(
"debugwindow_download"), 
$lng->
txt(
"debugwindow_open"))));
  1690         echo $this->tpl->get(
"DEFAULT", 
true);
  1695         return new ilTemplate(
"tpl.scorm2004.debugtxt.txt", 
true, 
true, 
"Modules/Scorm2004");
  1704         $ilDB = $DIC->database();
  1719         $debug_fields = parse_ini_file(
"./Modules/Scorm2004/scripts/rtemain/debug_default.ini", 
true);
  1722             $ini_array = $debug_fields[
'test_sco'];
  1724             $ini_array = $debug_fields[
'normal_sco'];
  1726         foreach ($ini_array as 
$key => $value) {
  1738         $lng = $DIC->language();
  1741         $logdata = json_decode(file_get_contents(
'php://input'));
  1745         $fh_txt = fopen(
$filename . 
".html", 
'a') or die(
"can't open txt file");
  1746         $fh_csv = fopen(
$filename . 
".csv", 
'a') or die(
"can't open csv file");
  1747         $fh_tmp = fopen($tmp_name, 
'r') or die(
"can't open tmp file");
  1750         if (filesize($tmp_name) > 0) {
  1751             $tmp_content = unserialize(fread($fh_tmp, filesize($tmp_name)));
  1753             $tmp_content = null;
  1760         if ($logdata->action != 
"SUMMARY") {
  1762             $fh_tmp2 = fopen($tmp_name, 
'w') or die(
"can't open tmp file");
  1765             $tmp_content[$logdata->scoid][$logdata->key][
'value'] = $logdata->value;
  1766             $tmp_content[$logdata->scoid][$logdata->key][
'status'] = $logdata->result;
  1767             $tmp_content[$logdata->scoid][$logdata->key][
'action'] = $logdata->action;
  1769             fwrite($fh_tmp2, serialize($tmp_content));
  1772             $errorcode = (
int) $logdata->errorcode;
  1773             $fixedFailure = 
false;
  1774             $toleratedFailure = 
false;
  1775             $extraErrorDescription = 
"";
  1776             if ($errorcode == 200000) {
  1778                 $toleratedFailure = 
true;
  1779                 $extraErrorDescription = 
"tolerated failure";
  1781             if ($errorcode > 99999) {
  1782                 $errorcode -= 100000;
  1783                 $fixedFailure = 
true;
  1784                 $extraErrorDescription = 
" failure corrected by ILIAS";
  1786             if (strpos($logdata->action, 
"ANALYZE") === 
false) {
  1787                 $errorDescriptions = array(
"0" => 
"",
  1788                                            "101" => 
"General Exeption",
  1789                                            "102" => 
"General Initialization Failure",
  1790                                            "103" => 
"Already Initialized",
  1791                                            "104" => 
"Content Instance Terminated",
  1792                                            "111" => 
"General Termination Failure",
  1793                                            "112" => 
"Termination Before Initialization",
  1794                                            "113" => 
"Termination After Termination",
  1795                                            "122" => 
"Retrieve Data Before Initialization",
  1796                                            "123" => 
"Retrieve Data After Termination",
  1797                                            "132" => 
"Store Data Before Initialization",
  1798                                            "133" => 
"Store Data After Termination",
  1799                                            "142" => 
"Commit Before Initialization",
  1800                                            "143" => 
"Commit After Termination",
  1801                                            "201" => 
"General Argument Error",
  1802                                            "301" => 
"General Get Failure",
  1803                                            "351" => 
"General Set Failure",
  1804                                            "391" => 
"General Commit Failure",
  1805                                            "401" => 
"Undefined Data Model Element",
  1806                                            "402" => 
"Unimplemented Data Model Element",
  1807                                            "403" => 
"Data Model Element Value Not Initialized",
  1808                                            "404" => 
"Data Model Element Is Read Only",
  1809                                            "405" => 
"Data Model Element Is Write Only",
  1810                                            "406" => 
"Data Model Element Type Mismatch",
  1811                                            "407" => 
"Data Model Element Value Out Of Range",
  1812                                            "408" => 
"Data Model Dependency Not Established"  1814                 $csv_string = $this->packageId . 
';"'  1815                     . $logdata->scoid . 
'";"'  1816                     . $logdata->scotitle . 
'";'  1817                     . date(
"d.m.Y H:i", time()) . 
';"'  1818                     . $logdata->action . 
'";"'  1819                     . $logdata->key . 
'";"'  1820                     . str_replace(
"\"", 
"\"\"", $logdata->value) . 
'";"'  1821                     . str_replace(
"\"", 
"\"\"", $logdata->result) . 
'";'  1823                     . $logdata->timespan . 
';"'  1824                     . $errorDescriptions[(string) $errorcode] . $extraErrorDescription . 
'"' . 
"\n";
  1825                 fwrite($fh_csv, $csv_string);
  1830         if ($logdata->action === 
"Commit" || $logdata->action === 
"Terminate") {
  1833             if (count($sql_data) != 0) {
  1834                 foreach ($sql_data as 
$key => $value) {
  1835                     $sql_string = $this->packageId . 
';"'  1836                         . $logdata->scoid . 
'";"'  1837                         . $logdata->scotitle . 
'";'  1840                         . str_replace(
"\"", 
"\"\"", (
string) $value) . 
'";;;;' . 
"\n";
  1841                     fwrite($fh_csv, $sql_string);
  1847         if ($logdata->action === 
"DELETE") {
  1859         $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');
  1861         switch ($logdata->action) {
  1863                 if ($logdata->result === 
"true" && $errorcode == 0) {
  1866                 if ($color === 
"green" && $logdata->key === 
"cmi.exit" && $logdata->value !== 
"suspend") {
  1869                 if ($fixedFailure == 
false && $errorcode != 406) {
  1870                     $logdata->value = 
'"' . $logdata->value . 
'"';
  1872                 if ($toleratedFailure == 
true) {
  1875                 if ($fixedFailure == 
true) {
  1880                 if ($errorcode == 0) {
  1885                 if ($errorcode == 0) {
  1887                     $logtpl->setCurrentBlock(
"InitializeStart");
  1888                     $logtpl->setVariable(
"SCO-title", 
$lng->
txt(
"SCO-title"));
  1889                     $logtpl->setVariable(
"SCO_TITLE", $logdata->scotitle);
  1890                     $logtpl->setVariable(
"SCO-name", 
$lng->
txt(
"SCO-name"));
  1891                     $logtpl->setVariable(
"SCO_NAME", $logdata->scoid);
  1892                     $logtpl->setVariable(
"started", 
$lng->
txt(
"started"));
  1893                     $logtpl->setVariable(
"TIMESTAMP", 
$timestamp);
  1894                     $logtpl->setVariable(
"milliseconds", 
$lng->
txt(
"milliseconds"));
  1895                     $logtpl->setVariable(
"API-call", 
$lng->
txt(
"API-call"));
  1896                     $logtpl->setVariable(
"return_value", 
$lng->
txt(
"return_value"));
  1897                     $logtpl->setVariable(
"error", 
$lng->
txt(
"error"));
  1898                     $logtpl->parseCurrentBlock();
  1902                 if ($errorcode == 0) {
  1905                 if ($fixedFailure == 
true) {
  1910                 if ($errorcode == 0) {
  1914             case 'GetErrorString':
  1916                 if ($errorcode == 0) {
  1920             case 'GetLastError':
  1921                 $logtpl->setCurrentBlock(
"GetLastError");
  1922                 $logtpl->setVariable(
"TIMESPAN", $logdata->timespan);
  1923                 $logtpl->setVariable(
"RESULT", $logdata->result);
  1924                 $logtpl->parseCurrentBlock();
  1926             case 'GetDiagnostic':
  1927                 $logtpl->setCurrentBlock(
"GetDiagnostic");
  1928                 $logtpl->setVariable(
"TIMESPAN", $logdata->timespan);
  1929                 $logtpl->setVariable(
"KEY", $logdata->key);
  1930                 $logtpl->setVariable(
"RESULT", $logdata->result);
  1931                 $logtpl->parseCurrentBlock();
  1934                 $logtpl->setCurrentBlock(
"INFO");
  1935                 $logtpl->setVariable(
"hint", 
$lng->
txt(
"hint"));
  1936                 $logtpl->setVariable(
"KEY", 
$lng->
txt($logdata->key));
  1937                 $logtpl->setVariable(
"VALUE", $logdata->value);
  1938                 $logtpl->parseCurrentBlock();
  1941                 $logtpl->setCurrentBlock(
"COMMENT");
  1942                 $logtpl->setVariable(
"comment", 
$lng->
txt(
"comment"));
  1943                 $logtpl->setVariable(
"generated", 
$lng->
txt(
"generated"));
  1944                 $logtpl->setVariable(
"TIMESTAMP", 
$timestamp);
  1945                 $logtpl->setVariable(
"VALUE", $logdata->value);
  1946                 $logtpl->parseCurrentBlock();
  1949                 $logtpl->setCurrentBlock(
"ANALYZE");
  1950                 if (count($logdata->value) == 0) {
  1952                     $logtpl->setVariable(
"ANALYZE_SUMMARY", 
$lng->
txt(
"no_missing_API-calls"));
  1953                     $logtpl->setVariable(
"VALUE", 
"");
  1955                     $tmpvalue = 
"SetValue(\"" . implode(
"\", ... ),<br/>SetValue(\"", $logdata->value) . 
"\", ... )";
  1956                     foreach ($ArGetValues as $value) {
  1957                         $tmpvalue = str_replace(
"SetValue(\"cmi." . $value . 
"\", ... )", 
"GetValue(\"cmi." . $value . 
"\")", $tmpvalue);
  1959                     $logtpl->setVariable(
"ANALYZE_SUMMARY", 
$lng->
txt(
"missing_API-calls"));
  1960                     $logtpl->setVariable(
"VALUE", $tmpvalue);
  1962                 $logtpl->setVariable(
"summary_for_SCO_without_test", 
$lng->
txt(
"summary_for_SCO_without_test"));
  1963                 $logtpl->setVariable(
"generated", 
$lng->
txt(
"generated"));
  1964                 $logtpl->setVariable(
"TIMESTAMP", 
$timestamp);
  1965                 $logtpl->setVariable(
"COLOR", $color);
  1966                 $logtpl->parseCurrentBlock();
  1969                 $logtpl->setCurrentBlock(
"ANALYZETEST");
  1970                 if (count($logdata->value) == 0) {
  1972                     $logtpl->setVariable(
"ANALYZE_SUMMARY", 
$lng->
txt(
"no_missing_API-calls"));
  1973                     $logtpl->setVariable(
"VALUE", 
"");
  1975                     $tmpvalue = 
"SetValue(\"" . implode(
"\", ... ),<br/>SetValue(\"", $logdata->value) . 
"\", ... )";
  1976                     foreach ($ArGetValues as $value) {
  1977                         $tmpvalue = str_replace(
"SetValue(\"cmi." . $value . 
"\", ... )", 
"GetValue(\"cmi." . $value . 
"\")", $tmpvalue);
  1979                     $logtpl->setVariable(
"ANALYZE_SUMMARY", 
$lng->
txt(
"missing_API-calls"));
  1980                     $logtpl->setVariable(
"VALUE", $tmpvalue);
  1982                 $logtpl->setVariable(
"summary_for_SCO_with_test", 
$lng->
txt(
"summary_for_SCO_with_test"));
  1983                 $logtpl->setVariable(
"generated", 
$lng->
txt(
"generated"));
  1984                 $logtpl->setVariable(
"TIMESTAMP", 
$timestamp);
  1985                 $logtpl->setVariable(
"COLOR", $color);
  1986                 $logtpl->parseCurrentBlock();
  1989                 $logtpl->setCurrentBlock(
"SUMMARY");
  1990                 $logtpl->setVariable(
"summary_csv", 
$lng->
txt(
"summary_csv"));
  1991                 $logtpl->setVariable(
"TIMESTAMP", 
$timestamp);
  1992                 $logtpl->setVariable(
"summary_download", 
$lng->
txt(
"summary_download"));
  1993                 $logtpl->parseCurrentBlock();
  2000         if ($logdata->action === 
'SetValue' || $logdata->action === 
'GetValue') {
  2001             $logtpl->setCurrentBlock($logdata->action);
  2002             $logtpl->setVariable(
"ACTION", $logdata->action);
  2003             $logtpl->setVariable(
"TIMESPAN", $logdata->timespan);
  2004             $logtpl->setVariable(
"KEY", $logdata->key);
  2005             $logtpl->setVariable(
"VALUE", $logdata->value);
  2006             $logtpl->setVariable(
"RESULT", $logdata->result);
  2007             $logtpl->setVariable(
"ERRORCODE", $errorcode);
  2010             foreach ($debugfields as $value) {
  2011                 if ($logdata->key == $value) {
  2015             $logtpl->setVariable(
"IMPORTANTKEY", 
"" . $importantkey);
  2016             $logtpl->setVariable(
"COLOR", $color);
  2017             $logtpl->parseCurrentBlock();
  2018         } elseif ($logdata->action !== 
'INFO' && $logdata->action !== 
'ANALYZE' && $logdata->action !== 
'ANALYZETEST' && $logdata->action !== 
'SUMMARY' && $logdata->action !== 
'COMMENT' && $logdata->action !== 
'GetDiagnostic' && $logdata->action !== 
'GetLastError') {
  2019             $logtpl->setCurrentBlock(
"defaultCall");
  2020             $logtpl->setVariable(
"ACTION", $logdata->action);
  2021             $logtpl->setVariable(
"TIMESPAN", $logdata->timespan);
  2022             $logtpl->setVariable(
"KEY", $logdata->key);
  2023             $logtpl->setVariable(
"VALUE", $logdata->value);
  2024             $logtpl->setVariable(
"RESULT", $logdata->result);
  2025             $logtpl->setVariable(
"ERRORCODE", $errorcode);
  2026             $logtpl->setVariable(
"IMPORTANTKEY", 
"" . $importantkey);
  2027             $logtpl->setVariable(
"COLOR", $color);
  2028             $logtpl->parseCurrentBlock();
  2041         if ($logdata->action === 
"SUMMARY") {
  2045         fwrite($fh_txt, $logtpl->get());
  2052         foreach ($data as $i => $value) {
  2054             $element[
'title'] = $value[
'title'];
  2055             $element[
'id'] = $value[
'id'];
  2056             if ($value[
'sco'] == 1) {
  2057                 $element[
'sco'] = 
"sco";
  2059                 $element[
'sco'] = 
"asset";
  2061             if ($value[
'href'] != null) {
  2062                 $this->flat_structure[] = $element;
  2064             if (isset($value[
'item']) && $value[
'item'] != null) {
  2073         $ilDB = $DIC->database();
  2077         $columns_fixed = array(
'id',
'title',
'type',
'attempted');
  2079         $ini_data = parse_ini_file(
"./Modules/Scorm2004/scripts/rtemain/debug_default.ini", 
true);
  2080         $ini_array = $ini_data[
'summary'];
  2081         $colums_variable = array();
  2082         $api_keys = array();
  2084         foreach ($ini_array as 
$key => $value) {
  2086                 $colums_variable[] = 
$key;
  2088                 $colums_variable[] = 
"Status";
  2092         $header_array = array_merge($columns_fixed, $colums_variable);
  2094         $csv_header = implode(
";", $header_array);
  2098             'SELECT jsdata FROM cp_package WHERE obj_id = %s',
  2100             array($this->packageId)
  2105         $structure = json_decode($packageData[
'jsdata'], 
true);
  2108         $this->flat_structure = array();  
  2112             foreach ($this->flat_structure as $tree_element) {
  2113                 $csv_data = $csv_data . $tree_element[
'id'] . 
";" . $tree_element[
'title'] . 
";" . $tree_element[
'sco'] . 
";";
  2114                 if (isset($api_data[$tree_element[
'id']])) {
  2115                     $csv_data = $csv_data . 
"X" . 
";";
  2117                     $csv_data = $csv_data . 
";";
  2121                 $id = $tree_element[
'id'];
  2122                 foreach ($api_keys as $api_element) {
  2123                     if (isset($api_data[
$id])) {
  2124                         if (isset($api_data[$id][$api_element])) {
  2125                             $csv_data = $csv_data . $api_data[
$id][$api_element][
'value'] . 
";" . $api_data[
$id][$api_element][
'status'] . 
";";
  2127                             $csv_data = $csv_data . 
";;";
  2131                 $csv_data = $csv_data . 
"\n";
  2135         fwrite($fh, $csv_header . 
"\n" . $csv_data);
  2158     if (strtotime($a[
'date']) == strtotime($b[
'date'])) {
  2161     return (strtotime($a[
'date']) < strtotime($b[
'date'])) ? 1 : -1;
 
static persistCMIData(int $packageId, int $refId, string $defaultLessonMode, bool $comments, bool $interactions, bool $objectives, bool $time_from_lms, ?string $data=null, ?int $userId=null)
 
static getCookieMaxLifetimeInSeconds()
 
static getLogger(string $a_component_id)
Get component logger. 
 
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
 
get_actual_attempts()
Get number of actual attempts for the user. 
 
special template class to simplify handling of ITX/PEAR 
 
get_Module_Version()
estimate content type for a filename by extension first do it for common static web files from extern...
 
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
 
static getLocalPath(string $a_name="")
Get local path of a YUI js file. 
 
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
 
readSharedData(int $sco_node_id)
 
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
 
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory) 
 
executeCommand()
execute command 
 
writeSharedData(int $sco_node_id)
 
loadLanguageModule(string $a_module)
Load language module. 
 
datecmp(array $a, array $b)
 
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user 
 
getLogFileList(string $s_delete, string $s_download, string $s_open)
 
ilObjSCORM2004LearningModule $slm
 
static scormPlayerUnload(int $packageId, int $refId, bool $time_from_lms, ?int $userId=null)
 
quoteJSONArray(?array $a_array)
 
if(!file_exists(getcwd() . '/ilias.ini.php'))
 
static signFolderOfStartFile(string $start_file_path)
 
increase_attemptAndsave_module_version()
Increases attempts by one and saves module_version for this package. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static _lookupObjectId(int $ref_id)
 
$structure
TOTAL STRUCTURE. 
 
static getStatus(int $a_packageId, int $a_user_id, bool $auto_last_visited, string $scormType="1.2")
 
foreach($mandatory_scripts as $file) $timestamp
 
getCMIData(int $userId, int $packageId)
maps API data structure type to internal datatype on a node and accepts only valid values...
 
createSummary(array $api_data)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples 
 
static getIdleValue(bool $fixedMode=false)
Returns the idle time in seconds. 
 
getDebugValues(?bool $test_sco=false)
 
static getLocaljQueryPath()
 
getStructureFlat(array $data)
 
getNodeData(string $sco_id)
 
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...