ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilSAHSPresentationGUI Class Reference

Class ilSAHSPresentationGUI. More...

+ Collaboration diagram for ilSAHSPresentationGUI:

Public Member Functions

 ilSAHSPresentationGUI ()
 
executeCommand ()
 execute command More...
 
 attrib2arr (&$a_attributes)
 
 frameset ()
 output main menu More...
 
 explorer ($a_target="sahs_content")
 output table of content More...
 
 view ()
 
 api ()
 
 launchSahs ()
 
 finishSahs ()
 
 unloadSahs ()
 
 launchAsset ()
 
 setSingleVariable ($a_var, $a_value)
 set single value More...
 
 setArray ($a_left, $a_value, $a_name, &$v_array)
 set single value More...
 
 infoScreen ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 setInfoTabs ($a_active)
 
 outputInfoScreen ()
 info screen More...
 

Data Fields

 $ilias
 
 $tpl
 
 $lng
 

Detailed Description

Member Function Documentation

◆ api()

ilSAHSPresentationGUI::api ( )

Definition at line 319 of file class.ilSAHSPresentationGUI.php.

320 {
321 global $ilias;
322
323 $slm_obj =& new ilObjSCORMLearningModule($_GET["ref_id"]);
324
325 $this->tpl = new ilTemplate("tpl.sahs_api.html", true, true, "Modules/ScormAicc");
326 $this->tpl->setVariable("USER_ID",$ilias->account->getId());
327 $this->tpl->setVariable("USER_FIRSTNAME",$ilias->account->getFirstname());
328 $this->tpl->setVariable("USER_LASTNAME",$ilias->account->getLastname());
329 $this->tpl->setVariable("REF_ID",$_GET["ref_id"]);
330 $this->tpl->setVariable("SESSION_ID",session_id());
331
332 $this->tpl->setVariable("CODE_BASE", "http://".$_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'], 0, strpos ($_SERVER['PHP_SELF'], "/ilias.php")));
333 $this->tpl->parseCurrentBlock();
334
335 $this->tpl->show(false);
336 exit;
337 }
$_GET["client_id"]
Class ilObjSCORMLearningModule.
special template class to simplify handling of ITX/PEAR
exit
Definition: login.php:54
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']

References $_GET, $_SERVER, $ilias, and exit.

◆ attrib2arr()

ilSAHSPresentationGUI::attrib2arr ( $a_attributes)

Definition at line 220 of file class.ilSAHSPresentationGUI.php.

221 {
222 $attr = array();
223
224 if(!is_array($a_attributes))
225 {
226 return $attr;
227 }
228 foreach ($a_attributes as $attribute)
229 {
230 $attr[$attribute->name()] = $attribute->value();
231 }
232
233
234 return $attr;
235 }

◆ executeCommand()

& ilSAHSPresentationGUI::executeCommand ( )

execute command

Definition at line 42 of file class.ilSAHSPresentationGUI.php.

43 {
44 global $lng,$ilAccess, $ilNavigationHistory, $ilCtrl, $ilLocator, $ilObjDataCache;
45
46 include_once "./Services/Object/classes/class.ilObjectGUI.php";
47 include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
48
49 $lng->loadLanguageModule("content");
50 $obj_id = ilObject::_lookupObjectId($_GET['ref_id']);
51
52 // add entry to navigation history
53 if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
54 {
55 include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
57
59 {
60 $ilNavigationHistory->addItem($_GET["ref_id"],
61 "ilias.php?cmd=infoScreen&baseClass=ilSAHSPresentationGUI&ref_id=".$_GET["ref_id"], "lm");
62 }
63 }
64
65 include_once 'Services/Payment/classes/class.ilPaymentObject.php';
66 if(ilPaymentObject::_requiresPurchaseToAccess($_GET['ref_id'], $type = (isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL) ))
67 {
68 $ilLocator->addRepositoryItems();
69 $ilLocator->addItem($ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($_GET['ref_id'])),
70 'ilias.php?baseClass=ilSAHSPresentationGUI&ref_id='.$_GET['ref_id'],
71 '',
72 $_GET['ref_id'],
73 'sahs');
74 $this->tpl->setLocator();
75 $this->tpl->getStandardTemplate();
76
77 include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
78 $this->ctrl->setReturn($this, '');
79 $pp_gui = new ilShopPurchaseGUI($_GET['ref_id']);
80 $this->ctrl->forwardCommand($pp_gui);
81 $this->tpl->show();
82 exit();
83 }
84
85 $next_class = $this->ctrl->getNextClass($this);
86 $cmd = $this->ctrl->getCmd();
87
89
90 if ($cmd == "downloadCertificate")
91 {
92 require_once "./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
93 $scorm_gui = new ilSCORMPresentationGUI();
94 $ret =& $this->ctrl->forwardCommand($scorm_gui);
95 }
96
97 if (substr($cmd,0,11) == "offlineMode" || $this->offline_mode) $next_class = "ilscormofflinemodegui";
98
99 switch($type)
100 {
101
102 case "scorm2004":
103 include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
104 $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
105 break;
106
107 case "scorm":
108 include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
109 $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
110 break;
111
112 case "aicc":
113 include_once("./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php");
114 $this->slm_gui = new ilObjAICCLearningModuleGUI("", $_GET["ref_id"],true,false);
115 break;
116
117 case "hacp":
118 include_once("./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php");
119 $this->slm_gui = new ilObjHACPLearningModuleGUI("", $_GET["ref_id"],true,false);
120 break;
121 }
122
123 if ($next_class != "ilinfoscreengui" &&
124 $cmd != "infoScreen" &&
125 $next_class != "ilobjscorm2004learningmodulegui" &&
126 $next_class != "ilobjscormlearningmodulegui" &&
127 $next_class != "ilscormofflinemodegui" &&
128 $next_class != "illearningprogressgui")
129 {
130 include_once("./Services/License/classes/class.ilLicense.php");
131 ilLicense::_noteAccess($obj_id, "sahs", $_GET["ref_id"]);
132 switch($type)
133 {
134 case "scorm2004":
135 $this->ctrl->setCmdClass("ilscorm13player");
136 $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
137 break;
138
139 case "scorm":
140 $this->ctrl->setCmdClass("ilscormpresentationgui");
141 $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
142 break;
143
144 case "aicc":
145 $this->ctrl->setCmdClass("ilaiccpresentationgui");
146 break;
147
148 case "hacp":
149 $this->ctrl->setCmdClass("ilhacppresentationgui");
150 break;
151 }
152 $next_class = $this->ctrl->getNextClass($this);
153 }
154
155 switch($next_class)
156 {
157 case "ilinfoscreengui":
158 $ret =& $this->outputInfoScreen();
159 break;
160
161 case "ilscorm13player":
162 require_once "./Modules/Scorm2004/classes/ilSCORM13Player.php";
163 $scorm_gui = new ilSCORM13Player();
164 $ret =& $this->ctrl->forwardCommand($scorm_gui);
165 break;
166
167 case "ilscormpresentationgui":
168 require_once "./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
169 $scorm_gui = new ilSCORMPresentationGUI();
170 $ret =& $this->ctrl->forwardCommand($scorm_gui);
171 break;
172
173 case "ilaiccpresentationgui":
174 require_once "./Modules/ScormAicc/classes/AICC/class.ilAICCPresentationGUI.php";
175 $aicc_gui = new ilAICCPresentationGUI();
176 $ret =& $this->ctrl->forwardCommand($aicc_gui);
177 break;
178
179 case "ilhacppresentationgui":
180 require_once "./Modules/ScormAicc/classes/HACP/class.ilHACPPresentationGUI.php";
181 $hacp_gui = new ilHACPPresentationGUI();
182 $ret =& $this->ctrl->forwardCommand($hacp_gui);
183 break;
184
185 case "illearningprogressgui":
186 $this->setInfoTabs("learning_progress");
187 include_once "./Services/Tracking/classes/class.ilLearningProgressGUI.php";
189 $this->ctrl->forwardCommand($new_gui);
190 $this->tpl->show();
191 break;
192
193 case "ilscormofflinemodegui":
194 include_once "./Modules/ScormAicc/classes/class.ilSCORMOfflineModeGUI.php";
195 $new_gui =& new ilSCORMOfflineModeGUI($type);
196 $this->ctrl->forwardCommand($new_gui);
197 break;
198
199 case "ilobjscorm2004learningmodulegui":
200 include_once './Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModuleGUI.php';
201 $new_gui =& new ilObjSCORM2004LearningModuleGUI("", $_GET["ref_id"],true,false);
202 $this->ctrl->forwardCommand($new_gui);
203 $this->setInfoTabs("cont_tracking_data");
204 $this->tpl->show();
205 break;
206
207 case "ilobjscormlearningmodulegui":
208 include_once './Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php';
209 $new_gui =& new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
210 $this->ctrl->forwardCommand($new_gui);
211 $this->setInfoTabs("cont_tracking_data");
212 $this->tpl->show();
213 break;
214
215 default:
216 $this->$cmd();
217 }
218 }
Class ilAICCPresentationGUI.
Class ilHACPPresentationGUI.
Class ilObjUserTrackingGUI.
_noteAccess($a_obj_id, $a_type, $a_ref_id)
Note the access of the current usr to an object.
Class ilObjAICCLearningModuleGUI.
Class ilObjHACPLearningModuleGUI.
static _lookupEditable($a_obj_id)
Lookup editable.
static _lookupUserIsOfflineMode($a_obj_id)
Checks offlineMode and returns false if.
_lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
Class ilObjSCORMLearningModuleGUI.
static _lookupObjectId($a_ref_id)
lookup object id
static _requiresPurchaseToAccess($a_ref_id, $a_purchasetype='')
this function should be used by all buyable repository objects !!
GUI class ilSCORMOfflineModeGUI.
Class ilSCORMPresentationGUI.
Class ilShopPurchaseGUI.
global $ilCtrl
Definition: ilias.php:18
$cmd
Definition: sahs_server.php:35

