35                 $this->ctrl->saveParameter($this, 
"ref_id");
 
   43                 global 
$lng,$ilAccess, $ilNavigationHistory, 
$ilCtrl, $ilLocator, $ilObjDataCache;
 
   45                 include_once 
"./Services/Object/classes/class.ilObjectGUI.php";
 
   46                 include_once 
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
 
   48                 $lng->loadLanguageModule(
"content");
 
   52                 if ($ilAccess->checkAccess(
"read", 
"", 
$_GET[
"ref_id"]))
 
   54                         include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
 
   57                                 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
 
   58                                         "ilias.php?cmd=infoScreen&baseClass=ilSAHSPresentationGUI&ref_id=".
$_GET[
"ref_id"], 
"lm");
 
   62                 include_once 
'Services/Payment/classes/class.ilPaymentObject.php';
 
   65                         $ilLocator->addRepositoryItems();
 
   66                         $ilLocator->addItem($ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId(
$_GET[
'ref_id'])), 
 
   67                                                                 'ilias.php?baseClass=ilSAHSPresentationGUI&ref_id='.
$_GET[
'ref_id'],
 
   71                         $this->tpl->setLocator();
 
   72                         $this->tpl->getStandardTemplate();
 
   74                         include_once 
'Services/Payment/classes/class.ilShopPurchaseGUI.php';    
 
   75                         $this->ctrl->setReturn($this, 
'');
 
   77                         $this->ctrl->forwardCommand($pp_gui);                   
 
   82                 $next_class = $this->ctrl->getNextClass($this);
 
   83                 $cmd = $this->ctrl->getCmd();
 
   87                 if (
$cmd == 
"downloadCertificate")
 
   89                         require_once 
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
 
   91                         $ret =& $this->ctrl->forwardCommand($scorm_gui);
 
   98                                 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
 
  103                                 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
 
  108                                 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php");
 
  113                                 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php");
 
  118                 if ($next_class != 
"ilinfoscreengui" &&
 
  119                         $cmd != 
"infoScreen" && 
 
  120                         $next_class != 
"illearningprogressgui")
 
  122                         include_once(
"./Services/License/classes/class.ilLicense.php");
 
  127                                         $this->ctrl->setCmdClass(
"ilscorm13player");
 
  132                                         $this->ctrl->setCmdClass(
"ilscormpresentationgui");
 
  137                                         $this->ctrl->setCmdClass(
"ilaiccpresentationgui");
 
  141                                         $this->ctrl->setCmdClass(
"ilhacppresentationgui");
 
  144                         $next_class = $this->ctrl->getNextClass($this);
 
  149                         case "ilinfoscreengui":
 
  153                         case "ilscorm13player":
 
  154                                 require_once 
"./Modules/Scorm2004/classes/ilSCORM13Player.php";
 
  157                                 $ret =& $this->ctrl->forwardCommand($scorm_gui);
 
  160                         case "ilscormpresentationgui":
 
  161                                 require_once 
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
 
  163                                 $ret =& $this->ctrl->forwardCommand($scorm_gui);
 
  166                         case "ilaiccpresentationgui":
 
  167                                 require_once 
"./Modules/ScormAicc/classes/AICC/class.ilAICCPresentationGUI.php";
 
  169                                 $ret =& $this->ctrl->forwardCommand($aicc_gui);
 
  172                         case "ilhacppresentationgui":
 
  173                                 require_once 
"./Modules/ScormAicc/classes/HACP/class.ilHACPPresentationGUI.php";
 
  175                                 $ret =& $this->ctrl->forwardCommand($hacp_gui);
 
  178                         case "illearningprogressgui":                                                           
 
  180                                 include_once 
"./Services/Tracking/classes/class.ilLearningProgressGUI.php";
 
  182                                 $this->ctrl->forwardCommand($new_gui);
 
  196                 if(!is_array($a_attributes))
 
  200                 foreach ($a_attributes as $attribute)
 
  202                         $attr[$attribute->name()] = $attribute->value();
 
  215                 $this->tpl = 
