36 $this->ctrl->saveParameter($this,
"ref_id");
44 global
$lng,$ilAccess, $ilNavigationHistory,
$ilCtrl, $ilLocator, $ilObjDataCache;
46 include_once
"./Services/Object/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"])) {
54 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
58 $ilNavigationHistory->addItem(
60 "ilias.php?cmd=infoScreen&baseClass=ilSAHSPresentationGUI&ref_id=" .
$_GET[
"ref_id"],
66 $next_class = $this->ctrl->getNextClass($this);
67 $cmd = $this->ctrl->getCmd();
71 if ($cmd ==
"downloadCertificate") {
72 require_once
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
74 $ret = $this->ctrl->forwardCommand($scorm_gui);
77 if (substr($cmd, 0, 11) ==
"offlineMode" || $this->offline_mode) {
78 $next_class =
"ilscormofflinemodegui";
81 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
84 if ($next_class !=
"ilinfoscreengui" &&
85 $cmd !=
"infoScreen" &&
86 $next_class !=
"ilobjscorm2004learningmodulegui" &&
87 $next_class !=
"ilobjscormlearningmodulegui" &&
88 $next_class !=
"ilscormofflinemodegui" &&
89 $next_class !=
"illearningprogressgui") {
90 include_once(
"./Services/License/classes/class.ilLicense.php");
94 $this->ctrl->setCmdClass(
"ilscorm13player");
99 $this->ctrl->setCmdClass(
"ilscormpresentationgui");
103 $next_class = $this->ctrl->getNextClass($this);
106 switch ($next_class) {
107 case "ilinfoscreengui":
111 case "ilscorm13player":
112 require_once
"./Modules/Scorm2004/classes/ilSCORM13Player.php";
114 $ret = $this->ctrl->forwardCommand($scorm_gui);
117 case "ilscormpresentationgui":
118 require_once
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
120 $ret = $this->ctrl->forwardCommand($scorm_gui);
124 case "illearningprogressgui":
126 include_once
"./Services/Tracking/classes/class.ilLearningProgressGUI.php";
128 $this->ctrl->forwardCommand($new_gui);
132 case "ilscormofflinemodegui":
133 include_once
"./Modules/ScormAicc/classes/class.ilSCORMOfflineModeGUI.php";
135 $this->ctrl->forwardCommand($new_gui);
138 case "ilobjscorm2004learningmodulegui":
139 include_once
'./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModuleGUI.php';
141 $this->ctrl->forwardCommand($new_gui);
146 case "ilobjscormlearningmodulegui":
147 include_once
'./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php';
149 $this->ctrl->forwardCommand($new_gui);
163 if (!is_array($a_attributes)) {
166 foreach ($a_attributes as $attribute) {
167 $attr[$attribute->name()] = $attribute->value();
180 $this->tpl =
new ilTemplate(
"tpl.sahs_pres_frameset.html",
false,
false,
"Modules/ScormAicc");
181 $this->tpl->setVariable(
"REF_ID", $this->slm->getRefId());
182 $this->tpl->show(
"DEFAULT",
false);
190 public function explorer($a_target =
"sahs_content")
194 $ilBench->start(
"SAHSExplorer",
"initExplorer");
196 $this->tpl =
new ilTemplate(
"tpl.sahs_exp_main.html",
true,
true,
"Modules/ScormAicc");
198 require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
199 $exp =
new ilSCORMExplorer(
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=" . $this->slm->getRefId(), $this->slm);
201 $exp->setFrameTarget($a_target);
205 if (
$_GET[
"scexpand"] ==
"") {
209 $expanded =
$_GET[
"scexpand"];
211 $exp->setExpand($expanded);
213 $exp->forceExpandAll(
true,
false);
217 $ilBench->stop(
"SAHSExplorer",
"initExplorer");
220 $ilBench->start(
"SAHSExplorer",
"setOutput");
222 $ilBench->stop(
"SAHSExplorer",
"setOutput");
224 $ilBench->start(
"SAHSExplorer",
"getOutput");
226 $ilBench->stop(
"SAHSExplorer",
"getOutput");
229 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.sahs_explorer.html",
"Modules/ScormAicc");
231 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
232 $this->tpl->setVariable(
"EXPLORER",
$output);
233 $this->tpl->setVariable(
"ACTION",
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=" .
$_GET[
"cmd"] .
"&frame=" .
$_GET[
"frame"] .
234 "&ref_id=" . $this->slm->getRefId() .
"&scexpand=" .
$_GET[
"scexpand"]);
235 $this->tpl->parseCurrentBlock();
244 if (is_object($sc_gui_object)) {
245 $sc_gui_object->view();
258 $this->tpl =
new ilTemplate(
"tpl.sahs_api.html",
true,
true,
"Modules/ScormAicc");
259 $this->tpl->setVariable(
"USER_ID", $ilias->account->getId());
260 $this->tpl->setVariable(
"USER_FIRSTNAME", $ilias->account->getFirstname());
261 $this->tpl->setVariable(
"USER_LASTNAME", $ilias->account->getLastname());
262 $this->tpl->setVariable(
"REF_ID",
$_GET[
"ref_id"]);
263 $this->tpl->setVariable(
"SESSION_ID", session_id());
265 $this->tpl->setVariable(
"CODE_BASE",
"http://" .
$_SERVER[
'SERVER_NAME'] . substr(
$_SERVER[
'PHP_SELF'], 0, strpos(
$_SERVER[
'PHP_SELF'],
"/ilias.php")));
266 $this->tpl->parseCurrentBlock();
268 $this->tpl->show(
false);
276 $sco_id = (
$_GET[
"sahs_id"] ==
"")
279 $ref_id = (
$_GET[
"ref_id"] ==
"")
285 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
286 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
289 $id_ref = $item->getIdentifierRef();
291 $resource->readByIdRef($id_ref, $item->getSLMId());
293 $href = $resource->getHref();
294 $this->tpl =
new ilTemplate(
"tpl.sahs_launch_cbt.html",
true,
true,
"Modules/ScormAicc");
295 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output") .
"/" . $href);
298 $this->tpl->setVariable(
"LAUNCH_DATA", $item->getDataFromLms());
299 $this->tpl->setVariable(
"MAST_SCORE", $item->getMasteryScore());
300 $this->tpl->setVariable(
"MAX_TIME", $item->getMaxTimeAllowed());
301 $this->tpl->setVariable(
"LIMIT_ACT", $item->getTimeLimitAction());
304 if ($this->slm->getAPIAdapterName() !=
"API") {
305 $this->tpl->setCurrentBlock(
"alt_api_ref");
306 $this->tpl->setVariable(
"API_NAME", $this->slm->getAPIAdapterName());
307 $this->tpl->parseCurrentBlock();
310 $val_set = $ilDB->queryF(
312 SELECT * FROM scorm_tracking 316 array(
'integer',
'integer',
'integer'),
317 array($ilUser->getId(),$sco_id,$this->slm->getId())
322 while ($val_rec = $ilDB->fetchAssoc($val_set)) {
323 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
324 $val_rec[
"rvalue"] = str_replace(
"\r",
"\n", $val_rec[
"rvalue"]);
325 $val_rec[
"rvalue"] = str_replace(
"\n",
"\\n", $val_rec[
"rvalue"]);
326 $re_value[$val_rec[
"lvalue"]] = $val_rec[
"rvalue"];
329 foreach ($re_value as $var => $value) {
331 case "cmi.core.lesson_location":
332 case "cmi.core.lesson_status":
333 case "cmi.core.entry":
334 case "cmi.core.score.raw":
335 case "cmi.core.score.max":
336 case "cmi.core.score.min":
337 case "cmi.core.total_time":
338 case "cmi.core.exit":
339 case "cmi.suspend_data":
341 case "cmi.student_preference.audio":
342 case "cmi.student_preference.language":
343 case "cmi.student_preference.speed":
344 case "cmi.student_preference.text":
348 case "cmi.objectives._count":
350 $this->
setArray(
"cmi.objectives", $value,
"id", $re_value);
351 $this->
setArray(
"cmi.objectives", $value,
"score.raw", $re_value);
352 $this->
setArray(
"cmi.objectives", $value,
"score.max", $re_value);
353 $this->
setArray(
"cmi.objectives", $value,
"score.min", $re_value);
354 $this->
setArray(
"cmi.objectives", $value,
"status", $re_value);
357 case "cmi.interactions._count":
359 $this->
setArray(
"cmi.interactions", $value,
"id", $re_value);
360 for (
$i=0;
$i<$value;
$i++) {
361 $var2 =
"cmi.interactions." .
$i .
".objectives._count";
362 if (isset($v_array[$var2])) {
363 $cnt = $v_array[$var2];
365 "cmi.interactions." .
$i .
".objectives",
381 $this->
setArray(
"cmi.interactions", $value,
"time", $re_value);
382 $this->
setArray(
"cmi.interactions", $value,
"type", $re_value);
383 for (
$i=0;
$i<$value;
$i++) {
384 $var2 =
"cmi.interactions." .
$i .
".correct_responses._count";
385 if (isset($v_array[$var2])) {
386 $cnt = $v_array[$var2];
388 "cmi.interactions." .
$i .
".correct_responses",
394 "cmi.interactions." .
$i .
".correct_responses",
401 $this->
setArray(
"cmi.interactions", $value,
"student_response", $re_value);
402 $this->
setArray(
"cmi.interactions", $value,
"result", $re_value);
403 $this->
setArray(
"cmi.interactions", $value,
"latency", $re_value);
409 $this->tpl->setCurrentBlock(
"switch_icon");
410 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
412 $this->tpl->setVariable(
414 $lng->txt(
"cont_status") .
": " 415 . $lng->txt(
"cont_sc_stat_running")
417 $this->tpl->parseCurrentBlock();
420 $lesson_mode = $this->slm->getDefaultLessonMode();
421 if ($this->slm->getAutoReview()) {
422 if ($re_value[
"cmi.core.lesson_status"] ==
"completed" ||
423 $re_value[
"cmi.core.lesson_status"] ==
"passed" ||
424 $re_value[
"cmi.core.lesson_status"] ==
"failed") {
425 $lesson_mode =
"review";
428 $this->tpl->setVariable(
"LESSON_MODE", $lesson_mode);
431 if ($lesson_mode ==
"normal") {
432 $this->tpl->setVariable(
434 str_replace(
"_",
"-", $this->slm->getCreditMode())
437 $this->tpl->setVariable(
"CREDIT_MODE",
"no-credit");
442 if (!isset($re_value[
"cmi.core.total_time"])) {
443 $item->insertTrackData(
"cmi.core.total_time",
"0000:00:00", $sahs_obj_id);
445 if (!isset($re_value[
"cmi.core.lesson_status"])) {
446 $item->insertTrackData(
"cmi.core.lesson_status",
"not attempted", $sahs_obj_id);
448 if (!isset($re_value[
"cmi.core.entry"])) {
449 $item->insertTrackData(
"cmi.core.entry",
"", $sahs_obj_id);
458 $this->tpl =
new ilTemplate(
"tpl.sahs_finish_cbt.html",
true,
true,
"Modules/ScormAicc");
461 $this->tpl->setCurrentBlock(
"switch_icon");
462 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
463 $this->tpl->setVariable(
466 "scorm/" . str_replace(
" ",
"_",
$_GET[
"status"]) .
'.svg' 469 $this->tpl->setVariable(
471 $lng->txt(
"cont_status") .
": " 472 . $lng->txt(
"cont_sc_stat_" . str_replace(
" ",
"_",
$_GET[
"status"])) .
", " 473 . $lng->txt(
"cont_total_time") .
": " 476 $this->tpl->setVariable(
"SCO_LAUNCH_ID",
$_GET[
"launch"]);
477 $this->tpl->parseCurrentBlock();
483 $this->tpl =
new ilTemplate(
"tpl.sahs_unload_cbt.html",
true,
true,
"Modules/ScormAicc");
485 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
494 $sco_id = (
$_GET[
"asset_id"] ==
"")
497 $ref_id = (
$_GET[
"ref_id"] ==
"")
503 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
504 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
507 $id_ref = $item->getIdentifierRef();
509 $resource->readByIdRef($id_ref, $item->getSLMId());
510 $href = $resource->getHref();
511 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output") .
"/" . $href);
512 $this->tpl =
new ilTemplate(
"tpl.scorm_launch_asset.html",
true,
true,
"Modules/ScormAicc");
513 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output") .
"/" . $href);
523 $this->tpl->setCurrentBlock(
"set_value");
524 $this->tpl->setVariable(
"VAR", $a_var);
525 $this->tpl->setVariable(
"VALUE", $a_value);
526 $this->tpl->parseCurrentBlock();
532 public function setArray($a_left, $a_value, $a_name, &$v_array)
534 for (
$i=0;
$i<$a_value;
$i++) {
535 $var = $a_left .
"." .
$i .
"." . $a_name;
536 if (isset($v_array[$var])) {
537 $this->tpl->setCurrentBlock(
"set_value");
538 $this->tpl->setVariable(
"VAR", $var);
539 $this->tpl->setVariable(
"VALUE", $v_array[$var]);
540 $this->tpl->parseCurrentBlock();
552 $this->ctrl->setCmd(
"showSummary");
553 $this->ctrl->setCmdClass(
"ilinfoscreengui");
562 !$DIC->access()->checkAccess(
'visible',
'', (
int)
$_GET[
"ref_id"]) &&
563 !$DIC->access()->checkAccess(
'read',
'', (
int) $_GET[
"ref_id"])
565 $DIC[
'ilErr']->raiseError($this->lng->txt(
'msg_no_perm_read'), $DIC[
'ilErr']->MESSAGE);
570 include_once
"Services/Tracking/classes/class.ilLearningProgressAccess.php";
572 $DIC->tabs()->addTab(
574 $this->lng->txt(
"info_short"),
575 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
578 $DIC->tabs()->addTab(
580 $this->lng->txt(
"learning_progress"),
581 $this->ctrl->getLinkTargetByClass(
'illearningprogressgui',
'')
584 if ($DIC->access()->checkAccess(
"edit_learning_progress",
"", $_GET[
"ref_id"]) || $DIC->access()->checkAccess(
"read_learning_progress",
"", $_GET[
"ref_id"])) {
585 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
587 if ($privacy->enabledSahsProtocolData()) {
588 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
591 if (
$type ==
"scorm2004") {
592 $DIC->tabs()->addTab(
593 "cont_tracking_data",
594 $this->lng->txt(
"cont_tracking_data"),
595 $this->ctrl->getLinkTargetByClass(
'ilobjscorm2004learningmodulegui',
'showTrackingItems')
597 } elseif (
$type ==
"scorm") {
598 $DIC->tabs()->addTab(
599 "cont_tracking_data",
600 $this->lng->txt(
"cont_tracking_data"),
601 $this->ctrl->getLinkTargetByClass(
'ilobjscormlearningmodulegui',
'showTrackingItems')
606 $DIC->tabs()->activateTab($a_active);
607 $this->tpl->getStandardTemplate();
608 $this->tpl->setTitle($this->slm_gui->object->getTitle());
610 $DIC[
'ilLocator']->addRepositoryItems();
611 $DIC[
'ilLocator']->addItem(
612 $this->slm_gui->object->getTitle(),
613 $this->ctrl->getLinkTarget($this,
"infoScreen"),
617 $this->tpl->setLocator();
643 $this->lng->loadLanguageModule(
"meta");
645 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
648 $info->enablePrivateNotes();
652 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) {
653 $info->enableNewsEditing();
655 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
656 if ($enable_internal_rss) {
657 $info->setBlockProperty(
"news",
"settings",
true);
662 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])) {
663 $ilToolbar =
$GLOBALS[
'DIC']->toolbar();
664 $ilToolbar->addButtonInstance($this->slm_gui->object->getViewButton());
668 $info->addMetaDataSections(
669 $this->slm_gui->object->getId(),
671 $this->slm_gui->object->getType()
683 $this->ctrl->forwardCommand(
$info);
Class ilObjSCORMLearningModuleGUI.
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
setTargetGet($a_target_get)
set the varname in Get-string public
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
setSingleVariable($a_var, $a_value)
set single value
GUI class ilSCORMOfflineModeGUI.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _lookupUserIsOfflineMode($a_obj_id)
Checks offlineMode and returns false if.
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, )
frameset()
output main menu
static _lookupObjectId($a_ref_id)
lookup object id
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
& getInstance($a_id)
get instance of specialized GUI class
attrib2arr(&$a_attributes)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
redirection script todo: (a better solution should control the processing via a xml file) ...
executeCommand()
execute command
static _lookupEditable($a_obj_id)
Lookup editable.
Explorer View for SCORM Learning Modules.
Create styles array
The data for the language used.
outputInfoScreen()
info screen
Class ilSCORMPresentationGUI.
setArray($a_left, $a_value, $a_name, &$v_array)
set single value
const LP_CONTEXT_REPOSITORY
Class ilSAHSPresentationGUI.
static _getInstance()
Get instance of ilPrivacySettings.
Class ilObjUserTrackingGUI.
Class ilObjSCORMLearningModule.
explorer($a_target="sahs_content")
output table of content
static _noteAccess($a_obj_id, $a_type, $a_ref_id)
Note the access of the current usr to an object.
Class ilObjSCORMLearningModuleGUI.
readRootId()
read root id from database