References $_GET, $cmd, $ilCtrl, $lng, $ret, ilObjSAHSLearningModuleAccess\_lookupEditable(), ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), ilObjSAHSLearningModuleAccess\_lookupUserIsOfflineMode(), ilLicense\_noteAccess(), ilPaymentObject\_requiresPurchaseToAccess(), exit, ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, outputInfoScreen(), and setInfoTabs().

+ Here is the call graph for this function:

◆ explorer()

ilSAHSPresentationGUI::explorer (   $a_target = "sahs_content")

output table of content

Definition at line 253 of file class.ilSAHSPresentationGUI.php.

254 {
255 global $ilBench;
256
257 $ilBench->start("SAHSExplorer", "initExplorer");
258
259 $this->tpl = new ilTemplate("tpl.sahs_exp_main.html", true, true, "Modules/ScormAicc");
260
261 require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
262 $exp = new ilSCORMExplorer("ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=".$this->slm->getRefId(), $this->slm);
263 $exp->setTargetGet("obj_id");
264 $exp->setFrameTarget($a_target);
265
266 //$exp->setFiltered(true);
267
268 if ($_GET["scexpand"] == "")
269 {
270 $mtree = new ilSCORMTree($this->slm->getId());
271 $expanded = $mtree->readRootId();
272 }
273 else
274 {
275 $expanded = $_GET["scexpand"];
276 }
277 $exp->setExpand($expanded);
278
279 $exp->forceExpandAll(true, false);
280
281 // build html-output
282 //666$exp->setOutput(0);
283 $ilBench->stop("SAHSExplorer", "initExplorer");
284
285 // set output
286 $ilBench->start("SAHSExplorer", "setOutput");
287 $exp->setOutput(0);
288 $ilBench->stop("SAHSExplorer", "setOutput");
289
290 $ilBench->start("SAHSExplorer", "getOutput");
291 $output = $exp->getOutput();
292 $ilBench->stop("SAHSExplorer", "getOutput");
293
294 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
295 $this->tpl->addBlockFile("CONTENT", "content", "tpl.sahs_explorer.html", "Modules/ScormAicc");
296 //$this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_content"));
297 $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
298 $this->tpl->setVariable("EXPLORER",$output);
299 $this->tpl->setVariable("ACTION", "ilias.php?baseClass=ilSAHSPresentationGUI&cmd=".$_GET["cmd"]."&frame=".$_GET["frame"].
300 "&ref_id=".$this->slm->getRefId()."&scexpand=".$_GET["scexpand"]);
301 $this->tpl->parseCurrentBlock();
302 $this->tpl->show();
303 }
Explorer View for SCORM Learning Modules.
SCORM Object Tree.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
global $ilBench
Definition: ilias.php:18