new ilTemplate(
"tpl.sahs_pres_frameset.html", 
false, 
false, 
"Modules/ScormAicc");
 
  216                 $this->tpl->setVariable(
"REF_ID",$this->slm->getRefId());
 
  217                 $this->tpl->show(
"DEFAULT", 
false);
 
  229                 $ilBench->start(
"SAHSExplorer", 
"initExplorer");
 
  231                 $this->tpl = 
new ilTemplate(
"tpl.sahs_exp_main.html", 
true, 
true, 
"Modules/ScormAicc");
 
  233                 require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
 
  234                 $exp = 
new ilSCORMExplorer(
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=".$this->slm->getRefId(), $this->slm);
 
  236                 $exp->setFrameTarget($a_target);
 
  240                 if (
$_GET[
"scexpand"] == 
"")
 
  247                         $expanded = 
$_GET[
"scexpand"];
 
  249                 $exp->setExpand($expanded);
 
  251                 $exp->forceExpandAll(
true, 
false);
 
  255                 $ilBench->stop(
"SAHSExplorer", 
"initExplorer");
 
  258                 $ilBench->start(
"SAHSExplorer", 
"setOutput");
 
  260                 $ilBench->stop(
"SAHSExplorer", 
"setOutput");
 
  262                 $ilBench->start(
"SAHSExplorer", 
"getOutput");
 
  263                 $output = $exp->getOutput();
 
  264                 $ilBench->stop(
"SAHSExplorer", 
"getOutput");
 
  267                 $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.sahs_explorer.html", 
"Modules/ScormAicc");
 
  269                 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
 
  270                 $this->tpl->setVariable(
"EXPLORER",$output);
 
  271                 $this->tpl->setVariable(
"ACTION", 
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=".
$_GET[
"cmd"].
"&frame=".
$_GET[
"frame"].
 
  272                         "&ref_id=".$this->slm->getRefId().
"&scexpand=".
$_GET[
"scexpand"]);
 
  273                 $this->tpl->parseCurrentBlock();
 
  282                 if(is_object($sc_gui_object))
 
  284                         $sc_gui_object->view();
 
  297                 $this->tpl = 
new ilTemplate(
"tpl.sahs_api.html", 
true, 
true, 
"Modules/ScormAicc");
 
  298                 $this->tpl->setVariable(
"USER_ID",$ilias->account->getId());
 
  299                 $this->tpl->setVariable(
"USER_FIRSTNAME",$ilias->account->getFirstname());
 
  300                 $this->tpl->setVariable(
"USER_LASTNAME",$ilias->account->getLastname());
 
  301                 $this->tpl->setVariable(
"REF_ID",
$_GET[
"ref_id"]);
 
  302                 $this->tpl->setVariable(
"SESSION_ID",session_id());
 
  304                 $this->tpl->setVariable(
"CODE_BASE", 
"http://".$_SERVER[
'SERVER_NAME'].substr($_SERVER[
'PHP_SELF'], 0, strpos ($_SERVER[
'PHP_SELF'], 
"/ilias.php")));
 
  305                 $this->tpl->parseCurrentBlock();
 
  307                 $this->tpl->show(
false);
 
  316                 $sco_id = (
$_GET[
"sahs_id"] == 
"")
 
  325                 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
 
  326                 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
 
  329                 $id_ref = $item->getIdentifierRef();
 
  331                 $resource->readByIdRef($id_ref, $item->getSLMId());
 
  333                 $href = $resource->getHref();
 
  334                 $this->tpl = 
