55 $this->ctrl->saveParameter($this,
"ref_id");
63 global
$lng,$ilAccess, $ilNavigationHistory,
$ilCtrl, $ilLocator, $ilObjDataCache;
65 include_once
"./classes/class.ilObjectGUI.php";
66 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
68 $lng->loadLanguageModule(
"content");
71 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
73 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
74 "ilias.php?cmd=infoScreen&baseClass=ilSAHSPresentationGUI&ref_id=".
$_GET[
"ref_id"],
"lm");
77 include_once
'payment/classes/class.ilPaymentObject.php';
81 $ilLocator->addRepositoryItems();
82 $ilLocator->addItem($ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId(
$_GET[
'ref_id'])),
83 'ilias.php?baseClass=ilSAHSPresentationGUI&ref_id='.
$_GET[
'ref_id'],
87 $this->tpl->setLocator();
88 $this->tpl->getStandardTemplate();
90 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
91 $this->ctrl->setReturn($this,
'');
93 $this->ctrl->forwardCommand($pp_gui);
98 include_once
'./classes/class.ilSearch.php';
100 $next_class = $this->ctrl->getNextClass($this);
101 $cmd = $this->ctrl->getCmd();
106 if (
$cmd ==
"downloadCertificate")
108 require_once
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
110 $ret =& $this->ctrl->forwardCommand($scorm_gui);
117 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
122 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
127 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php");
132 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php");
137 if ($next_class !=
"ilinfoscreengui" &&
138 $cmd !=
"infoScreen")
140 include_once(
"./Services/License/classes/class.ilLicense.php");
146 $this->ctrl->setCmdClass(
"ilscorm13player");
151 $this->ctrl->setCmdClass(
"ilscormpresentationgui");
156 $this->ctrl->setCmdClass(
"ilaiccpresentationgui");
160 $this->ctrl->setCmdClass(
"ilhacppresentationgui");
163 $next_class = $this->ctrl->getNextClass($this);
168 case "ilinfoscreengui":
172 case "ilscorm13player":
173 require_once
"./Modules/Scorm2004/classes/ilSCORM13Player.php";
176 $ret =& $this->ctrl->forwardCommand($scorm_gui);
179 case "ilscormpresentationgui":
180 require_once
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
182 $ret =& $this->ctrl->forwardCommand($scorm_gui);
185 case "ilaiccpresentationgui":
186 require_once
"./Modules/ScormAicc/classes/AICC/class.ilAICCPresentationGUI.php";
188 $ret =& $this->ctrl->forwardCommand($aicc_gui);
191 case "ilhacppresentationgui":
192 require_once
"./Modules/ScormAicc/classes/HACP/class.ilHACPPresentationGUI.php";
194 $ret =& $this->ctrl->forwardCommand($hacp_gui);
207 if(!is_array($a_attributes))
211 foreach ($a_attributes as $attribute)
213 $attr[$attribute->name()] = $attribute->value();
226 $this->tpl =
new ilTemplate(
"tpl.sahs_pres_frameset.html",
false,
false,
"Modules/ScormAicc");
227 $this->tpl->setVariable(
"REF_ID",$this->slm->getRefId());
228 $this->tpl->show(
"DEFAULT",
false);
240 $ilBench->start(
"SAHSExplorer",
"initExplorer");
242 $this->tpl =
new ilTemplate(
"tpl.sahs_exp_main.html",
true,
true,
"Modules/ScormAicc");
244 require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
245 $exp =
new ilSCORMExplorer(
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=".$this->slm->getRefId(), $this->slm);
247 $exp->setFrameTarget($a_target);
251 if (
$_GET[
"scexpand"] ==
"")
258 $expanded =
$_GET[
"scexpand"];
260 $exp->setExpand($expanded);
262 $exp->forceExpandAll(
true,
false);
266 $ilBench->stop(
"SAHSExplorer",
"initExplorer");
269 $ilBench->start(
"SAHSExplorer",
"setOutput");
271 $ilBench->stop(
"SAHSExplorer",
"setOutput");
273 $ilBench->start(
"SAHSExplorer",
"getOutput");
274 $output = $exp->getOutput();
275 $ilBench->stop(
"SAHSExplorer",
"getOutput");
278 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.sahs_explorer.html",
"Modules/ScormAicc");
280 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
281 $this->tpl->setVariable(
"EXPLORER",$output);
282 $this->tpl->setVariable(
"ACTION",
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=".
$_GET[
"cmd"].
"&frame=".
$_GET[
"frame"].
283 "&ref_id=".$this->slm->getRefId().
"&scexpand=".
$_GET[
"scexpand"]);
284 $this->tpl->parseCurrentBlock();
293 if(is_object($sc_gui_object))
295 $sc_gui_object->view();
308 $this->tpl =
new ilTemplate(
"tpl.sahs_api.html",
true,
true,
"Modules/ScormAicc");
309 $this->tpl->setVariable(
"USER_ID",$ilias->account->getId());
310 $this->tpl->setVariable(
"USER_FIRSTNAME",$ilias->account->getFirstname());
311 $this->tpl->setVariable(
"USER_LASTNAME",$ilias->account->getLastname());
312 $this->tpl->setVariable(
"REF_ID",
$_GET[
"ref_id"]);
313 $this->tpl->setVariable(
"SESSION_ID",session_id());
315 $this->tpl->setVariable(
"CODE_BASE",
"http://".$_SERVER[
'SERVER_NAME'].substr($_SERVER[
'PHP_SELF'], 0, strpos ($_SERVER[
'PHP_SELF'],
"/ilias.php")));
316 $this->tpl->parseCurrentBlock();
318 $this->tpl->show(
false);
325 global $ilUser,
$ilDB;
327 $sco_id = (
$_GET[
"sahs_id"] ==
"")
336 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
337 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
340 $id_ref = $item->getIdentifierRef();
342 $resource->readByIdRef($id_ref, $item->getSLMId());
344 $href = $resource->getHref();
345 $this->tpl =
new ilTemplate(
"tpl.sahs_launch_cbt.html",
true,
true,
"Modules/ScormAicc");
346 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
349 $this->tpl->setVariable(
"LAUNCH_DATA", $item->getDataFromLms());
350 $this->tpl->setVariable(
"MAST_SCORE", $item->getMasteryScore());
351 $this->tpl->setVariable(
"MAX_TIME", $item->getMaxTimeAllowed());
352 $this->tpl->setVariable(
"LIMIT_ACT", $item->getTimeLimitAction());
355 if ($this->slm->getAPIAdapterName() !=
"API")
357 $this->tpl->setCurrentBlock(
"alt_api_ref");
358 $this->tpl->setVariable(
"API_NAME", $this->slm->getAPIAdapterName());
359 $this->tpl->parseCurrentBlock();
363 $val_set = $ilDB->queryF(
'
364 SELECT * FROM scorm_tracking
368 array(
'integer',
'integer',
'integer'),
369 array($ilUser->getId(),$sco_id,$this->slm->getId()));
373 while($val_rec = $ilDB->fetchAssoc($val_set))
375 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
376 $val_rec[
"rvalue"] = str_replace(
"\r",
"\n", $val_rec[
"rvalue"]);
377 $val_rec[
"rvalue"] = str_replace(
"\n",
"\\n", $val_rec[
"rvalue"]);
378 $re_value[$val_rec[
"lvalue"]] = $val_rec[
"rvalue"];
381 foreach($re_value as $var => $value)
385 case "cmi.core.lesson_location":
386 case "cmi.core.lesson_status":
387 case "cmi.core.entry":
388 case "cmi.core.score.raw":
389 case "cmi.core.score.max":
390 case "cmi.core.score.min":
391 case "cmi.core.total_time":
392 case "cmi.core.exit":
393 case "cmi.suspend_data":
395 case "cmi.student_preference.audio":
396 case "cmi.student_preference.language":
397 case "cmi.student_preference.speed":
398 case "cmi.student_preference.text":
402 case "cmi.objectives._count":
404 $this->
setArray(
"cmi.objectives", $value,
"id", $re_value);
405 $this->
setArray(
"cmi.objectives", $value,
"score.raw", $re_value);
406 $this->
setArray(
"cmi.objectives", $value,
"score.max", $re_value);
407 $this->
setArray(
"cmi.objectives", $value,
"score.min", $re_value);
408 $this->
setArray(
"cmi.objectives", $value,
"status", $re_value);
411 case "cmi.interactions._count":
413 $this->
setArray(
"cmi.interactions", $value,
"id", $re_value);
414 for($i=0; $i<$value; $i++)
416 $var2 =
"cmi.interactions.".$i.
".objectives._count";
417 if (isset($v_array[$var2]))
419 $cnt = $v_array[$var2];
420 $this->
setArray(
"cmi.interactions.".$i.
".objectives",
421 $cnt,
"id", $re_value);
433 $this->
setArray(
"cmi.interactions", $value,
"time", $re_value);
434 $this->
setArray(
"cmi.interactions", $value,
"type", $re_value);
435 for($i=0; $i<$value; $i++)
437 $var2 =
"cmi.interactions.".$i.
".correct_responses._count";
438 if (isset($v_array[$var2]))
440 $cnt = $v_array[$var2];
441 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
442 $cnt,
"pattern", $re_value);
443 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
444 $cnt,
"weighting", $re_value);
447 $this->
setArray(
"cmi.interactions", $value,
"student_response", $re_value);
448 $this->
setArray(
"cmi.interactions", $value,
"result", $re_value);
449 $this->
setArray(
"cmi.interactions", $value,
"latency", $re_value);
455 $this->tpl->setCurrentBlock(
"switch_icon");
456 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
458 $this->tpl->setVariable(
"SCO_ALT",
459 $lng->txt(
"cont_status").
": "
460 .$lng->txt(
"cont_sc_stat_running")
462 $this->tpl->parseCurrentBlock();
465 $lesson_mode = $this->slm->getDefaultLessonMode();
466 if ($this->slm->getAutoReview())
468 if ($re_value[
"cmi.core.lesson_status"] ==
"completed" ||
469 $re_value[
"cmi.core.lesson_status"] ==
"passed" ||
470 $re_value[
"cmi.core.lesson_status"] ==
"failed")
472 $lesson_mode =
"review";
475 $this->tpl->setVariable(
"LESSON_MODE", $lesson_mode);
478 if ($lesson_mode ==
"normal")
480 $this->tpl->setVariable(
"CREDIT_MODE",
481 str_replace(
"_",
"-", $this->slm->getCreditMode()));
485 $this->tpl->setVariable(
"CREDIT_MODE",
"no-credit");
490 if (!isset($re_value[
"cmi.core.total_time"]))
492 $item->insertTrackData(
"cmi.core.total_time",
"0000:00:00", $sahs_obj_id);
494 if (!isset($re_value[
"cmi.core.lesson_status"]))
496 $item->insertTrackData(
"cmi.core.lesson_status",
"not attempted", $sahs_obj_id);
498 if (!isset($re_value[
"cmi.core.entry"]))
500 $item->insertTrackData(
"cmi.core.entry",
"", $sahs_obj_id);
509 $this->tpl =
new ilTemplate(
"tpl.sahs_finish_cbt.html",
true,
true,
"Modules/ScormAicc");
512 $this->tpl->setCurrentBlock(
"switch_icon");
513 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
515 "scorm/".str_replace(
" ",
"_",
$_GET[
"status"]).
'.gif')
517 $this->tpl->setVariable(
"SCO_ALT",
518 $lng->txt(
"cont_status").
": "
519 .$lng->txt(
"cont_sc_stat_".str_replace(
" ",
"_",
$_GET[
"status"])).
", "
520 .$lng->txt(
"cont_total_time").
": "
523 $this->tpl->setVariable(
"SCO_LAUNCH_ID",
$_GET[
"launch"]);
524 $this->tpl->parseCurrentBlock();
530 $this->tpl =
new ilTemplate(
"tpl.sahs_unload_cbt.html",
true,
true,
"Modules/ScormAicc");
532 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
539 global $ilUser,
$ilDB;
541 $sco_id = (
$_GET[
"asset_id"] ==
"")
550 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
551 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
554 $id_ref = $item->getIdentifierRef();
556 $resource->readByIdRef($id_ref, $item->getSLMId());
557 $href = $resource->getHref();
558 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
559 $this->tpl =
new ilTemplate(
"tpl.scorm_launch_asset.html",
true,
true,
"Modules/ScormAicc");
560 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
570 $this->tpl->setCurrentBlock(
"set_value");
571 $this->tpl->setVariable(
"VAR", $a_var);
572 $this->tpl->setVariable(
"VALUE", $a_value);
573 $this->tpl->parseCurrentBlock();
579 function setArray($a_left, $a_value, $a_name, &$v_array)
581 for($i=0; $i<$a_value; $i++)
583 $var = $a_left.
".".$i.
".".$a_name;
584 if (isset($v_array[$var]))
586 $this->tpl->setCurrentBlock(
"set_value");
587 $this->tpl->setVariable(
"VAR", $var);
588 $this->tpl->setVariable(
"VALUE", $v_array[$var]);
589 $this->tpl->parseCurrentBlock();
601 $this->ctrl->setCmd(
"showSummary");
602 $this->ctrl->setCmdClass(
"ilinfoscreengui");
627 $this->tpl->getStandardTemplate();
628 $this->tpl->setTitle($this->slm_gui->object->getTitle());
631 $ilLocator->addRepositoryItems();
632 $ilLocator->addItem($this->slm_gui->object->getTitle(),
633 $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
635 $this->tpl->setLocator();
637 $this->lng->loadLanguageModule(
"meta");
639 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
642 $info->enablePrivateNotes();
646 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
648 $info->enableNewsEditing();
650 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
651 if ($enable_internal_rss)
653 $info->setBlockProperty(
"news",
"settings",
true);
658 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
660 $info->addButton($this->lng->txt(
"view"),
661 $this->ctrl->getLinkTarget($this,
""),
662 ' target="ilContObj'.$this->slm_gui->object->getId().
'" ');
666 $info->addMetaDataSections($this->slm_gui->object->getId(),0,
667 $this->slm_gui->object->getType());
678 $this->ctrl->forwardCommand($info);