References $_GET, $ilBench, and ilUtil\getStyleSheetLocation().

+ Here is the call graph for this function:

◆ finishSahs()

ilSAHSPresentationGUI::finishSahs ( )

Definition at line 522 of file class.ilSAHSPresentationGUI.php.

523 {
524 global $lng;
525 $this->tpl = new ilTemplate("tpl.sahs_finish_cbt.html", true, true, "Modules/ScormAicc");
526 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
527
528 $this->tpl->setCurrentBlock("switch_icon");
529 $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
530 $this->tpl->setVariable("SCO_ICO", ilUtil::getImagePath(
531 "scorm/".str_replace(" ", "_", $_GET["status"]).'.svg')
532 );
533 $this->tpl->setVariable("SCO_ALT",
534 $lng->txt("cont_status").": "
535 .$lng->txt("cont_sc_stat_".str_replace(" ", "_", $_GET["status"])).", "
536 .$lng->txt("cont_total_time"). ": "
537 .$_GET["totime"]
538 );
539 $this->tpl->setVariable("SCO_LAUNCH_ID", $_GET["launch"]);
540 $this->tpl->parseCurrentBlock();
541 $this->tpl->show();
542 }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $_GET, $lng, ilUtil\getImagePath(), and ilUtil\getStyleSheetLocation().