new ilTemplate(
"tpl.sahs_launch_cbt.html", 
true, 
true, 
"Modules/ScormAicc");
 
  335                 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
 
  338                 $this->tpl->setVariable(
"LAUNCH_DATA", $item->getDataFromLms());
 
  339                 $this->tpl->setVariable(
"MAST_SCORE", $item->getMasteryScore());
 
  340                 $this->tpl->setVariable(
"MAX_TIME", $item->getMaxTimeAllowed());
 
  341                 $this->tpl->setVariable(
"LIMIT_ACT", $item->getTimeLimitAction());
 
  344                 if ($this->slm->getAPIAdapterName() != 
"API")
 
  346                         $this->tpl->setCurrentBlock(
"alt_api_ref");
 
  347                         $this->tpl->setVariable(
"API_NAME", $this->slm->getAPIAdapterName());
 
  348                         $this->tpl->parseCurrentBlock();
 
  352                 $val_set = $ilDB->queryF(
' 
  353                 SELECT * FROM scorm_tracking  
  357                 array(
'integer',
'integer',
'integer'),
 
  358                 array($ilUser->getId(),$sco_id,$this->slm->getId()));
 
  362                 while($val_rec = $ilDB->fetchAssoc($val_set))
 
  364                         $val_rec[
"rvalue"] = str_replace(
"\r\n", 
"\n", $val_rec[
"rvalue"]);
 
  365                         $val_rec[
"rvalue"] = str_replace(
"\r", 
"\n", $val_rec[
"rvalue"]);
 
  366                         $val_rec[
"rvalue"] = str_replace(
"\n", 
"\\n", $val_rec[
"rvalue"]);
 
  367                         $re_value[$val_rec[
"lvalue"]] = $val_rec[
"rvalue"];
 
  370                 foreach($re_value as $var => $value)
 
  374                                 case "cmi.core.lesson_location":
 
  375                                 case "cmi.core.lesson_status":
 
  376                                 case "cmi.core.entry":
 
  377                                 case "cmi.core.score.raw":
 
  378                                 case "cmi.core.score.max":
 
  379                                 case "cmi.core.score.min":
 
  380                                 case "cmi.core.total_time":
 
  381                                 case "cmi.core.exit":
 
  382                                 case "cmi.suspend_data":
 
  384                                 case "cmi.student_preference.audio":
 
  385                                 case "cmi.student_preference.language":
 
  386                                 case "cmi.student_preference.speed":
 
  387                                 case "cmi.student_preference.text":
 
  391                                 case "cmi.objectives._count":
 
  393                                         $this->
setArray(
"cmi.objectives", $value, 
"id", $re_value);
 
  394                                         $this->
setArray(
"cmi.objectives", $value, 
"score.raw", $re_value);
 
  395                                         $this->
setArray(
"cmi.objectives", $value, 
"score.max", $re_value);
 
  396                                         $this->
setArray(
"cmi.objectives", $value, 
"score.min", $re_value);
 
  397                                         $this->
setArray(
"cmi.objectives", $value, 
"status", $re_value);
 
  400                                 case "cmi.interactions._count":
 
  402                                         $this->
setArray(
"cmi.interactions", $value, 
"id", $re_value);
 
  403                                         for($i=0; $i<$value; $i++)
 
  405                                                 $var2 = 
"cmi.interactions.".$i.
".objectives._count";
 
  406                                                 if (isset($v_array[$var2]))
 
  408                                                         $cnt = $v_array[$var2];
 
  409                                                         $this->
setArray(
"cmi.interactions.".$i.
".objectives",
 
  410                                                                 $cnt, 
"id", $re_value);
 
  422                                         $this->
setArray(
"cmi.interactions", $value, 
"time", $re_value);
 
  423                                         $this->
setArray(
"cmi.interactions", $value, 
"type", $re_value);
 
  424                                         for($i=0; $i<$value; $i++)
 
  426                                                 $var2 = 
"cmi.interactions.".$i.
".correct_responses._count";
 
  427                                                 if (isset($v_array[$var2]))
 
  429                                                         $cnt = $v_array[$var2];
 
  430                                                         $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
 
  431                                                                 $cnt, 
"pattern", $re_value);
 
  432                                                         $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
 
  433                                                                 $cnt, 
