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();
110 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
115 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
120 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php");
125 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php");
130 if ($next_class !=
"ilinfoscreengui" &&
131 $cmd !=
"infoScreen")
137 $this->ctrl->setCmdClass(
"ilscorm13player");
142 $this->ctrl->setCmdClass(
"ilscormpresentationgui");
147 $this->ctrl->setCmdClass(
"ilaiccpresentationgui");
151 $this->ctrl->setCmdClass(
"ilhacppresentationgui");
154 $next_class = $this->ctrl->getNextClass($this);
159 case "ilinfoscreengui":
163 case "ilscorm13player":
164 require_once
"./Modules/Scorm2004/classes/ilSCORM13Player.php";
166 $ret =& $this->ctrl->forwardCommand($scorm_gui);
169 case "ilscormpresentationgui":
170 require_once
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
172 $ret =& $this->ctrl->forwardCommand($scorm_gui);
175 case "ilaiccpresentationgui":
176 require_once
"./Modules/ScormAicc/classes/AICC/class.ilAICCPresentationGUI.php";
178 $ret =& $this->ctrl->forwardCommand($aicc_gui);
181 case "ilhacppresentationgui":
182 require_once
"./Modules/ScormAicc/classes/HACP/class.ilHACPPresentationGUI.php";
184 $ret =& $this->ctrl->forwardCommand($hacp_gui);
196 if(!is_array($a_attributes))
200 foreach ($a_attributes as $attribute)
202 $attr[$attribute->name()] = $attribute->value();
213 $this->tpl =
new ilTemplate(
"tpl.sahs_pres_frameset.html",
false,
false,
"Modules/ScormAicc");
214 $this->tpl->setVariable(
"REF_ID",$this->slm->getRefId());
215 $this->tpl->show(
"DEFAULT",
false);
227 $ilBench->start(
"SAHSExplorer",
"initExplorer");
229 $this->tpl =
new ilTemplate(
"tpl.sahs_exp_main.html",
true,
true,
"Modules/ScormAicc");
231 require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
232 $exp =
new ilSCORMExplorer(
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=".$this->slm->getRefId(), $this->slm);
234 $exp->setFrameTarget($a_target);
238 if (
$_GET[
"scexpand"] ==
"")
245 $expanded =
$_GET[
"scexpand"];
247 $exp->setExpand($expanded);
249 $exp->forceExpandAll(
true,
false);
253 $ilBench->stop(
"SAHSExplorer",
"initExplorer");
256 $ilBench->start(
"SAHSExplorer",
"setOutput");
258 $ilBench->stop(
"SAHSExplorer",
"setOutput");
260 $ilBench->start(
"SAHSExplorer",
"getOutput");
261 $output = $exp->getOutput();
262 $ilBench->stop(
"SAHSExplorer",
"getOutput");
265 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.sahs_explorer.html",
"Modules/ScormAicc");
267 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
268 $this->tpl->setVariable(
"EXPLORER",$output);
269 $this->tpl->setVariable(
"ACTION",
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=".
$_GET[
"cmd"].
"&frame=".
$_GET[
"frame"].
270 "&ref_id=".$this->slm->getRefId().
"&scexpand=".
$_GET[
"scexpand"]);
271 $this->tpl->parseCurrentBlock();
280 if(is_object($sc_gui_object))
282 $sc_gui_object->view();
295 $this->tpl =
new ilTemplate(
"tpl.sahs_api.html",
true,
true,
"Modules/ScormAicc");
296 $this->tpl->setVariable(
"USER_ID",$ilias->account->getId());
297 $this->tpl->setVariable(
"USER_FIRSTNAME",$ilias->account->getFirstname());
298 $this->tpl->setVariable(
"USER_LASTNAME",$ilias->account->getLastname());
299 $this->tpl->setVariable(
"REF_ID",
$_GET[
"ref_id"]);
300 $this->tpl->setVariable(
"SESSION_ID",session_id());
302 $this->tpl->setVariable(
"CODE_BASE",
"http://".$_SERVER[
'SERVER_NAME'].substr($_SERVER[
'PHP_SELF'], 0, strpos ($_SERVER[
'PHP_SELF'],
"/ilias.php")));
303 $this->tpl->parseCurrentBlock();
305 $this->tpl->show(
false);
311 global $ilUser, $ilDB;
313 $sco_id = (
$_GET[
"sahs_id"] ==
"")
322 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
323 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
326 $id_ref = $item->getIdentifierRef();
328 $resource->readByIdRef($id_ref, $item->getSLMId());
330 $href = $resource->getHref();
331 $this->tpl =
new ilTemplate(
"tpl.sahs_launch_cbt.html",
true,
true,
"Modules/ScormAicc");
332 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
335 $this->tpl->setVariable(
"LAUNCH_DATA", $item->getDataFromLms());
336 $this->tpl->setVariable(
"MAST_SCORE", $item->getMasteryScore());
337 $this->tpl->setVariable(
"MAX_TIME", $item->getMaxTimeAllowed());
338 $this->tpl->setVariable(
"LIMIT_ACT", $item->getTimeLimitAction());
341 if ($this->slm->getAPIAdapterName() !=
"API")
343 $this->tpl->setCurrentBlock(
"alt_api_ref");
344 $this->tpl->setVariable(
"API_NAME", $this->slm->getAPIAdapterName());
345 $this->tpl->parseCurrentBlock();
348 $query =
"SELECT * FROM scorm_tracking WHERE".
349 " user_id = ".$ilDB->quote($ilUser->getId()).
350 " AND sco_id = ".$ilDB->quote($sco_id).
351 " AND obj_id = ".$ilDB->quote($this->slm->getId());
354 $val_set = $ilDB->query($query);
358 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
359 $val_rec[
"rvalue"] = str_replace(
"\r",
"\n", $val_rec[
"rvalue"]);
360 $val_rec[
"rvalue"] = str_replace(
"\n",
"\\n", $val_rec[
"rvalue"]);
361 $re_value[$val_rec[
"lvalue"]] = $val_rec[
"rvalue"];
364 foreach($re_value as $var => $value)
368 case "cmi.core.lesson_location":
369 case "cmi.core.lesson_status":
370 case "cmi.core.entry":
371 case "cmi.core.score.raw":
372 case "cmi.core.score.max":
373 case "cmi.core.score.min":
374 case "cmi.core.total_time":
375 case "cmi.core.exit":
376 case "cmi.suspend_data":
378 case "cmi.student_preference.audio":
379 case "cmi.student_preference.language":
380 case "cmi.student_preference.speed":
381 case "cmi.student_preference.text":
385 case "cmi.objectives._count":
387 $this->
setArray(
"cmi.objectives", $value,
"id", $re_value);
388 $this->
setArray(
"cmi.objectives", $value,
"score.raw", $re_value);
389 $this->
setArray(
"cmi.objectives", $value,
"score.max", $re_value);
390 $this->
setArray(
"cmi.objectives", $value,
"score.min", $re_value);
391 $this->
setArray(
"cmi.objectives", $value,
"status", $re_value);
394 case "cmi.interactions._count":
396 $this->
setArray(
"cmi.interactions", $value,
"id", $re_value);
397 for($i=0; $i<$value; $i++)
399 $var2 =
"cmi.interactions.".$i.
".objectives._count";
400 if (isset($v_array[$var2]))
402 $cnt = $v_array[$var2];
403 $this->
setArray(
"cmi.interactions.".$i.
".objectives",
404 $cnt,
"id", $re_value);
416 $this->
setArray(
"cmi.interactions", $value,
"time", $re_value);
417 $this->
setArray(
"cmi.interactions", $value,
"type", $re_value);
418 for($i=0; $i<$value; $i++)
420 $var2 =
"cmi.interactions.".$i.
".correct_responses._count";
421 if (isset($v_array[$var2]))
423 $cnt = $v_array[$var2];
424 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
425 $cnt,
"pattern", $re_value);
426 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
427 $cnt,
"weighting", $re_value);
430 $this->
setArray(
"cmi.interactions", $value,
"student_response", $re_value);
431 $this->
setArray(
"cmi.interactions", $value,
"result", $re_value);
432 $this->
setArray(
"cmi.interactions", $value,
"latency", $re_value);
438 $this->tpl->setCurrentBlock(
"switch_icon");
439 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
441 $this->tpl->setVariable(
"SCO_ALT",
442 $lng->txt(
"cont_status").
": "
443 .$lng->txt(
"cont_sc_stat_running")
445 $this->tpl->parseCurrentBlock();
448 $lesson_mode = $this->slm->getDefaultLessonMode();
449 if ($this->slm->getAutoReview())
451 if ($re_value[
"cmi.core.lesson_status"] ==
"completed" ||
452 $re_value[
"cmi.core.lesson_status"] ==
"passed" ||
453 $re_value[
"cmi.core.lesson_status"] ==
"failed")
455 $lesson_mode =
"review";
458 $this->tpl->setVariable(
"LESSON_MODE", $lesson_mode);
461 if ($lesson_mode ==
"normal")
463 $this->tpl->setVariable(
"CREDIT_MODE",
464 str_replace(
"_",
"-", $this->slm->getCreditMode()));
468 $this->tpl->setVariable(
"CREDIT_MODE",
"no-credit");
473 if (!isset($re_value[
"cmi.core.total_time"]))
475 $item->insertTrackData(
"cmi.core.total_time",
"0000:00:00", $sahs_obj_id);
477 if (!isset($re_value[
"cmi.core.lesson_status"]))
479 $item->insertTrackData(
"cmi.core.lesson_status",
"not attempted", $sahs_obj_id);
481 if (!isset($re_value[
"cmi.core.entry"]))
483 $item->insertTrackData(
"cmi.core.entry",
"", $sahs_obj_id);
492 $this->tpl =
new ilTemplate(
"tpl.sahs_finish_cbt.html",
true,
true,
"Modules/ScormAicc");
495 $this->tpl->setCurrentBlock(
"switch_icon");
496 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
498 "scorm/".str_replace(
" ",
"_",
$_GET[
"status"]).
'.gif')
500 $this->tpl->setVariable(
"SCO_ALT",
501 $lng->txt(
"cont_status").
": "
502 .$lng->txt(
"cont_sc_stat_".str_replace(
" ",
"_",
$_GET[
"status"])).
", "
503 .$lng->txt(
"cont_total_time").
": "
506 $this->tpl->setVariable(
"SCO_LAUNCH_ID",
$_GET[
"launch"]);
507 $this->tpl->parseCurrentBlock();
513 $this->tpl =
new ilTemplate(
"tpl.sahs_unload_cbt.html",
true,
true,
"Modules/ScormAicc");
515 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
522 global $ilUser, $ilDB;
524 $sco_id = (
$_GET[
"asset_id"] ==
"")
533 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
534 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
537 $id_ref = $item->getIdentifierRef();
539 $resource->readByIdRef($id_ref, $item->getSLMId());
540 $href = $resource->getHref();
541 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
542 $this->tpl =
new ilTemplate(
"tpl.scorm_launch_asset.html",
true,
true,
"Modules/ScormAicc");
543 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
553 $this->tpl->setCurrentBlock(
"set_value");
554 $this->tpl->setVariable(
"VAR", $a_var);
555 $this->tpl->setVariable(
"VALUE", $a_value);
556 $this->tpl->parseCurrentBlock();
562 function setArray($a_left, $a_value, $a_name, &$v_array)
564 for($i=0; $i<$a_value; $i++)
566 $var = $a_left.
".".$i.
".".$a_name;
567 if (isset($v_array[$var]))
569 $this->tpl->setCurrentBlock(
"set_value");
570 $this->tpl->setVariable(
"VAR", $var);
571 $this->tpl->setVariable(
"VALUE", $v_array[$var]);
572 $this->tpl->parseCurrentBlock();
584 $this->ctrl->setCmd(
"showSummary");
585 $this->ctrl->setCmdClass(
"ilinfoscreengui");
610 $this->tpl->getStandardTemplate();
611 $this->tpl->setTitle($this->slm_gui->object->getTitle());
614 $ilLocator->addRepositoryItems();
615 $ilLocator->addItem($this->slm_gui->object->getTitle(),
616 $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
618 $this->tpl->setLocator();
620 $this->lng->loadLanguageModule(
"meta");
622 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
625 $info->enablePrivateNotes();
629 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
631 $info->enableNewsEditing();
633 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
634 if ($enable_internal_rss)
636 $info->setBlockProperty(
"news",
"settings",
true);
641 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
643 $info->addButton($this->lng->txt(
"view"),
644 $this->ctrl->getLinkTarget($this,
""),
645 ' target="ilContObj'.$this->slm_gui->object->getId().
'" ');
649 $info->addMetaDataSections($this->slm_gui->object->getId(),0,
650 $this->slm_gui->object->getType());
661 $this->ctrl->forwardCommand($info);