+ Here is the call graph for this function:

◆ frameset()

ilSAHSPresentationGUI::frameset ( )

output main menu

Definition at line 241 of file class.ilSAHSPresentationGUI.php.

242 {
243 $this->tpl = new ilTemplate("tpl.sahs_pres_frameset.html", false, false, "Modules/ScormAicc");
244 $this->tpl->setVariable("REF_ID",$this->slm->getRefId());
245 $this->tpl->show("DEFAULT", false);
246 exit;
247 }

References exit.

◆ ilSAHSPresentationGUI()

ilSAHSPresentationGUI::ilSAHSPresentationGUI ( )

Definition at line 27 of file class.ilSAHSPresentationGUI.php.

28 {
29 global $ilias, $tpl, $lng, $ilCtrl;
30
31 $this->ilias =& $ilias;
32 $this->tpl =& $tpl;
33 $this->lng =& $lng;
34 $this->ctrl =& $ilCtrl;
35
36 $this->ctrl->saveParameter($this, "ref_id");
37 }
redirection script todo: (a better solution should control the processing via a xml file)

References $ilCtrl, $ilias, $lng, and $tpl.

◆ infoScreen()

ilSAHSPresentationGUI::infoScreen ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 615 of file class.ilSAHSPresentationGUI.php.

616 {
617 $this->ctrl->setCmd("showSummary");
618 $this->ctrl->setCmdClass("ilinfoscreengui");
619 $this->outputInfoScreen();
620 }

References outputInfoScreen().

+ Here is the call graph for this function:

◆ launchAsset()

ilSAHSPresentationGUI::launchAsset ( )

Definition at line 553 of file class.ilSAHSPresentationGUI.php.

554 {
555 global $ilUser, $ilDB;
556
557 $sco_id = ($_GET["asset_id"] == "")
558 ? $_POST["asset_id"]
559 : $_GET["asset_id"];
560 $ref_id = ($_GET["ref_id"] == "")
561 ? $_POST["ref_id"]
562 : $_GET["ref_id"];
563
564 $this->slm =& new ilObjSCORMLearningModule($ref_id, true);
565
566 include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
567 include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
568 $item =& new ilSCORMItem($sco_id);
569
570 $id_ref = $item->getIdentifierRef();
571 $resource =& new ilSCORMResource();
572 $resource->readByIdRef($id_ref, $item->getSLMId());
573 $href = $resource->getHref();
574 $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
575 $this->tpl = new ilTemplate("tpl.scorm_launch_asset.html", true, true, "Modules/ScormAicc");
576 $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
577 $this->tpl->show();
578 }
$_POST['username']
Definition: cron.php:12
$ref_id
Definition: sahs_server.php:39
global $ilDB
global $ilUser
Definition: imgupload.php:15

