36 $this->ctrl->saveParameter($this,
"ref_id");
44 global
$lng,$ilAccess, $ilNavigationHistory,
$ilCtrl, $ilLocator, $ilObjDataCache;
46 include_once
"./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");
58 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
59 "ilias.php?cmd=infoScreen&baseClass=ilSAHSPresentationGUI&ref_id=".
$_GET[
"ref_id"],
"lm");
63 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
66 $ilLocator->addRepositoryItems();
67 $ilLocator->addItem($ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId(
$_GET[
'ref_id'])),
68 'ilias.php?baseClass=ilSAHSPresentationGUI&ref_id='.
$_GET[
'ref_id'],
72 $this->tpl->setLocator();
73 $this->tpl->getStandardTemplate();
75 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
76 $this->ctrl->setReturn($this,
'');
78 $this->ctrl->forwardCommand($pp_gui);
83 include_once
'./classes/class.ilSearch.php';
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);
101 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
106 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
111 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php");
116 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php");
121 if ($next_class !=
"ilinfoscreengui" &&
122 $cmd !=
"infoScreen")
124 include_once(
"./Services/License/classes/class.ilLicense.php");
130 $this->ctrl->setCmdClass(
"ilscorm13player");
135 $this->ctrl->setCmdClass(
"ilscormpresentationgui");
140 $this->ctrl->setCmdClass(
"ilaiccpresentationgui");
144 $this->ctrl->setCmdClass(
"ilhacppresentationgui");
147 $next_class = $this->ctrl->getNextClass($this);
152 case "ilinfoscreengui":
156 case "ilscorm13player":
157 require_once
"./Modules/Scorm2004/classes/ilSCORM13Player.php";
160 $ret =& $this->ctrl->forwardCommand($scorm_gui);
163 case "ilscormpresentationgui":
164 require_once
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
166 $ret =& $this->ctrl->forwardCommand($scorm_gui);
169 case "ilaiccpresentationgui":
170 require_once
"./Modules/ScormAicc/classes/AICC/class.ilAICCPresentationGUI.php";
172 $ret =& $this->ctrl->forwardCommand($aicc_gui);
175 case "ilhacppresentationgui":
176 require_once
"./Modules/ScormAicc/classes/HACP/class.ilHACPPresentationGUI.php";
178 $ret =& $this->ctrl->forwardCommand($hacp_gui);
191 if(!is_array($a_attributes))
195 foreach ($a_attributes as $attribute)
197 $attr[$attribute->name()] = $attribute->value();
210 $this->tpl =
new ilTemplate(
"tpl.sahs_pres_frameset.html",
false,
false,
"Modules/ScormAicc");
211 $this->tpl->setVariable(
"REF_ID",$this->slm->getRefId());
212 $this->tpl->show(
"DEFAULT",
false);
224 $ilBench->start(
"SAHSExplorer",
"initExplorer");
226 $this->tpl =
new ilTemplate(
"tpl.sahs_exp_main.html",
true,
true,
"Modules/ScormAicc");
228 require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
229 $exp =
new ilSCORMExplorer(
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=".$this->slm->getRefId(), $this->slm);
231 $exp->setFrameTarget($a_target);
235 if (
$_GET[
"scexpand"] ==
"")
242 $expanded =
$_GET[
"scexpand"];
244 $exp->setExpand($expanded);
246 $exp->forceExpandAll(
true,
false);
250 $ilBench->stop(
"SAHSExplorer",
"initExplorer");
253 $ilBench->start(
"SAHSExplorer",
"setOutput");
255 $ilBench->stop(
"SAHSExplorer",
"setOutput");
257 $ilBench->start(
"SAHSExplorer",
"getOutput");
258 $output = $exp->getOutput();
259 $ilBench->stop(
"SAHSExplorer",
"getOutput");
262 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.sahs_explorer.html",
"Modules/ScormAicc");
264 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
265 $this->tpl->setVariable(
"EXPLORER",$output);
266 $this->tpl->setVariable(
"ACTION",
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=".
$_GET[
"cmd"].
"&frame=".
$_GET[
"frame"].
267 "&ref_id=".$this->slm->getRefId().
"&scexpand=".
$_GET[
"scexpand"]);
268 $this->tpl->parseCurrentBlock();
277 if(is_object($sc_gui_object))
279 $sc_gui_object->view();
292 $this->tpl =
new ilTemplate(
"tpl.sahs_api.html",
true,
true,
"Modules/ScormAicc");
293 $this->tpl->setVariable(
"USER_ID",$ilias->account->getId());
294 $this->tpl->setVariable(
"USER_FIRSTNAME",$ilias->account->getFirstname());
295 $this->tpl->setVariable(
"USER_LASTNAME",$ilias->account->getLastname());
296 $this->tpl->setVariable(
"REF_ID",
$_GET[
"ref_id"]);
297 $this->tpl->setVariable(
"SESSION_ID",session_id());
299 $this->tpl->setVariable(
"CODE_BASE",
"http://".$_SERVER[
'SERVER_NAME'].substr($_SERVER[
'PHP_SELF'], 0, strpos ($_SERVER[
'PHP_SELF'],
"/ilias.php")));
300 $this->tpl->parseCurrentBlock();
302 $this->tpl->show(
false);
309 global $ilUser,
$ilDB;
311 $sco_id = (
$_GET[
"sahs_id"] ==
"")
320 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
321 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
324 $id_ref = $item->getIdentifierRef();
326 $resource->readByIdRef($id_ref, $item->getSLMId());
328 $href = $resource->getHref();
329 $this->tpl =
new ilTemplate(
"tpl.sahs_launch_cbt.html",
true,
true,
"Modules/ScormAicc");
330 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
333 $this->tpl->setVariable(
"LAUNCH_DATA", $item->getDataFromLms());
334 $this->tpl->setVariable(
"MAST_SCORE", $item->getMasteryScore());
335 $this->tpl->setVariable(
"MAX_TIME", $item->getMaxTimeAllowed());
336 $this->tpl->setVariable(
"LIMIT_ACT", $item->getTimeLimitAction());
339 if ($this->slm->getAPIAdapterName() !=
"API")
341 $this->tpl->setCurrentBlock(
"alt_api_ref");
342 $this->tpl->setVariable(
"API_NAME", $this->slm->getAPIAdapterName());
343 $this->tpl->parseCurrentBlock();
347 $val_set = $ilDB->queryF(
'
348 SELECT * FROM scorm_tracking
352 array(
'integer',
'integer',
'integer'),
353 array($ilUser->getId(),$sco_id,$this->slm->getId()));
357 while($val_rec = $ilDB->fetchAssoc($val_set))
359 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
360 $val_rec[
"rvalue"] = str_replace(
"\r",
"\n", $val_rec[
"rvalue"]);
361 $val_rec[
"rvalue"] = str_replace(
"\n",
"\\n", $val_rec[
"rvalue"]);
362 $re_value[$val_rec[
"lvalue"]] = $val_rec[
"rvalue"];
365 foreach($re_value as $var => $value)
369 case "cmi.core.lesson_location":
370 case "cmi.core.lesson_status":
371 case "cmi.core.entry":
372 case "cmi.core.score.raw":
373 case "cmi.core.score.max":
374 case "cmi.core.score.min":
375 case "cmi.core.total_time":
376 case "cmi.core.exit":
377 case "cmi.suspend_data":
379 case "cmi.student_preference.audio":
380 case "cmi.student_preference.language":
381 case "cmi.student_preference.speed":
382 case "cmi.student_preference.text":
386 case "cmi.objectives._count":
388 $this->
setArray(
"cmi.objectives", $value,
"id", $re_value);
389 $this->
setArray(
"cmi.objectives", $value,
"score.raw", $re_value);
390 $this->
setArray(
"cmi.objectives", $value,
"score.max", $re_value);
391 $this->
setArray(
"cmi.objectives", $value,
"score.min", $re_value);
392 $this->
setArray(
"cmi.objectives", $value,
"status", $re_value);
395 case "cmi.interactions._count":
397 $this->
setArray(
"cmi.interactions", $value,
"id", $re_value);
398 for($i=0; $i<$value; $i++)
400 $var2 =
"cmi.interactions.".$i.
".objectives._count";
401 if (isset($v_array[$var2]))
403 $cnt = $v_array[$var2];
404 $this->
setArray(
"cmi.interactions.".$i.
".objectives",
405 $cnt,
"id", $re_value);
417 $this->
setArray(
"cmi.interactions", $value,
"time", $re_value);
418 $this->
setArray(
"cmi.interactions", $value,
"type", $re_value);
419 for($i=0; $i<$value; $i++)
421 $var2 =
"cmi.interactions.".$i.
".correct_responses._count";
422 if (isset($v_array[$var2]))
424 $cnt = $v_array[$var2];
425 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
426 $cnt,
"pattern", $re_value);
427 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
428 $cnt,
"weighting", $re_value);
431 $this->
setArray(
"cmi.interactions", $value,
"student_response", $re_value);
432 $this->
setArray(
"cmi.interactions", $value,
"result", $re_value);
433 $this->
setArray(
"cmi.interactions", $value,
"latency", $re_value);
439 $this->tpl->setCurrentBlock(
"switch_icon");
440 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
442 $this->tpl->setVariable(
"SCO_ALT",
443 $lng->txt(
"cont_status").
": "
444 .$lng->txt(
"cont_sc_stat_running")
446 $this->tpl->parseCurrentBlock();
449 $lesson_mode = $this->slm->getDefaultLessonMode();
450 if ($this->slm->getAutoReview())
452 if ($re_value[
"cmi.core.lesson_status"] ==
"completed" ||
453 $re_value[
"cmi.core.lesson_status"] ==
"passed" ||
454 $re_value[
"cmi.core.lesson_status"] ==
"failed")
456 $lesson_mode =
"review";
459 $this->tpl->setVariable(
"LESSON_MODE", $lesson_mode);
462 if ($lesson_mode ==
"normal")
464 $this->tpl->setVariable(
"CREDIT_MODE",
465 str_replace(
"_",
"-", $this->slm->getCreditMode()));
469 $this->tpl->setVariable(
"CREDIT_MODE",
"no-credit");
474 if (!isset($re_value[
"cmi.core.total_time"]))
476 $item->insertTrackData(
"cmi.core.total_time",
"0000:00:00", $sahs_obj_id);
478 if (!isset($re_value[
"cmi.core.lesson_status"]))
480 $item->insertTrackData(
"cmi.core.lesson_status",
"not attempted", $sahs_obj_id);
482 if (!isset($re_value[
"cmi.core.entry"]))
484 $item->insertTrackData(
"cmi.core.entry",
"", $sahs_obj_id);
493 $this->tpl =
new ilTemplate(
"tpl.sahs_finish_cbt.html",
true,
true,
"Modules/ScormAicc");
496 $this->tpl->setCurrentBlock(
"switch_icon");
497 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
499 "scorm/".str_replace(
" ",
"_",
$_GET[
"status"]).
'.gif')
501 $this->tpl->setVariable(
"SCO_ALT",
502 $lng->txt(
"cont_status").
": "
503 .$lng->txt(
"cont_sc_stat_".str_replace(
" ",
"_",
$_GET[
"status"])).
", "
504 .$lng->txt(
"cont_total_time").
": "
507 $this->tpl->setVariable(
"SCO_LAUNCH_ID",
$_GET[
"launch"]);
508 $this->tpl->parseCurrentBlock();
514 $this->tpl =
new ilTemplate(
"tpl.sahs_unload_cbt.html",
true,
true,
"Modules/ScormAicc");
516 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
523 global $ilUser,
$ilDB;
525 $sco_id = (
$_GET[
"asset_id"] ==
"")
534 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
535 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
538 $id_ref = $item->getIdentifierRef();
540 $resource->readByIdRef($id_ref, $item->getSLMId());
541 $href = $resource->getHref();
542 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
543 $this->tpl =
new ilTemplate(
"tpl.scorm_launch_asset.html",
true,
true,
"Modules/ScormAicc");
544 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
554 $this->tpl->setCurrentBlock(
"set_value");
555 $this->tpl->setVariable(
"VAR", $a_var);
556 $this->tpl->setVariable(
"VALUE", $a_value);
557 $this->tpl->parseCurrentBlock();
563 function setArray($a_left, $a_value, $a_name, &$v_array)
565 for($i=0; $i<$a_value; $i++)
567 $var = $a_left.
".".$i.
".".$a_name;
568 if (isset($v_array[$var]))
570 $this->tpl->setCurrentBlock(
"set_value");
571 $this->tpl->setVariable(
"VAR", $var);
572 $this->tpl->setVariable(
"VALUE", $v_array[$var]);
573 $this->tpl->parseCurrentBlock();
585 $this->ctrl->setCmd(
"showSummary");
586 $this->ctrl->setCmdClass(
"ilinfoscreengui");
611 $this->tpl->getStandardTemplate();
612 $this->tpl->setTitle($this->slm_gui->object->getTitle());
615 $ilLocator->addRepositoryItems();
616 $ilLocator->addItem($this->slm_gui->object->getTitle(),
617 $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
619 $this->tpl->setLocator();
621 $this->lng->loadLanguageModule(
"meta");
623 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
626 $info->enablePrivateNotes();
630 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
632 $info->enableNewsEditing();
634 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
635 if ($enable_internal_rss)
637 $info->setBlockProperty(
"news",
"settings",
true);
642 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
644 include_once
'./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
646 $om = $sahs_obj->getOpenMode();
647 $width = $sahs_obj->getWidth();
648 $height = $sahs_obj->getHeight();
651 $info->addButton($this->lng->txt(
"view"),
652 "javascript:void(0); onclick=startSAHS('".$this->ctrl->getLinkTarget($this,
"").
"','ilContObj".$this->slm_gui->object->getId().
"',".$om.
",".$width.
",".$height.
");",
657 $info->addButton($this->lng->txt(
"view"),
658 $this->ctrl->getLinkTarget($this,
""),
659 ' target="ilContObj'.$this->slm_gui->object->getId().
'" ');
664 $info->addMetaDataSections($this->slm_gui->object->getId(),0,
665 $this->slm_gui->object->getType());
676 $this->ctrl->forwardCommand($info);