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");
59 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
60 "ilias.php?cmd=infoScreen&baseClass=ilSAHSPresentationGUI&ref_id=".
$_GET[
"ref_id"],
"lm");
64 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
67 $ilLocator->addRepositoryItems();
68 $ilLocator->addItem($ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId(
$_GET[
'ref_id'])),
69 'ilias.php?baseClass=ilSAHSPresentationGUI&ref_id='.
$_GET[
'ref_id'],
73 $this->tpl->setLocator();
74 $this->tpl->getStandardTemplate();
76 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
77 $this->ctrl->setReturn($this,
'');
79 $this->ctrl->forwardCommand($pp_gui);
84 $next_class = $this->ctrl->getNextClass($this);
85 $cmd = $this->ctrl->getCmd();
89 if (
$cmd ==
"downloadCertificate")
91 require_once
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
93 $ret =& $this->ctrl->forwardCommand($scorm_gui);
96 if (substr(
$cmd,0,11) ==
"offlineMode" || $this->offline_mode) $next_class =
"ilscormofflinemodegui";
102 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
107 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
112 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php");
117 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php");
122 if ($next_class !=
"ilinfoscreengui" &&
123 $cmd !=
"infoScreen" &&
124 $next_class !=
"ilscormofflinemodegui" &&
125 $next_class !=
"illearningprogressgui")
127 include_once(
"./Services/License/classes/class.ilLicense.php");
132 $this->ctrl->setCmdClass(
"ilscorm13player");
137 $this->ctrl->setCmdClass(
"ilscormpresentationgui");
142 $this->ctrl->setCmdClass(
"ilaiccpresentationgui");
146 $this->ctrl->setCmdClass(
"ilhacppresentationgui");
149 $next_class = $this->ctrl->getNextClass($this);
154 case "ilinfoscreengui":
158 case "ilscorm13player":
159 require_once
"./Modules/Scorm2004/classes/ilSCORM13Player.php";
161 $ret =& $this->ctrl->forwardCommand($scorm_gui);
164 case "ilscormpresentationgui":
165 require_once
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
167 $ret =& $this->ctrl->forwardCommand($scorm_gui);
170 case "ilaiccpresentationgui":
171 require_once
"./Modules/ScormAicc/classes/AICC/class.ilAICCPresentationGUI.php";
173 $ret =& $this->ctrl->forwardCommand($aicc_gui);
176 case "ilhacppresentationgui":
177 require_once
"./Modules/ScormAicc/classes/HACP/class.ilHACPPresentationGUI.php";
179 $ret =& $this->ctrl->forwardCommand($hacp_gui);
182 case "illearningprogressgui":
184 include_once
"./Services/Tracking/classes/class.ilLearningProgressGUI.php";
186 $this->ctrl->forwardCommand($new_gui);
190 case "ilscormofflinemodegui":
191 include_once
"./Modules/ScormAicc/classes/class.ilSCORMOfflineModeGUI.php";
193 $this->ctrl->forwardCommand($new_gui);
205 if(!is_array($a_attributes))
209 foreach ($a_attributes as $attribute)
211 $attr[$attribute->name()] = $attribute->value();
224 $this->tpl =
new ilTemplate(
"tpl.sahs_pres_frameset.html",
false,
false,
"Modules/ScormAicc");
225 $this->tpl->setVariable(
"REF_ID",$this->slm->getRefId());
226 $this->tpl->show(
"DEFAULT",
false);
238 $ilBench->start(
"SAHSExplorer",
"initExplorer");
240 $this->tpl =
new ilTemplate(
"tpl.sahs_exp_main.html",
true,
true,
"Modules/ScormAicc");
242 require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
243 $exp =
new ilSCORMExplorer(
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=".$this->slm->getRefId(), $this->slm);
245 $exp->setFrameTarget($a_target);
249 if (
$_GET[
"scexpand"] ==
"")
256 $expanded =
$_GET[
"scexpand"];
258 $exp->setExpand($expanded);
260 $exp->forceExpandAll(
true,
false);
264 $ilBench->stop(
"SAHSExplorer",
"initExplorer");
267 $ilBench->start(
"SAHSExplorer",
"setOutput");
269 $ilBench->stop(
"SAHSExplorer",
"setOutput");
271 $ilBench->start(
"SAHSExplorer",
"getOutput");
272 $output = $exp->getOutput();
273 $ilBench->stop(
"SAHSExplorer",
"getOutput");
276 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.sahs_explorer.html",
"Modules/ScormAicc");
278 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
279 $this->tpl->setVariable(
"EXPLORER",$output);
280 $this->tpl->setVariable(
"ACTION",
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=".
$_GET[
"cmd"].
"&frame=".
$_GET[
"frame"].
281 "&ref_id=".$this->slm->getRefId().
"&scexpand=".
$_GET[
"scexpand"]);
282 $this->tpl->parseCurrentBlock();
291 if(is_object($sc_gui_object))
293 $sc_gui_object->view();
306 $this->tpl =
new ilTemplate(
"tpl.sahs_api.html",
true,
true,
"Modules/ScormAicc");
307 $this->tpl->setVariable(
"USER_ID",$ilias->account->getId());
308 $this->tpl->setVariable(
"USER_FIRSTNAME",$ilias->account->getFirstname());
309 $this->tpl->setVariable(
"USER_LASTNAME",$ilias->account->getLastname());
310 $this->tpl->setVariable(
"REF_ID",
$_GET[
"ref_id"]);
311 $this->tpl->setVariable(
"SESSION_ID",session_id());
313 $this->tpl->setVariable(
"CODE_BASE",
"http://".$_SERVER[
'SERVER_NAME'].substr($_SERVER[
'PHP_SELF'], 0, strpos ($_SERVER[
'PHP_SELF'],
"/ilias.php")));
314 $this->tpl->parseCurrentBlock();
316 $this->tpl->show(
false);
325 $sco_id = (
$_GET[
"sahs_id"] ==
"")
334 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
335 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
338 $id_ref = $item->getIdentifierRef();
340 $resource->readByIdRef($id_ref, $item->getSLMId());
342 $href = $resource->getHref();
343 $this->tpl =
new ilTemplate(
"tpl.sahs_launch_cbt.html",
true,
true,
"Modules/ScormAicc");
344 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
347 $this->tpl->setVariable(
"LAUNCH_DATA", $item->getDataFromLms());
348 $this->tpl->setVariable(
"MAST_SCORE", $item->getMasteryScore());
349 $this->tpl->setVariable(
"MAX_TIME", $item->getMaxTimeAllowed());
350 $this->tpl->setVariable(
"LIMIT_ACT", $item->getTimeLimitAction());
353 if ($this->slm->getAPIAdapterName() !=
"API")
355 $this->tpl->setCurrentBlock(
"alt_api_ref");
356 $this->tpl->setVariable(
"API_NAME", $this->slm->getAPIAdapterName());
357 $this->tpl->parseCurrentBlock();
360 $val_set = $ilDB->queryF(
'
361 SELECT * FROM scorm_tracking
365 array(
'integer',
'integer',
'integer'),
366 array($ilUser->getId(),$sco_id,$this->slm->getId()));
370 while($val_rec = $ilDB->fetchAssoc($val_set))
372 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
373 $val_rec[
"rvalue"] = str_replace(
"\r",
"\n", $val_rec[
"rvalue"]);
374 $val_rec[
"rvalue"] = str_replace(
"\n",
"\\n", $val_rec[
"rvalue"]);
375 $re_value[$val_rec[
"lvalue"]] = $val_rec[
"rvalue"];
378 foreach($re_value as $var => $value)
382 case "cmi.core.lesson_location":
383 case "cmi.core.lesson_status":
384 case "cmi.core.entry":
385 case "cmi.core.score.raw":
386 case "cmi.core.score.max":
387 case "cmi.core.score.min":
388 case "cmi.core.total_time":
389 case "cmi.core.exit":
390 case "cmi.suspend_data":
392 case "cmi.student_preference.audio":
393 case "cmi.student_preference.language":
394 case "cmi.student_preference.speed":
395 case "cmi.student_preference.text":
399 case "cmi.objectives._count":
401 $this->
setArray(
"cmi.objectives", $value,
"id", $re_value);
402 $this->
setArray(
"cmi.objectives", $value,
"score.raw", $re_value);
403 $this->
setArray(
"cmi.objectives", $value,
"score.max", $re_value);
404 $this->
setArray(
"cmi.objectives", $value,
"score.min", $re_value);
405 $this->
setArray(
"cmi.objectives", $value,
"status", $re_value);
408 case "cmi.interactions._count":
410 $this->
setArray(
"cmi.interactions", $value,
"id", $re_value);
411 for($i=0; $i<$value; $i++)
413 $var2 =
"cmi.interactions.".$i.
".objectives._count";
414 if (isset($v_array[$var2]))
416 $cnt = $v_array[$var2];
417 $this->
setArray(
"cmi.interactions.".$i.
".objectives",
418 $cnt,
"id", $re_value);
430 $this->
setArray(
"cmi.interactions", $value,
"time", $re_value);
431 $this->
setArray(
"cmi.interactions", $value,
"type", $re_value);
432 for($i=0; $i<$value; $i++)
434 $var2 =
"cmi.interactions.".$i.
".correct_responses._count";
435 if (isset($v_array[$var2]))
437 $cnt = $v_array[$var2];
438 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
439 $cnt,
"pattern", $re_value);
440 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
441 $cnt,
"weighting", $re_value);
444 $this->
setArray(
"cmi.interactions", $value,
"student_response", $re_value);
445 $this->
setArray(
"cmi.interactions", $value,
"result", $re_value);
446 $this->
setArray(
"cmi.interactions", $value,
"latency", $re_value);
452 $this->tpl->setCurrentBlock(
"switch_icon");
453 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
455 $this->tpl->setVariable(
"SCO_ALT",
456 $lng->txt(
"cont_status").
": "
457 .$lng->txt(
"cont_sc_stat_running")
459 $this->tpl->parseCurrentBlock();
462 $lesson_mode = $this->slm->getDefaultLessonMode();
463 if ($this->slm->getAutoReview())
465 if ($re_value[
"cmi.core.lesson_status"] ==
"completed" ||
466 $re_value[
"cmi.core.lesson_status"] ==
"passed" ||
467 $re_value[
"cmi.core.lesson_status"] ==
"failed")
469 $lesson_mode =
"review";
472 $this->tpl->setVariable(
"LESSON_MODE", $lesson_mode);
475 if ($lesson_mode ==
"normal")
477 $this->tpl->setVariable(
"CREDIT_MODE",
478 str_replace(
"_",
"-", $this->slm->getCreditMode()));
482 $this->tpl->setVariable(
"CREDIT_MODE",
"no-credit");
487 if (!isset($re_value[
"cmi.core.total_time"]))
489 $item->insertTrackData(
"cmi.core.total_time",
"0000:00:00", $sahs_obj_id);
491 if (!isset($re_value[
"cmi.core.lesson_status"]))
493 $item->insertTrackData(
"cmi.core.lesson_status",
"not attempted", $sahs_obj_id);
495 if (!isset($re_value[
"cmi.core.entry"]))
497 $item->insertTrackData(
"cmi.core.entry",
"", $sahs_obj_id);
506 $this->tpl =
new ilTemplate(
"tpl.sahs_finish_cbt.html",
true,
true,
"Modules/ScormAicc");
509 $this->tpl->setCurrentBlock(
"switch_icon");
510 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
512 "scorm/".str_replace(
" ",
"_",
$_GET[
"status"]).
'.png')
514 $this->tpl->setVariable(
"SCO_ALT",
515 $lng->txt(
"cont_status").
": "
516 .$lng->txt(
"cont_sc_stat_".str_replace(
" ",
"_",
$_GET[
"status"])).
", "
517 .$lng->txt(
"cont_total_time").
": "
520 $this->tpl->setVariable(
"SCO_LAUNCH_ID",
$_GET[
"launch"]);
521 $this->tpl->parseCurrentBlock();
527 $this->tpl =
new ilTemplate(
"tpl.sahs_unload_cbt.html",
true,
true,
"Modules/ScormAicc");
529 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
538 $sco_id = (
$_GET[
"asset_id"] ==
"")
547 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
548 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
551 $id_ref = $item->getIdentifierRef();
553 $resource->readByIdRef($id_ref, $item->getSLMId());
554 $href = $resource->getHref();
555 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
556 $this->tpl =
new ilTemplate(
"tpl.scorm_launch_asset.html",
true,
true,
"Modules/ScormAicc");
557 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
567 $this->tpl->setCurrentBlock(
"set_value");
568 $this->tpl->setVariable(
"VAR", $a_var);
569 $this->tpl->setVariable(
"VALUE", $a_value);
570 $this->tpl->parseCurrentBlock();
576 function setArray($a_left, $a_value, $a_name, &$v_array)
578 for($i=0; $i<$a_value; $i++)
580 $var = $a_left.
".".$i.
".".$a_name;
581 if (isset($v_array[$var]))
583 $this->tpl->setCurrentBlock(
"set_value");
584 $this->tpl->setVariable(
"VAR", $var);
585 $this->tpl->setVariable(
"VALUE", $v_array[$var]);
586 $this->tpl->parseCurrentBlock();
598 $this->ctrl->setCmd(
"showSummary");
599 $this->ctrl->setCmdClass(
"ilinfoscreengui");
605 global $ilTabs, $ilLocator, $ilAccess;
608 include_once
"Services/Tracking/classes/class.ilLearningProgressAccess.php";
610 (!$ilAccess->checkAccess(
"edit_learning_progress",
"",
$_GET[
"ref_id"]) ||
611 !$ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])))
613 $ilTabs->addTab(
"info_short", $this->lng->txt(
"info_short"),
614 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
616 $ilTabs->addTab(
"learning_progress", $this->lng->txt(
"learning_progress"),
617 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui',
'illplistofprogressgui'),
''));
619 $ilTabs->activateTab($a_active);
622 $this->tpl->getStandardTemplate();
623 $this->tpl->setTitle($this->slm_gui->object->getTitle());
625 $ilLocator->addRepositoryItems();
626 $ilLocator->addItem($this->slm_gui->object->getTitle(),
627 $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
628 $this->tpl->setLocator();
654 $this->lng->loadLanguageModule(
"meta");
656 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
659 $info->enablePrivateNotes();
663 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
665 $info->enableNewsEditing();
667 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
668 if ($enable_internal_rss)
670 $info->setBlockProperty(
"news",
"settings",
true);
675 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
677 include_once
'./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
679 $om = $sahs_obj->getOpenMode();
680 $width = $sahs_obj->getWidth();
681 $height = $sahs_obj->getHeight();
684 $info->addButton($this->lng->txt(
"view"),
685 "javascript:void(0); onclick=startSAHS('".$this->ctrl->getLinkTarget($this,
"").
"','ilContObj".$this->slm_gui->object->getId().
"',".$om.
",".$width.
",".$height.
");",
690 $info->addButton($this->lng->txt(
"view"),
691 $this->ctrl->getLinkTarget($this,
""),
692 ' target="ilContObj'.$this->slm_gui->object->getId().
'" ',
698 $info->addMetaDataSections($this->slm_gui->object->getId(),0,
699 $this->slm_gui->object->getType());
710 $this->ctrl->forwardCommand($info);