References $_GET, $_POST, $ilDB, $ilUser, and $ref_id.

◆ launchSahs()

ilSAHSPresentationGUI::launchSahs ( )

Definition at line 339 of file class.ilSAHSPresentationGUI.php.

340 {
341
342 global $ilUser, $ilDB;
343
344 $sco_id = ($_GET["sahs_id"] == "")
345 ? $_POST["sahs_id"]
346 : $_GET["sahs_id"];
347 $ref_id = ($_GET["ref_id"] == "")
348 ? $_POST["ref_id"]
349 : $_GET["ref_id"];
350
351 $this->slm =& new ilObjSCORMLearningModule($ref_id, true);
352
353 include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
354 include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
355 $item =& new ilSCORMItem($sco_id);
356
357 $id_ref = $item->getIdentifierRef();
358 $resource =& new ilSCORMResource();
359 $resource->readByIdRef($id_ref, $item->getSLMId());
360 //$slm_obj =& new ilObjSCORMLearningModule($_GET["ref_id"]);
361 $href = $resource->getHref();
362 $this->tpl = new ilTemplate("tpl.sahs_launch_cbt.html", true, true, "Modules/ScormAicc");
363 $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
364
365 // set item data
366 $this->tpl->setVariable("LAUNCH_DATA", $item->getDataFromLms());
367 $this->tpl->setVariable("MAST_SCORE", $item->getMasteryScore());
368 $this->tpl->setVariable("MAX_TIME", $item->getMaxTimeAllowed());
369 $this->tpl->setVariable("LIMIT_ACT", $item->getTimeLimitAction());
370
371 // set alternative API name
372 if ($this->slm->getAPIAdapterName() != "API")
373 {
374 $this->tpl->setCurrentBlock("alt_api_ref");
375 $this->tpl->setVariable("API_NAME", $this->slm->getAPIAdapterName());
376 $this->tpl->parseCurrentBlock();
377 }
378
379 $val_set = $ilDB->queryF('
380 SELECT * FROM scorm_tracking
381 WHERE user_id = %s
382 AND sco_id = %s
383 AND obj_id = %s',
384 array('integer','integer','integer'),
385 array($ilUser->getId(),$sco_id,$this->slm->getId()));
386
387 $re_value = array();
388
389 while($val_rec = $ilDB->fetchAssoc($val_set))
390 {
391 $val_rec["rvalue"] = str_replace("\r\n", "\n", $val_rec["rvalue"]);
392 $val_rec["rvalue"] = str_replace("\r", "\n", $val_rec["rvalue"]);
393 $val_rec["rvalue"] = str_replace("\n", "\\n", $val_rec["rvalue"]);
394 $re_value[$val_rec["lvalue"]] = $val_rec["rvalue"];
395 }
396
397 foreach($re_value as $var => $value)
398 {
399 switch ($var)
400 {
401 case "cmi.core.lesson_location":
402 case "cmi.core.lesson_status":
403 case "cmi.core.entry":
404 case "cmi.core.score.raw":
405 case "cmi.core.score.max":
406 case "cmi.core.score.min":
407 case "cmi.core.total_time":
408 case "cmi.core.exit":
409 case "cmi.suspend_data":
410 case "cmi.comments":
411 case "cmi.student_preference.audio":
412 case "cmi.student_preference.language":
413 case "cmi.student_preference.speed":
414 case "cmi.student_preference.text":
415 $this->setSingleVariable($var, $value);
416 break;
417
418 case "cmi.objectives._count":
419 $this->setSingleVariable($var, $value);
420 $this->setArray("cmi.objectives", $value, "id", $re_value);
421 $this->setArray("cmi.objectives", $value, "score.raw", $re_value);
422 $this->setArray("cmi.objectives", $value, "score.max", $re_value);
423 $this->setArray("cmi.objectives", $value, "score.min", $re_value);
424 $this->setArray("cmi.objectives", $value, "status", $re_value);
425 break;
426
427 case "cmi.interactions._count":
428 $this->setSingleVariable($var, $value);
429 $this->setArray("cmi.interactions", $value, "id", $re_value);
430 for($i=0; $i<$value; $i++)
431 {
432 $var2 = "cmi.interactions.".$i.".objectives._count";
433 if (isset($v_array[$var2]))
434 {
435 $cnt = $v_array[$var2];
436 $this->setArray("cmi.interactions.".$i.".objectives",
437 $cnt, "id", $re_value);
438 /*
439 $this->setArray("cmi.interactions.".$i.".objectives",
440 $cnt, "score.raw", $re_value);
441 $this->setArray("cmi.interactions.".$i.".objectives",
442 $cnt, "score.max", $re_value);
443 $this->setArray("cmi.interactions.".$i.".objectives",
444 $cnt, "score.min", $re_value);
445 $this->setArray("cmi.interactions.".$i.".objectives",
446 $cnt, "status", $re_value);*/
447 }
448 }
449 $this->setArray("cmi.interactions", $value, "time", $re_value);
450 $this->setArray("cmi.interactions", $value, "type", $re_value);
451 for($i=0; $i<$value; $i++)
452 {
453 $var2 = "cmi.interactions.".$i.".correct_responses._count";
454 if (isset($v_array[$var2]))
455 {
456 $cnt = $v_array[$var2];
457 $this->setArray("cmi.interactions.".$i.".correct_responses",
458 $cnt, "pattern", $re_value);
459 $this->setArray("cmi.interactions.".$i.".correct_responses",
460 $cnt, "weighting", $re_value);
461 }
462 }
463 $this->setArray("cmi.interactions", $value, "student_response", $re_value);
464 $this->setArray("cmi.interactions", $value, "result", $re_value);
465 $this->setArray("cmi.interactions", $value, "latency", $re_value);
466 break;
467 }
468 }
469
470 global $lng;
471 $this->tpl->setCurrentBlock("switch_icon");
472 $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
473 $this->tpl->setVariable("SCO_ICO", ilUtil::getImagePath("scorm/running.svg"));
474 $this->tpl->setVariable("SCO_ALT",
475 $lng->txt("cont_status").": "
476 .$lng->txt("cont_sc_stat_running")
477 );
478 $this->tpl->parseCurrentBlock();
479
480 // lesson mode
481 $lesson_mode = $this->slm->getDefaultLessonMode();
482 if ($this->slm->getAutoReview())
483 {
484 if ($re_value["cmi.core.lesson_status"] == "completed" ||
485 $re_value["cmi.core.lesson_status"] == "passed" ||
486 $re_value["cmi.core.lesson_status"] == "failed")
487 {
488 $lesson_mode = "review";
489 }
490 }
491 $this->tpl->setVariable("LESSON_MODE", $lesson_mode);
492
493 // credit mode
494 if ($lesson_mode == "normal")
495 {
496 $this->tpl->setVariable("CREDIT_MODE",
497 str_replace("_", "-", $this->slm->getCreditMode()));
498 }
499 else
500 {
501 $this->tpl->setVariable("CREDIT_MODE", "no-credit");
502 }
503
504 // init cmi.core.total_time, cmi.core.lesson_status and cmi.core.entry
505 $sahs_obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
506 if (!isset($re_value["cmi.core.total_time"]))
507 {
508 $item->insertTrackData("cmi.core.total_time", "0000:00:00", $sahs_obj_id);
509 }
510 if (!isset($re_value["cmi.core.lesson_status"]))
511 {
512 $item->insertTrackData("cmi.core.lesson_status", "not attempted", $sahs_obj_id);
513 }
514 if (!isset($re_value["cmi.core.entry"]))
515 {
516 $item->insertTrackData("cmi.core.entry", "", $sahs_obj_id);
517 }
518
519 $this->tpl->show();
520 }
static _lookupObjId($a_id)
setArray($a_left, $a_value, $a_name, &$v_array)
set single value
setSingleVariable($a_var, $a_value)
set single value

