40        $this->ctrl->saveParameter($this, 
"ref_id");
 
   50        $ilAccess = 
$DIC[
'ilAccess'];
 
   51        $ilNavigationHistory = 
$DIC[
'ilNavigationHistory'];
 
   53        $ilLocator = 
$DIC[
'ilLocator'];
 
   54        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
   56        include_once 
"./Services/Object/classes/class.ilObjectGUI.php";
 
   57        include_once 
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
 
   59        $lng->loadLanguageModule(
"content");
 
   63        if ($ilAccess->checkAccess(
"read", 
"", 
$_GET[
"ref_id"])) {
 
   64            include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
 
   68                $ilNavigationHistory->addItem(
 
   70                    "ilias.php?cmd=infoScreen&baseClass=ilSAHSPresentationGUI&ref_id=" . 
$_GET[
"ref_id"],
 
   76        $next_class = $this->ctrl->getNextClass($this);
 
   77        $cmd = $this->ctrl->getCmd();
 
   81        if ($cmd == 
"downloadCertificate") {
 
   82            require_once 
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
 
   84            $ret = $this->ctrl->forwardCommand($scorm_gui);
 
   87        if (substr($cmd, 0, 11) == 
"offlineMode" || $this->offline_mode) {
 
   88            $next_class = 
"ilscormofflinemodegui";
 
   91        include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
 
   94        if ($next_class != 
"ilinfoscreengui" &&
 
   95            $cmd != 
"infoScreen" &&
 
   96            $next_class != 
"ilobjscorm2004learningmodulegui" &&
 
   97            $next_class != 
"ilobjscormlearningmodulegui" &&
 
   98            $next_class != 
"ilscormofflinemodegui" &&
 
   99            $next_class != 
"illearningprogressgui") {
 
  102                    $this->ctrl->setCmdClass(
"ilscorm13player");
 
  107                    $this->ctrl->setCmdClass(
"ilscormpresentationgui");
 
  111            $next_class = $this->ctrl->getNextClass($this);
 
  114        switch ($next_class) {
 
  115            case "ilinfoscreengui":
 
  119            case "ilscorm13player":
 
  120                require_once 
"./Modules/Scorm2004/classes/ilSCORM13Player.php";
 
  122                $ret = $this->ctrl->forwardCommand($scorm_gui);
 
  125            case "ilscormpresentationgui":
 
  126                require_once 
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
 
  128                $ret = $this->ctrl->forwardCommand($scorm_gui);
 
  132            case "illearningprogressgui":
 
  134                include_once 
"./Services/Tracking/classes/class.ilLearningProgressGUI.php";
 
  136                $this->ctrl->forwardCommand($new_gui);
 
  140            case "ilscormofflinemodegui":
 
  141                include_once 
"./Modules/ScormAicc/classes/class.ilSCORMOfflineModeGUI.php";
 
  143                $this->ctrl->forwardCommand($new_gui);
 
  146            case "ilobjscorm2004learningmodulegui":
 
  147                include_once 
'./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModuleGUI.php';
 
  149                $this->ctrl->forwardCommand($new_gui);
 
  154            case "ilobjscormlearningmodulegui":
 
  155                include_once 
'./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php';
 
  157                $this->ctrl->forwardCommand($new_gui);
 
  171        if (!is_array($a_attributes)) {
 
  174        foreach ($a_attributes as $attribute) {
 
  175            $attr[$attribute->name()] = $attribute->value();
 
  188        $this->tpl = 
new ilTemplate(
"tpl.sahs_pres_frameset.html", 
false, 
false, 
"Modules/ScormAicc");
 
  189        $this->tpl->setVariable(
"REF_ID", $this->slm->getRefId());
 
  190        $this->tpl->show(
"DEFAULT", 
false);
 
  198    public function explorer($a_target = 
"sahs_content")
 
  203        $ilBench->start(
"SAHSExplorer", 
"initExplorer");
 
  205        $this->tpl = 
new ilTemplate(
"tpl.sahs_exp_main.html", 
true, 
true, 
"Modules/ScormAicc");
 
  207        require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
 
  208        $exp = 
new ilSCORMExplorer(
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=" . $this->slm->getRefId(), $this->slm);
 
  209        $exp->setTargetGet(
"obj_id");
 
  210        $exp->setFrameTarget($a_target);
 
  214        if (
$_GET[
"scexpand"] == 
"") {
 
  216            $expanded = $mtree->readRootId();
 
  218            $expanded = 
$_GET[
"scexpand"];
 
  220        $exp->setExpand($expanded);
 
  222        $exp->forceExpandAll(
true, 
false);
 
  226        $ilBench->stop(
"SAHSExplorer", 
"initExplorer");
 
  229        $ilBench->start(
"SAHSExplorer", 
"setOutput");
 
  231        $ilBench->stop(
"SAHSExplorer", 
"setOutput");
 
  233        $ilBench->start(
"SAHSExplorer", 
"getOutput");
 
  235        $ilBench->stop(
"SAHSExplorer", 
"getOutput");
 
  238        $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.sahs_explorer.html", 
"Modules/ScormAicc");
 
  240        $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
 
  241        $this->tpl->setVariable(
"EXPLORER", 
$output);
 
  242        $this->tpl->setVariable(
"ACTION", 
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=" . 
$_GET[
"cmd"] . 
"&frame=" . 
$_GET[
"frame"] .
 
  243            "&ref_id=" . $this->slm->getRefId() . 
"&scexpand=" . 
$_GET[
"scexpand"]);
 
  244        $this->tpl->parseCurrentBlock();
 
  253        if (is_object($sc_gui_object)) {
 
  254            $sc_gui_object->view();
 
  268        $this->tpl = 
new ilTemplate(
"tpl.sahs_api.html", 
true, 
true, 
"Modules/ScormAicc");
 
  269        $this->tpl->setVariable(
"USER_ID", 
$ilias->account->getId());
 
  270        $this->tpl->setVariable(
"USER_FIRSTNAME", 
$ilias->account->getFirstname());
 
  271        $this->tpl->setVariable(
"USER_LASTNAME", 
$ilias->account->getLastname());
 
  272        $this->tpl->setVariable(
"REF_ID", 
$_GET[
"ref_id"]);
 
  273        $this->tpl->setVariable(
"SESSION_ID", session_id());
 
  275        $this->tpl->setVariable(
"CODE_BASE", 
"http://" . 
$_SERVER[
'SERVER_NAME'] . substr(
$_SERVER[
'PHP_SELF'], 0, strpos(
$_SERVER[
'PHP_SELF'], 
"/ilias.php")));
 
  276        $this->tpl->parseCurrentBlock();
 
  278        $this->tpl->show(
false);
 
  288        $sco_id = (
$_GET[
"sahs_id"] == 
"")
 
  291        $ref_id = (
$_GET[
"ref_id"] == 
"")
 
  297        include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
 
  298        include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
 
  301        $id_ref = $item->getIdentifierRef();
 
  303        $resource->readByIdRef($id_ref, $item->getSLMId());
 
  305        $href = $resource->getHref();
 
  306        $this->tpl = 
new ilTemplate(
"tpl.sahs_launch_cbt.html", 
true, 
true, 
"Modules/ScormAicc");
 
  307        $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output") . 
"/" . $href);
 
  310        $this->tpl->setVariable(
"LAUNCH_DATA", $item->getDataFromLms());
 
  311        $this->tpl->setVariable(
"MAST_SCORE", $item->getMasteryScore());
 
  312        $this->tpl->setVariable(
"MAX_TIME", $item->getMaxTimeAllowed());
 
  313        $this->tpl->setVariable(
"LIMIT_ACT", $item->getTimeLimitAction());
 
  316        if ($this->slm->getAPIAdapterName() != 
"API") {
 
  317            $this->tpl->setCurrentBlock(
"alt_api_ref");
 
  318            $this->tpl->setVariable(
"API_NAME", $this->slm->getAPIAdapterName());
 
  319            $this->tpl->parseCurrentBlock();
 
  322        $val_set = 
$ilDB->queryF(
 
  324                SELECT * FROM scorm_tracking  
  328            array(
'integer',
'integer',
'integer'),
 
  329            array(
$ilUser->getId(),$sco_id,$this->slm->getId())
 
  334        while ($val_rec = 
$ilDB->fetchAssoc($val_set)) {
 
  335            $val_rec[
"rvalue"] = str_replace(
"\r\n", 
"\n", $val_rec[
"rvalue"]);
 
  336            $val_rec[
"rvalue"] = str_replace(
"\r", 
"\n", $val_rec[
"rvalue"]);
 
  337            $val_rec[
"rvalue"] = str_replace(
"\n", 
"\\n", $val_rec[
"rvalue"]);
 
  338            $re_value[$val_rec[
"lvalue"]] = $val_rec[
"rvalue"];
 
  341        foreach ($re_value as $var => $value) {
 
  343                case "cmi.core.lesson_location":
 
  344                case "cmi.core.lesson_status":
 
  345                case "cmi.core.entry":
 
  346                case "cmi.core.score.raw":
 
  347                case "cmi.core.score.max":
 
  348                case "cmi.core.score.min":
 
  349                case "cmi.core.total_time":
 
  350                case "cmi.core.exit":
 
  351                case "cmi.suspend_data":
 
  353                case "cmi.student_preference.audio":
 
  354                case "cmi.student_preference.language":
 
  355                case "cmi.student_preference.speed":
 
  356                case "cmi.student_preference.text":
 
  360                case "cmi.objectives._count":
 
  362                    $this->
setArray(
"cmi.objectives", $value, 
"id", $re_value);
 
  363                    $this->
setArray(
"cmi.objectives", $value, 
"score.raw", $re_value);
 
  364                    $this->
setArray(
"cmi.objectives", $value, 
"score.max", $re_value);
 
  365                    $this->
setArray(
"cmi.objectives", $value, 
"score.min", $re_value);
 
  366                    $this->
setArray(
"cmi.objectives", $value, 
"status", $re_value);
 
  369                case "cmi.interactions._count":
 
  371                    $this->
setArray(
"cmi.interactions", $value, 
"id", $re_value);
 
  372                    for (
$i = 0; 
$i < $value; 
$i++) {
 
  373                        $var2 = 
"cmi.interactions." . 
$i . 
".objectives._count";
 
  374                        if (isset($v_array[$var2])) {
 
  375                            $cnt = $v_array[$var2];
 
  377                                "cmi.interactions." . 
$i . 
".objectives",
 
  393                    $this->
setArray(
"cmi.interactions", $value, 
"time", $re_value);
 
  394                    $this->
setArray(
"cmi.interactions", $value, 
"type", $re_value);
 
  395                    for (
$i = 0; 
$i < $value; 
$i++) {
 
  396                        $var2 = 
"cmi.interactions." . 
$i . 
".correct_responses._count";
 
  397                        if (isset($v_array[$var2])) {
 
  398                            $cnt = $v_array[$var2];
 
  400                                "cmi.interactions." . 
$i . 
".correct_responses",
 
  406                                "cmi.interactions." . 
$i . 
".correct_responses",
 
  413                    $this->
setArray(
"cmi.interactions", $value, 
"student_response", $re_value);
 
  414                    $this->
setArray(
"cmi.interactions", $value, 
"result", $re_value);
 
  415                    $this->
setArray(
"cmi.interactions", $value, 
"latency", $re_value);
 
  422        $this->tpl->setCurrentBlock(
"switch_icon");
 
  423        $this->tpl->setVariable(
"SCO_ID", 
$_GET[
"sahs_id"]);
 
  425        $this->tpl->setVariable(
 
  427            $lng->txt(
"cont_status") . 
": " 
  428            . 
$lng->txt(
"cont_sc_stat_running")
 
  430        $this->tpl->parseCurrentBlock();
 
  433        $lesson_mode = $this->slm->getDefaultLessonMode();
 
  434        if ($this->slm->getAutoReview()) {
 
  435            if ($re_value[
"cmi.core.lesson_status"] == 
"completed" ||
 
  436                $re_value[
"cmi.core.lesson_status"] == 
"passed" ||
 
  437                $re_value[
"cmi.core.lesson_status"] == 
"failed") {
 
  438                $lesson_mode = 
"review";
 
  441        $this->tpl->setVariable(
"LESSON_MODE", $lesson_mode);
 
  444        if ($lesson_mode == 
"normal") {
 
  445            $this->tpl->setVariable(
 
  447                str_replace(
"_", 
"-", $this->slm->getCreditMode())
 
  450            $this->tpl->setVariable(
"CREDIT_MODE", 
"no-credit");
 
  455        if (!isset($re_value[
"cmi.core.total_time"])) {
 
  456            $item->insertTrackData(
"cmi.core.total_time", 
"0000:00:00", $sahs_obj_id);
 
  458        if (!isset($re_value[
"cmi.core.lesson_status"])) {
 
  459            $item->insertTrackData(
"cmi.core.lesson_status", 
"not attempted", $sahs_obj_id);
 
  461        if (!isset($re_value[
"cmi.core.entry"])) {
 
  462            $item->insertTrackData(
"cmi.core.entry", 
"", $sahs_obj_id);
 
  472        $this->tpl = 
new ilTemplate(
"tpl.sahs_finish_cbt.html", 
true, 
true, 
"Modules/ScormAicc");
 
  475        $this->tpl->setCurrentBlock(
"switch_icon");
 
  476        $this->tpl->setVariable(
"SCO_ID", 
$_GET[
"sahs_id"]);
 
  477        $this->tpl->setVariable(
 
  480                "scorm/" . str_replace(
" ", 
"_", 
$_GET[
"status"]) . 
'.svg' 
  483        $this->tpl->setVariable(
 
  485            $lng->txt(
"cont_status") . 
": " 
  486            . 
$lng->txt(
"cont_sc_stat_" . str_replace(
" ", 
"_", 
$_GET[
"status"])) . 
", " 
  487            . 
$lng->txt(
"cont_total_time") . 
": " 
  490        $this->tpl->setVariable(
"SCO_LAUNCH_ID", 
$_GET[
"launch"]);
 
  491        $this->tpl->parseCurrentBlock();
 
  497        $this->tpl = 
new ilTemplate(
"tpl.sahs_unload_cbt.html", 
true, 
true, 
"Modules/ScormAicc");
 
  499        $this->tpl->setVariable(
"SCO_ID", 
$_GET[
"sahs_id"]);
 
  510        $sco_id = (
$_GET[
"asset_id"] == 
"")
 
  513        $ref_id = (
$_GET[
"ref_id"] == 
"")
 
  519        include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
 
  520        include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
 
  523        $id_ref = $item->getIdentifierRef();
 
  525        $resource->readByIdRef($id_ref, $item->getSLMId());
 
  526        $href = $resource->getHref();
 
  527        $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output") . 
"/" . $href);
 
  528        $this->tpl = 
new ilTemplate(
"tpl.scorm_launch_asset.html", 
true, 
true, 
"Modules/ScormAicc");
 
  529        $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output") . 
"/" . $href);
 
  539        $this->tpl->setCurrentBlock(
"set_value");
 
  540        $this->tpl->setVariable(
"VAR", $a_var);
 
  541        $this->tpl->setVariable(
"VALUE", $a_value);
 
  542        $this->tpl->parseCurrentBlock();
 
  548    public function setArray($a_left, $a_value, $a_name, &$v_array)
 
  550        for (
$i = 0; 
$i < $a_value; 
$i++) {
 
  551            $var = $a_left . 
"." . 
$i . 
"." . $a_name;
 
  552            if (isset($v_array[$var])) {
 
  553                $this->tpl->setCurrentBlock(
"set_value");
 
  554                $this->tpl->setVariable(
"VAR", $var);
 
  555                $this->tpl->setVariable(
"VALUE", $v_array[$var]);
 
  556                $this->tpl->parseCurrentBlock();
 
  568        $this->ctrl->setCmd(
"showSummary");
 
  569        $this->ctrl->setCmdClass(
"ilinfoscreengui");
 
  578            !
$DIC->access()->checkAccess(
'visible', 
'', (
int) 
$_GET[
"ref_id"]) &&
 
  579            !
$DIC->access()->checkAccess(
'read', 
'', (
int) 
$_GET[
"ref_id"])
 
  581            $DIC[
'ilErr']->raiseError($this->lng->txt(
'msg_no_perm_read'), 
$DIC[
'ilErr']->MESSAGE);
 
  586        include_once 
"Services/Tracking/classes/class.ilLearningProgressAccess.php";
 
  588            $DIC->tabs()->addTab(
 
  590                $this->lng->txt(
"info_short"),
 
  591                $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui", 
"showSummary")
 
  594            $DIC->tabs()->addTab(
 
  596                $this->lng->txt(
"learning_progress"),
 
  597                $this->ctrl->getLinkTargetByClass(
'illearningprogressgui', 
'')
 
  600        if (
$DIC->access()->checkAccess(
"edit_learning_progress", 
"", 
$_GET[
"ref_id"]) || 
$DIC->access()->checkAccess(
"read_learning_progress", 
"", 
$_GET[
"ref_id"])) {
 
  601            include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
 
  603            if ($privacy->enabledSahsProtocolData()) {
 
  604                include_once 
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
 
  607                if (
$type == 
"scorm2004") {
 
  608                    $DIC->tabs()->addTab(
 
  609                        "cont_tracking_data",
 
  610                        $this->lng->txt(
"cont_tracking_data"),
 
  611                        $this->ctrl->getLinkTargetByClass(
'ilobjscorm2004learningmodulegui', 
'showTrackingItems')
 
  613                } elseif (
$type == 
"scorm") {
 
  614                    $DIC->tabs()->addTab(
 
  615                        "cont_tracking_data",
 
  616                        $this->lng->txt(
"cont_tracking_data"),
 
  617                        $this->ctrl->getLinkTargetByClass(
'ilobjscormlearningmodulegui', 
'showTrackingItems')
 
  622        $DIC->tabs()->activateTab($a_active);
 
  623        $this->tpl->getStandardTemplate();
 
  624        $this->tpl->setTitle($this->slm_gui->object->getTitle());
 
  626        $DIC[
'ilLocator']->addRepositoryItems();
 
  627        $DIC[
'ilLocator']->addItem(
 
  628            $this->slm_gui->object->getTitle(),
 
  629            $this->ctrl->getLinkTarget($this, 
"infoScreen"),
 
  633        $this->tpl->setLocator();
 
  642        $ilAccess = 
$DIC[
'ilAccess'];
 
  660        $this->lng->loadLanguageModule(
"meta");
 
  662        include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
 
  665        $info->enablePrivateNotes();
 
  669        if ($ilAccess->checkAccess(
"write", 
"", 
$_GET[
"ref_id"])) {
 
  670            $info->enableNewsEditing();
 
  672            $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
 
  673            if ($enable_internal_rss) {
 
  674                $info->setBlockProperty(
"news", 
"settings", 
true);
 
  679        if ($ilAccess->checkAccess(
"read", 
"", 
$_GET[
"ref_id"])) {
 
  680            $ilToolbar = 
$GLOBALS[
'DIC']->toolbar();
 
  681            $ilToolbar->addButtonInstance($this->slm_gui->object->getViewButton());
 
  685        $info->addMetaDataSections(
 
  686            $this->slm_gui->object->getId(),
 
  688            $this->slm_gui->object->getType()
 
  700        $this->ctrl->forwardCommand(
$info);
 
An exception for terminatinating execution or to throw for unit testing.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
const LP_CONTEXT_REPOSITORY
Class ilObjUserTrackingGUI.
static _lookupEditable($a_obj_id)
Lookup editable.
static _lookupUserIsOfflineMode($a_obj_id)
Checks offlineMode and returns false if.
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, )
Class ilObjSCORMLearningModuleGUI.
Class ilObjSCORMLearningModuleGUI.
Class ilObjSCORMLearningModule.
static _lookupObjId($a_id)
static _lookupObjectId($a_ref_id)
lookup object id
static _getInstance()
Get instance of ilPrivacySettings.
Class ilSAHSPresentationGUI.
frameset()
output main menu
executeCommand()
execute command
attrib2arr(&$a_attributes)
explorer($a_target="sahs_content")
output table of content
setArray($a_left, $a_value, $a_name, &$v_array)
set single value
outputInfoScreen()
info screen
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
setSingleVariable($a_var, $a_value)
set single value
Explorer View for SCORM Learning Modules.
& getInstance($a_id)
get instance of specialized GUI class
GUI class ilSCORMOfflineModeGUI.
Class ilSCORMPresentationGUI.
special template class to simplify handling of ITX/PEAR
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
redirection script todo: (a better solution should control the processing via a xml file)
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']