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");
52 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
54 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
55 "ilias.php?cmd=infoScreen&baseClass=ilSAHSPresentationGUI&ref_id=".
$_GET[
"ref_id"],
"lm");
58 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
62 $ilLocator->addRepositoryItems();
63 $ilLocator->addItem($ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId(
$_GET[
'ref_id'])),
64 'ilias.php?baseClass=ilSAHSPresentationGUI&ref_id='.
$_GET[
'ref_id'],
68 $this->tpl->setLocator();
69 $this->tpl->getStandardTemplate();
71 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
72 $this->ctrl->setReturn($this,
'');
74 $this->ctrl->forwardCommand($pp_gui);
79 include_once
'./classes/class.ilSearch.php';
81 $next_class = $this->ctrl->getNextClass($this);
82 $cmd = $this->ctrl->getCmd();
87 if (
$cmd ==
"downloadCertificate")
89 require_once
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
91 $ret =& $this->ctrl->forwardCommand($scorm_gui);
98 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
103 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
108 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php");
113 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php");
118 if ($next_class !=
"ilinfoscreengui" &&
119 $cmd !=
"infoScreen")
121 include_once(
"./Services/License/classes/class.ilLicense.php");
127 $this->ctrl->setCmdClass(
"ilscorm13player");
132 $this->ctrl->setCmdClass(
"ilscormpresentationgui");
137 $this->ctrl->setCmdClass(
"ilaiccpresentationgui");
141 $this->ctrl->setCmdClass(
"ilhacppresentationgui");
144 $next_class = $this->ctrl->getNextClass($this);
149 case "ilinfoscreengui":
153 case "ilscorm13player":
154 require_once
"./Modules/Scorm2004/classes/ilSCORM13Player.php";
157 $ret =& $this->ctrl->forwardCommand($scorm_gui);
160 case "ilscormpresentationgui":
161 require_once
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
163 $ret =& $this->ctrl->forwardCommand($scorm_gui);
166 case "ilaiccpresentationgui":
167 require_once
"./Modules/ScormAicc/classes/AICC/class.ilAICCPresentationGUI.php";
169 $ret =& $this->ctrl->forwardCommand($aicc_gui);
172 case "ilhacppresentationgui":
173 require_once
"./Modules/ScormAicc/classes/HACP/class.ilHACPPresentationGUI.php";
175 $ret =& $this->ctrl->forwardCommand($hacp_gui);
188 if(!is_array($a_attributes))
192 foreach ($a_attributes as $attribute)
194 $attr[$attribute->name()] = $attribute->value();
207 $this->tpl =
new ilTemplate(
"tpl.sahs_pres_frameset.html",
false,
false,
"Modules/ScormAicc");
208 $this->tpl->setVariable(
"REF_ID",$this->slm->getRefId());
209 $this->tpl->show(
"DEFAULT",
false);
221 $ilBench->start(
"SAHSExplorer",
"initExplorer");
223 $this->tpl =
new ilTemplate(
"tpl.sahs_exp_main.html",
true,
true,
"Modules/ScormAicc");
225 require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
226 $exp =
new ilSCORMExplorer(
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=".$this->slm->getRefId(), $this->slm);
228 $exp->setFrameTarget($a_target);
232 if (
$_GET[
"scexpand"] ==
"")
239 $expanded =
$_GET[
"scexpand"];
241 $exp->setExpand($expanded);
243 $exp->forceExpandAll(
true,
false);
247 $ilBench->stop(
"SAHSExplorer",
"initExplorer");
250 $ilBench->start(
"SAHSExplorer",
"setOutput");
252 $ilBench->stop(
"SAHSExplorer",
"setOutput");
254 $ilBench->start(
"SAHSExplorer",
"getOutput");
255 $output = $exp->getOutput();
256 $ilBench->stop(
"SAHSExplorer",
"getOutput");
259 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.sahs_explorer.html",
"Modules/ScormAicc");
261 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
262 $this->tpl->setVariable(
"EXPLORER",$output);
263 $this->tpl->setVariable(
"ACTION",
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=".
$_GET[
"cmd"].
"&frame=".
$_GET[
"frame"].
264 "&ref_id=".$this->slm->getRefId().
"&scexpand=".
$_GET[
"scexpand"]);
265 $this->tpl->parseCurrentBlock();
274 if(is_object($sc_gui_object))
276 $sc_gui_object->view();
289 $this->tpl =
new ilTemplate(
"tpl.sahs_api.html",
true,
true,
"Modules/ScormAicc");
290 $this->tpl->setVariable(
"USER_ID",$ilias->account->getId());
291 $this->tpl->setVariable(
"USER_FIRSTNAME",$ilias->account->getFirstname());
292 $this->tpl->setVariable(
"USER_LASTNAME",$ilias->account->getLastname());
293 $this->tpl->setVariable(
"REF_ID",
$_GET[
"ref_id"]);
294 $this->tpl->setVariable(
"SESSION_ID",session_id());
296 $this->tpl->setVariable(
"CODE_BASE",
"http://".$_SERVER[
'SERVER_NAME'].substr($_SERVER[
'PHP_SELF'], 0, strpos ($_SERVER[
'PHP_SELF'],
"/ilias.php")));
297 $this->tpl->parseCurrentBlock();
299 $this->tpl->show(
false);
306 global $ilUser,
$ilDB;
308 $sco_id = (
$_GET[
"sahs_id"] ==
"")
317 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
318 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
321 $id_ref = $item->getIdentifierRef();
323 $resource->readByIdRef($id_ref, $item->getSLMId());
325 $href = $resource->getHref();
326 $this->tpl =
new ilTemplate(
"tpl.sahs_launch_cbt.html",
true,
true,
"Modules/ScormAicc");
327 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
330 $this->tpl->setVariable(
"LAUNCH_DATA", $item->getDataFromLms());
331 $this->tpl->setVariable(
"MAST_SCORE", $item->getMasteryScore());
332 $this->tpl->setVariable(
"MAX_TIME", $item->getMaxTimeAllowed());
333 $this->tpl->setVariable(
"LIMIT_ACT", $item->getTimeLimitAction());
336 if ($this->slm->getAPIAdapterName() !=
"API")
338 $this->tpl->setCurrentBlock(
"alt_api_ref");
339 $this->tpl->setVariable(
"API_NAME", $this->slm->getAPIAdapterName());
340 $this->tpl->parseCurrentBlock();
344 $val_set = $ilDB->queryF(
'
345 SELECT * FROM scorm_tracking
349 array(
'integer',
'integer',
'integer'),
350 array($ilUser->getId(),$sco_id,$this->slm->getId()));
354 while($val_rec = $ilDB->fetchAssoc($val_set))
356 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
357 $val_rec[
"rvalue"] = str_replace(
"\r",
"\n", $val_rec[
"rvalue"]);
358 $val_rec[
"rvalue"] = str_replace(
"\n",
"\\n", $val_rec[
"rvalue"]);
359 $re_value[$val_rec[
"lvalue"]] = $val_rec[
"rvalue"];
362 foreach($re_value as $var => $value)
366 case "cmi.core.lesson_location":
367 case "cmi.core.lesson_status":
368 case "cmi.core.entry":
369 case "cmi.core.score.raw":
370 case "cmi.core.score.max":
371 case "cmi.core.score.min":
372 case "cmi.core.total_time":
373 case "cmi.core.exit":
374 case "cmi.suspend_data":
376 case "cmi.student_preference.audio":
377 case "cmi.student_preference.language":
378 case "cmi.student_preference.speed":
379 case "cmi.student_preference.text":
383 case "cmi.objectives._count":
385 $this->
setArray(
"cmi.objectives", $value,
"id", $re_value);
386 $this->
setArray(
"cmi.objectives", $value,
"score.raw", $re_value);
387 $this->
setArray(
"cmi.objectives", $value,
"score.max", $re_value);
388 $this->
setArray(
"cmi.objectives", $value,
"score.min", $re_value);
389 $this->
setArray(
"cmi.objectives", $value,
"status", $re_value);
392 case "cmi.interactions._count":
394 $this->
setArray(
"cmi.interactions", $value,
"id", $re_value);
395 for($i=0; $i<$value; $i++)
397 $var2 =
"cmi.interactions.".$i.
".objectives._count";
398 if (isset($v_array[$var2]))
400 $cnt = $v_array[$var2];
401 $this->
setArray(
"cmi.interactions.".$i.
".objectives",
402 $cnt,
"id", $re_value);
414 $this->
setArray(
"cmi.interactions", $value,
"time", $re_value);
415 $this->
setArray(
"cmi.interactions", $value,
"type", $re_value);
416 for($i=0; $i<$value; $i++)
418 $var2 =
"cmi.interactions.".$i.
".correct_responses._count";
419 if (isset($v_array[$var2]))
421 $cnt = $v_array[$var2];
422 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
423 $cnt,
"pattern", $re_value);
424 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
425 $cnt,
"weighting", $re_value);
428 $this->
setArray(
"cmi.interactions", $value,
"student_response", $re_value);
429 $this->
setArray(
"cmi.interactions", $value,
"result", $re_value);
430 $this->
setArray(
"cmi.interactions", $value,
"latency", $re_value);
436 $this->tpl->setCurrentBlock(
"switch_icon");
437 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
439 $this->tpl->setVariable(
"SCO_ALT",
440 $lng->txt(
"cont_status").
": "
441 .$lng->txt(
"cont_sc_stat_running")
443 $this->tpl->parseCurrentBlock();
446 $lesson_mode = $this->slm->getDefaultLessonMode();
447 if ($this->slm->getAutoReview())
449 if ($re_value[
"cmi.core.lesson_status"] ==
"completed" ||
450 $re_value[
"cmi.core.lesson_status"] ==
"passed" ||
451 $re_value[
"cmi.core.lesson_status"] ==
"failed")
453 $lesson_mode =
"review";
456 $this->tpl->setVariable(
"LESSON_MODE", $lesson_mode);
459 if ($lesson_mode ==
"normal")
461 $this->tpl->setVariable(
"CREDIT_MODE",
462 str_replace(
"_",
"-", $this->slm->getCreditMode()));
466 $this->tpl->setVariable(
"CREDIT_MODE",
"no-credit");
471 if (!isset($re_value[
"cmi.core.total_time"]))
473 $item->insertTrackData(
"cmi.core.total_time",
"0000:00:00", $sahs_obj_id);
475 if (!isset($re_value[
"cmi.core.lesson_status"]))
477 $item->insertTrackData(
"cmi.core.lesson_status",
"not attempted", $sahs_obj_id);
479 if (!isset($re_value[
"cmi.core.entry"]))
481 $item->insertTrackData(
"cmi.core.entry",
"", $sahs_obj_id);
490 $this->tpl =
new ilTemplate(
"tpl.sahs_finish_cbt.html",
true,
true,
"Modules/ScormAicc");
493 $this->tpl->setCurrentBlock(
"switch_icon");
494 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
496 "scorm/".str_replace(
" ",
"_",
$_GET[
"status"]).
'.gif')
498 $this->tpl->setVariable(
"SCO_ALT",
499 $lng->txt(
"cont_status").
": "
500 .$lng->txt(
"cont_sc_stat_".str_replace(
" ",
"_",
$_GET[
"status"])).
", "
501 .$lng->txt(
"cont_total_time").
": "
504 $this->tpl->setVariable(
"SCO_LAUNCH_ID",
$_GET[
"launch"]);
505 $this->tpl->parseCurrentBlock();
511 $this->tpl =
new ilTemplate(
"tpl.sahs_unload_cbt.html",
true,
true,
"Modules/ScormAicc");
513 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
520 global $ilUser,
$ilDB;
522 $sco_id = (
$_GET[
"asset_id"] ==
"")
531 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
532 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
535 $id_ref = $item->getIdentifierRef();
537 $resource->readByIdRef($id_ref, $item->getSLMId());
538 $href = $resource->getHref();
539 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
540 $this->tpl =
new ilTemplate(
"tpl.scorm_launch_asset.html",
true,
true,
"Modules/ScormAicc");
541 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
551 $this->tpl->setCurrentBlock(
"set_value");
552 $this->tpl->setVariable(
"VAR", $a_var);
553 $this->tpl->setVariable(
"VALUE", $a_value);
554 $this->tpl->parseCurrentBlock();
560 function setArray($a_left, $a_value, $a_name, &$v_array)
562 for($i=0; $i<$a_value; $i++)
564 $var = $a_left.
".".$i.
".".$a_name;
565 if (isset($v_array[$var]))
567 $this->tpl->setCurrentBlock(
"set_value");
568 $this->tpl->setVariable(
"VAR", $var);
569 $this->tpl->setVariable(
"VALUE", $v_array[$var]);
570 $this->tpl->parseCurrentBlock();
582 $this->ctrl->setCmd(
"showSummary");
583 $this->ctrl->setCmdClass(
"ilinfoscreengui");
608 $this->tpl->getStandardTemplate();
609 $this->tpl->setTitle($this->slm_gui->object->getTitle());
612 $ilLocator->addRepositoryItems();
613 $ilLocator->addItem($this->slm_gui->object->getTitle(),
614 $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
616 $this->tpl->setLocator();
618 $this->lng->loadLanguageModule(
"meta");
620 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
623 $info->enablePrivateNotes();
627 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
629 $info->enableNewsEditing();
631 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
632 if ($enable_internal_rss)
634 $info->setBlockProperty(
"news",
"settings",
true);
639 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
641 $info->addButton($this->lng->txt(
"view"),
642 $this->ctrl->getLinkTarget($this,
""),
643 ' target="ilContObj'.$this->slm_gui->object->getId().
'" ');
647 $info->addMetaDataSections($this->slm_gui->object->getId(),0,
648 $this->slm_gui->object->getType());
659 $this->ctrl->forwardCommand($info);