References $_GET, $_POST, $ilDB, $ilUser, $lng, $ref_id, ilObject\_lookupObjId(), ilUtil\getImagePath(), setArray(), and setSingleVariable().

+ Here is the call graph for this function:

◆ outputInfoScreen()

ilSAHSPresentationGUI::outputInfoScreen ( )

info screen

Definition at line 670 of file class.ilSAHSPresentationGUI.php.

671 {
672 global $ilAccess;
673
674 //$this->tpl->setHeaderPageTitle("PAGETITLE", " - ".$this->lm->getTitle());
675
676 // set style sheets
677 /*
678 if (!$this->offlineMode())
679 {
680 $this->tpl->setStyleSheetLocation(ilUtil::getStyleSheetLocation());
681 }
682 else
683 {
684 $style_name = $this->ilias->account->prefs["style"].".css";;
685 $this->tpl->setStyleSheetLocation("./".$style_name);
686 }*/
687
688 $this->setInfoTabs("info_short");
689
690 $this->lng->loadLanguageModule("meta");
691
692 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
693
694 $info = new ilInfoScreenGUI($this->slm_gui);
695 $info->enablePrivateNotes();
696 //$info->enableLearningProgress();
697
698 $info->enableNews();
699 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
700 {
701 $info->enableNewsEditing();
702 $news_set = new ilSetting("news");
703 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
704 if ($enable_internal_rss)
705 {
706 $info->setBlockProperty("news", "settings", true);
707 }
708 }
709
710 // add read / back button
711 if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
712 {
713 include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
714 $sahs_obj = new ilObjSAHSLearningModule($_GET["ref_id"]);
715 $om = $sahs_obj->getOpenMode();
716 $width = $sahs_obj->getWidth();
717 $height = $sahs_obj->getHeight();
718 if ( ($om == 5 || $om == 1) && $width > 0 && $height > 0) $om++;
719 if ($om != 0)
720 {
721 $info->addButton($this->lng->txt("view"),
722 "javascript:void(0); onclick=startSAHS('".$this->ctrl->getLinkTarget($this, "")."','ilContObj".$this->slm_gui->object->getId()."',".$om.",".$width.",".$height.");",
723 '', 'top', true);
724 }
725 else
726 {
727 $info->addButton($this->lng->txt("view"),
728 $this->ctrl->getLinkTarget($this, ""),
729 ' target="ilContObj'.$this->slm_gui->object->getId().'" ',
730 'top', true);
731 }
732 }
733
734 // show standard meta data section
735 $info->addMetaDataSections($this->slm_gui->object->getId(),0,
736 $this->slm_gui->object->getType());
737
738 /*
739 if ($this->offlineMode())
740 {
741 $this->tpl->setContent($info->getHTML());
742 return $this->tpl->get();
743 }
744 else
745 {*/
746 // forward the command
747 $this->ctrl->forwardCommand($info);
748 //$this->tpl->setContent("aa");
749 $this->tpl->show();
750 //}
751 }
Class ilInfoScreenGUI.
Class ilObjSCORMLearningModule.
ILIAS Setting Class.
$info
Definition: example_052.php:80