"weighting", $re_value);
 
  436                                         $this->
setArray(
"cmi.interactions", $value, 
"student_response", $re_value);
 
  437                                         $this->
setArray(
"cmi.interactions", $value, 
"result", $re_value);
 
  438                                         $this->
setArray(
"cmi.interactions", $value, 
"latency", $re_value);
 
  444                 $this->tpl->setCurrentBlock(
"switch_icon");
 
  445                 $this->tpl->setVariable(
"SCO_ID", 
$_GET[
"sahs_id"]);
 
  447                 $this->tpl->setVariable(
"SCO_ALT",
 
  448                          $lng->txt(
"cont_status").
": " 
  449                         .$lng->txt(
"cont_sc_stat_running")
 
  451                 $this->tpl->parseCurrentBlock();
 
  454                 $lesson_mode = $this->slm->getDefaultLessonMode();
 
  455                 if ($this->slm->getAutoReview())
 
  457                         if ($re_value[
"cmi.core.lesson_status"] == 
"completed" ||
 
  458                                 $re_value[
"cmi.core.lesson_status"] == 
"passed" ||
 
  459                                 $re_value[
"cmi.core.lesson_status"] == 
"failed")
 
  461                                 $lesson_mode = 
"review";
 
  464                 $this->tpl->setVariable(
"LESSON_MODE", $lesson_mode);
 
  467                 if ($lesson_mode == 
"normal")
 
  469                         $this->tpl->setVariable(
"CREDIT_MODE",
 
  470                                 str_replace(
"_", 
"-", $this->slm->getCreditMode()));
 
  474                         $this->tpl->setVariable(
"CREDIT_MODE", 
"no-credit");
 
  479                 if (!isset($re_value[
"cmi.core.total_time"]))
 
  481                         $item->insertTrackData(
"cmi.core.total_time", 
"0000:00:00", $sahs_obj_id);
 
  483                 if (!isset($re_value[
"cmi.core.lesson_status"]))
 
  485                         $item->insertTrackData(
"cmi.core.lesson_status", 
"not attempted", $sahs_obj_id);
 
  487                 if (!isset($re_value[
"cmi.core.entry"]))
 
  489                         $item->insertTrackData(
"cmi.core.entry", 
"", $sahs_obj_id);
 
  498                 $this->tpl = 
new ilTemplate(
"tpl.sahs_finish_cbt.html", 
true, 
true, 
"Modules/ScormAicc");
 
  501                 $this->tpl->setCurrentBlock(
"switch_icon");
 
  502                 $this->tpl->setVariable(
"SCO_ID", 
$_GET[
"sahs_id"]);
 
  504                         "scorm/".str_replace(
" ", 
"_", 
$_GET[
"status"]).
'.png')
 
  506                 $this->tpl->setVariable(
"SCO_ALT",
 
  507                          $lng->txt(
"cont_status").
": " 
  508                         .$lng->txt(
"cont_sc_stat_".str_replace(
" ", 
"_", 
$_GET[
"status"])).
", " 
  509                         .$lng->txt(
"cont_total_time").  
": " 
  512                 $this->tpl->setVariable(
"SCO_LAUNCH_ID", 
$_GET[
"launch"]);
 
  513                 $this->tpl->parseCurrentBlock();
 
  519                 $this->tpl = 
new ilTemplate(
"tpl.sahs_unload_cbt.html", 
true, 
true, 
"Modules/ScormAicc");
 
  521                 $this->tpl->setVariable(
"SCO_ID", 
$_GET[
"sahs_id"]);
 
  530                 $sco_id = (
$_GET[
"asset_id"] == 
"")
 
  539                 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
 
  540                 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
 
  543                 $id_ref = $item->getIdentifierRef();
 
  545                 $resource->readByIdRef($id_ref, $item->getSLMId());
 
  546                 $href = $resource->getHref();
 
  547                 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
 
  548                 $this->tpl = 
new ilTemplate(
"tpl.scorm_launch_asset.html", 
true, 
true, 
"Modules/ScormAicc");
 
  549                 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
 
  559                 $this->tpl->setCurrentBlock(
"set_value");
 
  560                 $this->tpl->setVariable(
"VAR", $a_var);
 
  561                 $this->tpl->setVariable(
"VALUE", $a_value);
 
  562                 $this->tpl->parseCurrentBlock();
 
  568         function setArray($a_left, $a_value, $a_name, &$v_array)
 
  570                 for($i=0; $i<$a_value; $i++)
 
  572                         $var = $a_left.
".".$i.
".".$a_name;
 
  573                         if (isset($v_array[$var]))
 
  575                                 $this->tpl->setCurrentBlock(
"set_value");
 
  576                                 $this->tpl->setVariable(
"VAR", $var);
 
  577                                 $this->tpl->setVariable(
"VALUE", $v_array[$var]);
 
  578                                 $this->tpl->parseCurrentBlock();
 
  590                 $this->ctrl->setCmd(
"showSummary");
 
  591                 $this->ctrl->setCmdClass(
"ilinfoscreengui");
 
  597                 global $ilTabs, $ilLocator, $ilAccess;
 
  600                 include_once 
"Services/Tracking/classes/class.ilLearningProgressAccess.php";
 
  602                         (!$ilAccess->checkAccess(
"edit_learning_progress", 
"", 
$_GET[
"ref_id"]) ||
 
  603                         !$ilAccess->checkAccess(
"write", 
"", 
$_GET[
"ref_id"])))
 
  605                         $ilTabs->addTab(
"info_short", $this->lng->txt(
"info_short"), 
 
  606                                 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui", 
"showSummary"));
 
  608                         $ilTabs->addTab(
"learning_progress", $this->lng->txt(
"learning_progress"), 
 
  609                                 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui', 
'illplistofprogressgui'),
''));         
 
  611                         $ilTabs->activateTab($a_active);
 
  614                 $this->tpl->getStandardTemplate();
 
  615                 $this->tpl->setTitle($this->slm_gui->object->getTitle());
 
  617                 $ilLocator->addRepositoryItems();
 
  618                 $ilLocator->addItem($this->slm_gui->object->getTitle(),
 
  619                         $this->ctrl->getLinkTarget($this, 
"infoScreen"), 
"", 
$_GET[
"ref_id"]);
 
  620                 $this->tpl->setLocator();
 
  646                 $this->lng->loadLanguageModule(
"meta");
 
  648                 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
 
  651                 $info->enablePrivateNotes();
 
  655                 if ($ilAccess->checkAccess(
"write", 
"", 
$_GET[
"ref_id"]))
 
  657                         $info->enableNewsEditing();
 
  659                         $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
 
  660                         if ($enable_internal_rss)
 
  662                                 $info->setBlockProperty(
"news", 
"settings", 
true);
 
  667                 if ($ilAccess->checkAccess(
"read", 
"", 
$_GET[
"ref_id"]))
 
  669                         include_once 
'./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
 
  671                         $om = $sahs_obj->getOpenMode();
 
  672                         $width = $sahs_obj->getWidth();
 
  673                         $height = $sahs_obj->getHeight();
 
  676                                 $info->addButton($this->lng->txt(
"view"),
 
  677                                         "javascript:void(0); onclick=startSAHS('".$this->ctrl->getLinkTarget($this, 
"").
"','ilContObj".$this->slm_gui->object->getId().
"',".$om.
",".$width.
",".$height.
");",
 
  682                                 $info->addButton($this->lng->txt(
"view"),
 
  683                                         $this->ctrl->getLinkTarget($this, 
""),
 
  684                                         ' target="ilContObj'.$this->slm_gui->object->getId().
'" ');
 
  689                 $info->addMetaDataSections($this->slm_gui->object->getId(),0,
 
  690                         $this->slm_gui->object->getType());
 
  701                         $this->ctrl->forwardCommand($info);