36 $this->ctrl->saveParameter($this,
"ref_id");
44 global
$lng,$ilAccess, $ilNavigationHistory,
$ilCtrl, $ilLocator, $ilObjDataCache;
46 include_once
"./Services/Object/classes/class.ilObjectGUI.php";
47 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
49 $lng->loadLanguageModule(
"content");
53 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
55 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
60 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
61 "ilias.php?cmd=infoScreen&baseClass=ilSAHSPresentationGUI&ref_id=".
$_GET[
"ref_id"],
"lm");
65 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
68 $ilLocator->addRepositoryItems();
69 $ilLocator->addItem($ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId(
$_GET[
'ref_id'])),
70 'ilias.php?baseClass=ilSAHSPresentationGUI&ref_id='.
$_GET[
'ref_id'],
74 $this->tpl->setLocator();
75 $this->tpl->getStandardTemplate();
77 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
78 $this->ctrl->setReturn($this,
'');
80 $this->ctrl->forwardCommand($pp_gui);
85 $next_class = $this->ctrl->getNextClass($this);
86 $cmd = $this->ctrl->getCmd();
90 if (
$cmd ==
"downloadCertificate")
92 require_once
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
94 $ret =& $this->ctrl->forwardCommand($scorm_gui);
97 if (substr(
$cmd,0,11) ==
"offlineMode" || $this->offline_mode) $next_class =
"ilscormofflinemodegui";
103 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
108 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
113 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php");
118 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php");
123 if ($next_class !=
"ilinfoscreengui" &&
124 $cmd !=
"infoScreen" &&
125 $next_class !=
"ilobjscorm2004learningmodulegui" &&
126 $next_class !=
"ilobjscormlearningmodulegui" &&
127 $next_class !=
"ilscormofflinemodegui" &&
128 $next_class !=
"illearningprogressgui")
130 include_once(
"./Services/License/classes/class.ilLicense.php");
135 $this->ctrl->setCmdClass(
"ilscorm13player");
140 $this->ctrl->setCmdClass(
"ilscormpresentationgui");
145 $this->ctrl->setCmdClass(
"ilaiccpresentationgui");
149 $this->ctrl->setCmdClass(
"ilhacppresentationgui");
152 $next_class = $this->ctrl->getNextClass($this);
157 case "ilinfoscreengui":
161 case "ilscorm13player":
162 require_once
"./Modules/Scorm2004/classes/ilSCORM13Player.php";
164 $ret =& $this->ctrl->forwardCommand($scorm_gui);
167 case "ilscormpresentationgui":
168 require_once
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
170 $ret =& $this->ctrl->forwardCommand($scorm_gui);
173 case "ilaiccpresentationgui":
174 require_once
"./Modules/ScormAicc/classes/AICC/class.ilAICCPresentationGUI.php";
176 $ret =& $this->ctrl->forwardCommand($aicc_gui);
179 case "ilhacppresentationgui":
180 require_once
"./Modules/ScormAicc/classes/HACP/class.ilHACPPresentationGUI.php";
182 $ret =& $this->ctrl->forwardCommand($hacp_gui);
185 case "illearningprogressgui":
187 include_once
"./Services/Tracking/classes/class.ilLearningProgressGUI.php";
189 $this->ctrl->forwardCommand($new_gui);
193 case "ilscormofflinemodegui":
194 include_once
"./Modules/ScormAicc/classes/class.ilSCORMOfflineModeGUI.php";
196 $this->ctrl->forwardCommand($new_gui);
199 case "ilobjscorm2004learningmodulegui":
200 include_once
'./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModuleGUI.php';
202 $this->ctrl->forwardCommand($new_gui);
207 case "ilobjscormlearningmodulegui":
208 include_once
'./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php';
210 $this->ctrl->forwardCommand($new_gui);
224 if(!is_array($a_attributes))
228 foreach ($a_attributes as $attribute)
230 $attr[$attribute->name()] = $attribute->value();
243 $this->tpl =
new ilTemplate(
"tpl.sahs_pres_frameset.html",
false,
false,
"Modules/ScormAicc");
244 $this->tpl->setVariable(
"REF_ID",$this->slm->getRefId());
245 $this->tpl->show(
"DEFAULT",
false);
257 $ilBench->start(
"SAHSExplorer",
"initExplorer");
259 $this->tpl =
new ilTemplate(
"tpl.sahs_exp_main.html",
true,
true,
"Modules/ScormAicc");
261 require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
262 $exp =
new ilSCORMExplorer(
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=".$this->slm->getRefId(), $this->slm);
264 $exp->setFrameTarget($a_target);
268 if (
$_GET[
"scexpand"] ==
"")
275 $expanded =
$_GET[
"scexpand"];
277 $exp->setExpand($expanded);
279 $exp->forceExpandAll(
true,
false);
283 $ilBench->stop(
"SAHSExplorer",
"initExplorer");
286 $ilBench->start(
"SAHSExplorer",
"setOutput");
288 $ilBench->stop(
"SAHSExplorer",
"setOutput");
290 $ilBench->start(
"SAHSExplorer",
"getOutput");
291 $output = $exp->getOutput();
292 $ilBench->stop(
"SAHSExplorer",
"getOutput");
295 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.sahs_explorer.html",
"Modules/ScormAicc");
297 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
298 $this->tpl->setVariable(
"EXPLORER",$output);
299 $this->tpl->setVariable(
"ACTION",
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=".
$_GET[
"cmd"].
"&frame=".
$_GET[
"frame"].
300 "&ref_id=".$this->slm->getRefId().
"&scexpand=".
$_GET[
"scexpand"]);
301 $this->tpl->parseCurrentBlock();
310 if(is_object($sc_gui_object))
312 $sc_gui_object->view();
325 $this->tpl =
new ilTemplate(
"tpl.sahs_api.html",
true,
true,
"Modules/ScormAicc");
326 $this->tpl->setVariable(
"USER_ID",$ilias->account->getId());
327 $this->tpl->setVariable(
"USER_FIRSTNAME",$ilias->account->getFirstname());
328 $this->tpl->setVariable(
"USER_LASTNAME",$ilias->account->getLastname());
329 $this->tpl->setVariable(
"REF_ID",
$_GET[
"ref_id"]);
330 $this->tpl->setVariable(
"SESSION_ID",session_id());
332 $this->tpl->setVariable(
"CODE_BASE",
"http://".$_SERVER[
'SERVER_NAME'].substr($_SERVER[
'PHP_SELF'], 0, strpos ($_SERVER[
'PHP_SELF'],
"/ilias.php")));
333 $this->tpl->parseCurrentBlock();
335 $this->tpl->show(
false);
344 $sco_id = (
$_GET[
"sahs_id"] ==
"")
353 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
354 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
357 $id_ref = $item->getIdentifierRef();
359 $resource->readByIdRef($id_ref, $item->getSLMId());
361 $href = $resource->getHref();
362 $this->tpl =
new ilTemplate(
"tpl.sahs_launch_cbt.html",
true,
true,
"Modules/ScormAicc");
363 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
366 $this->tpl->setVariable(
"LAUNCH_DATA", $item->getDataFromLms());
367 $this->tpl->setVariable(
"MAST_SCORE", $item->getMasteryScore());
368 $this->tpl->setVariable(
"MAX_TIME", $item->getMaxTimeAllowed());
369 $this->tpl->setVariable(
"LIMIT_ACT", $item->getTimeLimitAction());
372 if ($this->slm->getAPIAdapterName() !=
"API")
374 $this->tpl->setCurrentBlock(
"alt_api_ref");
375 $this->tpl->setVariable(
"API_NAME", $this->slm->getAPIAdapterName());
376 $this->tpl->parseCurrentBlock();
379 $val_set = $ilDB->queryF(
'
380 SELECT * FROM scorm_tracking
384 array(
'integer',
'integer',
'integer'),
385 array($ilUser->getId(),$sco_id,$this->slm->getId()));
389 while($val_rec = $ilDB->fetchAssoc($val_set))
391 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
392 $val_rec[
"rvalue"] = str_replace(
"\r",
"\n", $val_rec[
"rvalue"]);
393 $val_rec[
"rvalue"] = str_replace(
"\n",
"\\n", $val_rec[
"rvalue"]);
394 $re_value[$val_rec[
"lvalue"]] = $val_rec[
"rvalue"];
397 foreach($re_value as $var => $value)
401 case "cmi.core.lesson_location":
402 case "cmi.core.lesson_status":
403 case "cmi.core.entry":
404 case "cmi.core.score.raw":
405 case "cmi.core.score.max":
406 case "cmi.core.score.min":
407 case "cmi.core.total_time":
408 case "cmi.core.exit":
409 case "cmi.suspend_data":
411 case "cmi.student_preference.audio":
412 case "cmi.student_preference.language":
413 case "cmi.student_preference.speed":
414 case "cmi.student_preference.text":
418 case "cmi.objectives._count":
420 $this->
setArray(
"cmi.objectives", $value,
"id", $re_value);
421 $this->
setArray(
"cmi.objectives", $value,
"score.raw", $re_value);
422 $this->
setArray(
"cmi.objectives", $value,
"score.max", $re_value);
423 $this->
setArray(
"cmi.objectives", $value,
"score.min", $re_value);
424 $this->
setArray(
"cmi.objectives", $value,
"status", $re_value);
427 case "cmi.interactions._count":
429 $this->
setArray(
"cmi.interactions", $value,
"id", $re_value);
430 for($i=0; $i<$value; $i++)
432 $var2 =
"cmi.interactions.".$i.
".objectives._count";
433 if (isset($v_array[$var2]))
435 $cnt = $v_array[$var2];
436 $this->
setArray(
"cmi.interactions.".$i.
".objectives",
437 $cnt,
"id", $re_value);
449 $this->
setArray(
"cmi.interactions", $value,
"time", $re_value);
450 $this->
setArray(
"cmi.interactions", $value,
"type", $re_value);
451 for($i=0; $i<$value; $i++)
453 $var2 =
"cmi.interactions.".$i.
".correct_responses._count";
454 if (isset($v_array[$var2]))
456 $cnt = $v_array[$var2];
457 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
458 $cnt,
"pattern", $re_value);
459 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
460 $cnt,
"weighting", $re_value);
463 $this->
setArray(
"cmi.interactions", $value,
"student_response", $re_value);
464 $this->
setArray(
"cmi.interactions", $value,
"result", $re_value);
465 $this->
setArray(
"cmi.interactions", $value,
"latency", $re_value);
471 $this->tpl->setCurrentBlock(
"switch_icon");
472 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
474 $this->tpl->setVariable(
"SCO_ALT",
475 $lng->txt(
"cont_status").
": "
476 .$lng->txt(
"cont_sc_stat_running")
478 $this->tpl->parseCurrentBlock();
481 $lesson_mode = $this->slm->getDefaultLessonMode();
482 if ($this->slm->getAutoReview())
484 if ($re_value[
"cmi.core.lesson_status"] ==
"completed" ||
485 $re_value[
"cmi.core.lesson_status"] ==
"passed" ||
486 $re_value[
"cmi.core.lesson_status"] ==
"failed")
488 $lesson_mode =
"review";
491 $this->tpl->setVariable(
"LESSON_MODE", $lesson_mode);
494 if ($lesson_mode ==
"normal")
496 $this->tpl->setVariable(
"CREDIT_MODE",
497 str_replace(
"_",
"-", $this->slm->getCreditMode()));
501 $this->tpl->setVariable(
"CREDIT_MODE",
"no-credit");
506 if (!isset($re_value[
"cmi.core.total_time"]))
508 $item->insertTrackData(
"cmi.core.total_time",
"0000:00:00", $sahs_obj_id);
510 if (!isset($re_value[
"cmi.core.lesson_status"]))
512 $item->insertTrackData(
"cmi.core.lesson_status",
"not attempted", $sahs_obj_id);
514 if (!isset($re_value[
"cmi.core.entry"]))
516 $item->insertTrackData(
"cmi.core.entry",
"", $sahs_obj_id);
525 $this->tpl =
new ilTemplate(
"tpl.sahs_finish_cbt.html",
true,
true,
"Modules/ScormAicc");
528 $this->tpl->setCurrentBlock(
"switch_icon");
529 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
531 "scorm/".str_replace(
" ",
"_",
$_GET[
"status"]).
'.svg')
533 $this->tpl->setVariable(
"SCO_ALT",
534 $lng->txt(
"cont_status").
": "
535 .$lng->txt(
"cont_sc_stat_".str_replace(
" ",
"_",
$_GET[
"status"])).
", "
536 .$lng->txt(
"cont_total_time").
": "
539 $this->tpl->setVariable(
"SCO_LAUNCH_ID",
$_GET[
"launch"]);
540 $this->tpl->parseCurrentBlock();
546 $this->tpl =
new ilTemplate(
"tpl.sahs_unload_cbt.html",
true,
true,
"Modules/ScormAicc");
548 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
557 $sco_id = (
$_GET[
"asset_id"] ==
"")
566 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
567 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
570 $id_ref = $item->getIdentifierRef();
572 $resource->readByIdRef($id_ref, $item->getSLMId());
573 $href = $resource->getHref();
574 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
575 $this->tpl =
new ilTemplate(
"tpl.scorm_launch_asset.html",
true,
true,
"Modules/ScormAicc");
576 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
586 $this->tpl->setCurrentBlock(
"set_value");
587 $this->tpl->setVariable(
"VAR", $a_var);
588 $this->tpl->setVariable(
"VALUE", $a_value);
589 $this->tpl->parseCurrentBlock();
595 function setArray($a_left, $a_value, $a_name, &$v_array)
597 for($i=0; $i<$a_value; $i++)
599 $var = $a_left.
".".$i.
".".$a_name;
600 if (isset($v_array[$var]))
602 $this->tpl->setCurrentBlock(
"set_value");
603 $this->tpl->setVariable(
"VAR", $var);
604 $this->tpl->setVariable(
"VALUE", $v_array[$var]);
605 $this->tpl->parseCurrentBlock();
617 $this->ctrl->setCmd(
"showSummary");
618 $this->ctrl->setCmdClass(
"ilinfoscreengui");
624 global $ilTabs, $ilLocator, $ilAccess;
627 include_once
"Services/Tracking/classes/class.ilLearningProgressAccess.php";
629 ((!$ilAccess->checkAccess(
"edit_learning_progress",
"",
$_GET[
"ref_id"]) &&
630 !$ilAccess->checkAccess(
"read_learning_progress",
"",
$_GET[
"ref_id"])) ||
631 !$ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])))
633 $ilTabs->addTab(
"info_short", $this->lng->txt(
"info_short"),
634 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
636 $ilTabs->addTab(
"learning_progress", $this->lng->txt(
"learning_progress"),
637 $this->ctrl->getLinkTargetByClass(
'illearningprogressgui',
''));
639 if($ilAccess->checkAccess(
"edit_learning_progress",
"",
$_GET[
"ref_id"]) || $ilAccess->checkAccess(
"read_learning_progress",
"",
$_GET[
"ref_id"]))
641 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
643 if($privacy->enabledSahsProtocolData()) {
644 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
647 if($type ==
"scorm2004") {
648 $ilTabs->addTab(
"cont_tracking_data", $this->lng->txt(
"cont_tracking_data"),
649 $this->ctrl->getLinkTargetByClass(
'ilobjscorm2004learningmodulegui',
'showTrackingItems'));
651 else if($type ==
"scorm") {
652 $ilTabs->addTab(
"cont_tracking_data", $this->lng->txt(
"cont_tracking_data"),
653 $this->ctrl->getLinkTargetByClass(
'ilobjscormlearningmodulegui',
'showTrackingItems'));
657 $ilTabs->activateTab($a_active);
658 $this->tpl->getStandardTemplate();
659 $this->tpl->setTitle($this->slm_gui->object->getTitle());
661 $ilLocator->addRepositoryItems();
662 $ilLocator->addItem($this->slm_gui->object->getTitle(),
663 $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
664 $this->tpl->setLocator();
690 $this->lng->loadLanguageModule(
"meta");
692 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
695 $info->enablePrivateNotes();
699 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
701 $info->enableNewsEditing();
703 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
704 if ($enable_internal_rss)
706 $info->setBlockProperty(
"news",
"settings",
true);
711 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
713 include_once
'./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
715 $om = $sahs_obj->getOpenMode();
716 $width = $sahs_obj->getWidth();
717 $height = $sahs_obj->getHeight();
720 $info->addButton($this->lng->txt(
"view"),
721 "javascript:void(0); onclick=startSAHS('".$this->ctrl->getLinkTarget($this,
"").
"','ilContObj".$this->slm_gui->object->getId().
"',".$om.
",".$width.
",".$height.
");",
726 $info->addButton($this->lng->txt(
"view"),
727 $this->ctrl->getLinkTarget($this,
""),
728 ' target="ilContObj'.$this->slm_gui->object->getId().
'" ',
734 $info->addMetaDataSections($this->slm_gui->object->getId(),0,
735 $this->slm_gui->object->getType());
746 $this->ctrl->forwardCommand($info);