References $_GET, $info, and setInfoTabs().

Referenced by executeCommand(), and infoScreen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setArray()

ilSAHSPresentationGUI::setArray (   $a_left,
  $a_value,
  $a_name,
$v_array 
)

set single value

Definition at line 595 of file class.ilSAHSPresentationGUI.php.

596 {
597 for($i=0; $i<$a_value; $i++)
598 {
599 $var = $a_left.".".$i.".".$a_name;
600 if (isset($v_array[$var]))
601 {
602 $this->tpl->setCurrentBlock("set_value");
603 $this->tpl->setVariable("VAR", $var);
604 $this->tpl->setVariable("VALUE", $v_array[$var]);
605 $this->tpl->parseCurrentBlock();
606 }
607 }
608 }

Referenced by launchSahs().

+ Here is the caller graph for this function:

◆ setInfoTabs()

ilSAHSPresentationGUI::setInfoTabs (   $a_active)

Definition at line 622 of file class.ilSAHSPresentationGUI.php.

623 {
624 global $ilTabs, $ilLocator, $ilAccess;
625 // $ilTabs->clearTargets();
626 // #9658 / #11753
627 include_once "Services/Tracking/classes/class.ilLearningProgressAccess.php";
629 ((!$ilAccess->checkAccess("edit_learning_progress", "", $_GET["ref_id"]) &&
630 !$ilAccess->checkAccess("read_learning_progress", "", $_GET["ref_id"])) ||
631 !$ilAccess->checkAccess("write", "", $_GET["ref_id"])))
632 {
633 $ilTabs->addTab("info_short", $this->lng->txt("info_short"),
634 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
635
636 $ilTabs->addTab("learning_progress", $this->lng->txt("learning_progress"),
637 $this->ctrl->getLinkTargetByClass('illearningprogressgui',''));
638 }
639 if($ilAccess->checkAccess("edit_learning_progress", "", $_GET["ref_id"]) || $ilAccess->checkAccess("read_learning_progress", "", $_GET["ref_id"]))
640 {
641 include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
643 if($privacy->enabledSahsProtocolData()) {
644 include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
645 $obj_id = ilObject::_lookupObjectId($_GET['ref_id']);
647 if($type == "scorm2004") {
648 $ilTabs->addTab("cont_tracking_data", $this->lng->txt("cont_tracking_data"),
649 $this->ctrl->getLinkTargetByClass('ilobjscorm2004learningmodulegui','showTrackingItems'));
650 }
651 else if($type == "scorm") {
652 $ilTabs->addTab("cont_tracking_data", $this->lng->txt("cont_tracking_data"),
653 $this->ctrl->getLinkTargetByClass('ilobjscormlearningmodulegui','showTrackingItems'));
654 }
655 }
656 }
657 $ilTabs->activateTab($a_active);
658 $this->tpl->getStandardTemplate();
659 $this->tpl->setTitle($this->slm_gui->object->getTitle());
660 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
661 $ilLocator->addRepositoryItems();
662 $ilLocator->addItem($this->slm_gui->object->getTitle(),
663 $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
664 $this->tpl->setLocator();
665 }
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static _getInstance()
Get instance of ilPrivacySettings.

References $_GET, ilPrivacySettings\_getInstance(), ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), ilLearningProgressAccess\checkAccess(), and ilUtil\getImagePath().

Referenced by executeCommand(), and outputInfoScreen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSingleVariable()

ilSAHSPresentationGUI::setSingleVariable (   $a_var,
  $a_value 
)

set single value

Definition at line 584 of file class.ilSAHSPresentationGUI.php.

585 {
586 $this->tpl->setCurrentBlock("set_value");
587 $this->tpl->setVariable("VAR", $a_var);
588 $this->tpl->setVariable("VALUE", $a_value);
589 $this->tpl->parseCurrentBlock();
590 }

Referenced by launchSahs().

+ Here is the caller graph for this function:

◆ unloadSahs()

ilSAHSPresentationGUI::unloadSahs ( )

Definition at line 544 of file class.ilSAHSPresentationGUI.php.

545 {
546 $this->tpl = new ilTemplate("tpl.sahs_unload_cbt.html", true, true, "Modules/ScormAicc");
547 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
548 $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
549 $this->tpl->show();
550 }

References $_GET, and ilUtil\getStyleSheetLocation().

+ Here is the call graph for this function:

◆ view()

ilSAHSPresentationGUI::view ( )

Definition at line 306 of file class.ilSAHSPresentationGUI.php.

307 {
308 $sc_gui_object =& ilSCORMObjectGUI::getInstance($_GET["obj_id"]);
309
310 if(is_object($sc_gui_object))
311 {
312 $sc_gui_object->view();
313 }
314
315 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
316 $this->tpl->show();
317 }
& getInstance($a_id)
get instance of specialized GUI class

References $_GET, ilSCORMObjectGUI\getInstance(), and ilUtil\getStyleSheetLocation().

+ Here is the call graph for this function:

Field Documentation

◆ $ilias

ilSAHSPresentationGUI::$ilias

Definition at line 23 of file class.ilSAHSPresentationGUI.php.

Referenced by api(), and ilSAHSPresentationGUI().

◆ $lng

ilSAHSPresentationGUI::$lng

◆ $tpl

ilSAHSPresentationGUI::$tpl

Definition at line 24 of file class.ilSAHSPresentationGUI.php.

Referenced by ilSAHSPresentationGUI().


The documentation for this class was generated from the following file: