ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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 300 of file class.ilSAHSPresentationGUI.php.

References $_GET, $ilias, and exit.

301  {
302  global $ilias;
303 
304  $slm_obj =& new ilObjSCORMLearningModule($_GET["ref_id"]);
305 
306  $this->tpl = new ilTemplate("tpl.sahs_api.html", true, true, "Modules/ScormAicc");
307  $this->tpl->setVariable("USER_ID",$ilias->account->getId());
308  $this->tpl->setVariable("USER_FIRSTNAME",$ilias->account->getFirstname());
309  $this->tpl->setVariable("USER_LASTNAME",$ilias->account->getLastname());
310  $this->tpl->setVariable("REF_ID",$_GET["ref_id"]);
311  $this->tpl->setVariable("SESSION_ID",session_id());
312 
313  $this->tpl->setVariable("CODE_BASE", "http://".$_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'], 0, strpos ($_SERVER['PHP_SELF'], "/ilias.php")));
314  $this->tpl->parseCurrentBlock();
315 
316  $this->tpl->show(false);
317  exit;
318  }
exit
Definition: login.php:54
$_GET["client_id"]
special template class to simplify handling of ITX/PEAR
Class ilObjSCORMLearningModule.

◆ attrib2arr()

ilSAHSPresentationGUI::attrib2arr ( $a_attributes)

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

202  {
203  $attr = array();
204 
205  if(!is_array($a_attributes))
206  {
207  return $attr;
208  }
209  foreach ($a_attributes as $attribute)
210  {
211  $attr[$attribute->name()] = $attribute->value();
212  }
213 
214 
215  return $attr;
216  }

◆ executeCommand()

& ilSAHSPresentationGUI::executeCommand ( )

execute command

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

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().

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

◆ explorer()

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

output table of content

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

References $_GET, $ilBench, ilUtil\getStyleSheetLocation(), ilTree\readRootId(), and ilExplorer\setTargetGet().

235  {
236  global $ilBench;
237 
238  $ilBench->start("SAHSExplorer", "initExplorer");
239 
240  $this->tpl = new ilTemplate("tpl.sahs_exp_main.html", true, true, "Modules/ScormAicc");
241 
242  require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
243  $exp = new ilSCORMExplorer("ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=".$this->slm->getRefId(), $this->slm);
244  $exp->setTargetGet("obj_id");
245  $exp->setFrameTarget($a_target);
246 
247  //$exp->setFiltered(true);
248 
249  if ($_GET["scexpand"] == "")
250  {
251  $mtree = new ilSCORMTree($this->slm->getId());
252  $expanded = $mtree->readRootId();
253  }
254  else
255  {
256  $expanded = $_GET["scexpand"];
257  }
258  $exp->setExpand($expanded);
259 
260  $exp->forceExpandAll(true, false);
261 
262  // build html-output
263  //666$exp->setOutput(0);
264  $ilBench->stop("SAHSExplorer", "initExplorer");
265 
266  // set output
267  $ilBench->start("SAHSExplorer", "setOutput");
268  $exp->setOutput(0);
269  $ilBench->stop("SAHSExplorer", "setOutput");
270 
271  $ilBench->start("SAHSExplorer", "getOutput");
272  $output = $exp->getOutput();
273  $ilBench->stop("SAHSExplorer", "getOutput");
274 
275  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
276  $this->tpl->addBlockFile("CONTENT", "content", "tpl.sahs_explorer.html", "Modules/ScormAicc");
277  //$this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_content"));
278  $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
279  $this->tpl->setVariable("EXPLORER",$output);
280  $this->tpl->setVariable("ACTION", "ilias.php?baseClass=ilSAHSPresentationGUI&cmd=".$_GET["cmd"]."&frame=".$_GET["frame"].
281  "&ref_id=".$this->slm->getRefId()."&scexpand=".$_GET["scexpand"]);
282  $this->tpl->parseCurrentBlock();
283  $this->tpl->show();
284  }
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
$_GET["client_id"]
special template class to simplify handling of ITX/PEAR
SCORM Object Tree.
global $ilBench
Definition: ilias.php:18
readRootId()
read root id from database
+ Here is the call graph for this function:

◆ finishSahs()

ilSAHSPresentationGUI::finishSahs ( )

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

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

504  {
505  global $lng;
506  $this->tpl = new ilTemplate("tpl.sahs_finish_cbt.html", true, true, "Modules/ScormAicc");
507  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
508 
509  $this->tpl->setCurrentBlock("switch_icon");
510  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
511  $this->tpl->setVariable("SCO_ICO", ilUtil::getImagePath(
512  "scorm/".str_replace(" ", "_", $_GET["status"]).'.png')
513  );
514  $this->tpl->setVariable("SCO_ALT",
515  $lng->txt("cont_status").": "
516  .$lng->txt("cont_sc_stat_".str_replace(" ", "_", $_GET["status"])).", "
517  .$lng->txt("cont_total_time"). ": "
518  .$_GET["totime"]
519  );
520  $this->tpl->setVariable("SCO_LAUNCH_ID", $_GET["launch"]);
521  $this->tpl->parseCurrentBlock();
522  $this->tpl->show();
523  }
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:

◆ frameset()

ilSAHSPresentationGUI::frameset ( )

output main menu

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

References exit.

223  {
224  $this->tpl = new ilTemplate("tpl.sahs_pres_frameset.html", false, false, "Modules/ScormAicc");
225  $this->tpl->setVariable("REF_ID",$this->slm->getRefId());
226  $this->tpl->show("DEFAULT", false);
227  exit;
228  }
exit
Definition: login.php:54
special template class to simplify handling of ITX/PEAR

◆ ilSAHSPresentationGUI()

ilSAHSPresentationGUI::ilSAHSPresentationGUI ( )

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

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

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

◆ 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 596 of file class.ilSAHSPresentationGUI.php.

References outputInfoScreen().

597  {
598  $this->ctrl->setCmd("showSummary");
599  $this->ctrl->setCmdClass("ilinfoscreengui");
600  $this->outputInfoScreen();
601  }
+ Here is the call graph for this function:

◆ launchAsset()

ilSAHSPresentationGUI::launchAsset ( )

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

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

535  {
536  global $ilUser, $ilDB;
537 
538  $sco_id = ($_GET["asset_id"] == "")
539  ? $_POST["asset_id"]
540  : $_GET["asset_id"];
541  $ref_id = ($_GET["ref_id"] == "")
542  ? $_POST["ref_id"]
543  : $_GET["ref_id"];
544 
545  $this->slm =& new ilObjSCORMLearningModule($ref_id, true);
546 
547  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
548  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
549  $item =& new ilSCORMItem($sco_id);
550 
551  $id_ref = $item->getIdentifierRef();
552  $resource =& new ilSCORMResource();
553  $resource->readByIdRef($id_ref, $item->getSLMId());
554  $href = $resource->getHref();
555  $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
556  $this->tpl = new ilTemplate("tpl.scorm_launch_asset.html", true, true, "Modules/ScormAicc");
557  $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
558  $this->tpl->show();
559  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
special template class to simplify handling of ITX/PEAR
SCORM Item.
global $ilUser
Definition: imgupload.php:15
$ref_id
Definition: sahs_server.php:39
Class ilObjSCORMLearningModule.

◆ launchSahs()

ilSAHSPresentationGUI::launchSahs ( )

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

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

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

◆ outputInfoScreen()

ilSAHSPresentationGUI::outputInfoScreen ( )

info screen

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

References $_GET, and setInfoTabs().

Referenced by executeCommand(), and infoScreen().

635  {
636  global $ilAccess;
637 
638  //$this->tpl->setHeaderPageTitle("PAGETITLE", " - ".$this->lm->getTitle());
639 
640  // set style sheets
641  /*
642  if (!$this->offlineMode())
643  {
644  $this->tpl->setStyleSheetLocation(ilUtil::getStyleSheetLocation());
645  }
646  else
647  {
648  $style_name = $this->ilias->account->prefs["style"].".css";;
649  $this->tpl->setStyleSheetLocation("./".$style_name);
650  }*/
651 
652  $this->setInfoTabs("info_short");
653 
654  $this->lng->loadLanguageModule("meta");
655 
656  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
657 
658  $info = new ilInfoScreenGUI($this->slm_gui);
659  $info->enablePrivateNotes();
660  //$info->enableLearningProgress();
661 
662  $info->enableNews();
663  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
664  {
665  $info->enableNewsEditing();
666  $news_set = new ilSetting("news");
667  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
668  if ($enable_internal_rss)
669  {
670  $info->setBlockProperty("news", "settings", true);
671  }
672  }
673 
674  // add read / back button
675  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
676  {
677  include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
678  $sahs_obj = new ilObjSAHSLearningModule($_GET["ref_id"]);
679  $om = $sahs_obj->getOpenMode();
680  $width = $sahs_obj->getWidth();
681  $height = $sahs_obj->getHeight();
682  if ($om != 0)
683  {
684  $info->addButton($this->lng->txt("view"),
685  "javascript:void(0); onclick=startSAHS('".$this->ctrl->getLinkTarget($this, "")."','ilContObj".$this->slm_gui->object->getId()."',".$om.",".$width.",".$height.");",
686  '', 'top', true);
687  }
688  else
689  {
690  $info->addButton($this->lng->txt("view"),
691  $this->ctrl->getLinkTarget($this, ""),
692  ' target="ilContObj'.$this->slm_gui->object->getId().'" ',
693  'top', true);
694  }
695  }
696 
697  // show standard meta data section
698  $info->addMetaDataSections($this->slm_gui->object->getId(),0,
699  $this->slm_gui->object->getType());
700 
701  /*
702  if ($this->offlineMode())
703  {
704  $this->tpl->setContent($info->getHTML());
705  return $this->tpl->get();
706  }
707  else
708  {*/
709  // forward the command
710  $this->ctrl->forwardCommand($info);
711  //$this->tpl->setContent("aa");
712  $this->tpl->show();
713  //}
714  }
ILIAS Setting Class.
Class ilInfoScreenGUI.
$_GET["client_id"]
Class ilObjSCORMLearningModule.
+ 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 576 of file class.ilSAHSPresentationGUI.php.

Referenced by launchSahs().

577  {
578  for($i=0; $i<$a_value; $i++)
579  {
580  $var = $a_left.".".$i.".".$a_name;
581  if (isset($v_array[$var]))
582  {
583  $this->tpl->setCurrentBlock("set_value");
584  $this->tpl->setVariable("VAR", $var);
585  $this->tpl->setVariable("VALUE", $v_array[$var]);
586  $this->tpl->parseCurrentBlock();
587  }
588  }
589  }
+ Here is the caller graph for this function:

◆ setInfoTabs()

ilSAHSPresentationGUI::setInfoTabs (   $a_active)

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

References $_GET, ilLearningProgressAccess\checkAccess(), and ilUtil\getImagePath().

Referenced by executeCommand(), and outputInfoScreen().

604  {
605  global $ilTabs, $ilLocator, $ilAccess;
606 
607  // #9658 / #11753
608  include_once "Services/Tracking/classes/class.ilLearningProgressAccess.php";
610  (!$ilAccess->checkAccess("edit_learning_progress", "", $_GET["ref_id"]) ||
611  !$ilAccess->checkAccess("write", "", $_GET["ref_id"])))
612  {
613  $ilTabs->addTab("info_short", $this->lng->txt("info_short"),
614  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
615 
616  $ilTabs->addTab("learning_progress", $this->lng->txt("learning_progress"),
617  $this->ctrl->getLinkTargetByClass(array('illearningprogressgui', 'illplistofprogressgui'),''));
618 
619  $ilTabs->activateTab($a_active);
620  }
621 
622  $this->tpl->getStandardTemplate();
623  $this->tpl->setTitle($this->slm_gui->object->getTitle());
624  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_slm_b.png"));
625  $ilLocator->addRepositoryItems();
626  $ilLocator->addItem($this->slm_gui->object->getTitle(),
627  $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
628  $this->tpl->setLocator();
629  }
$_GET["client_id"]
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ 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 565 of file class.ilSAHSPresentationGUI.php.

Referenced by launchSahs().

566  {
567  $this->tpl->setCurrentBlock("set_value");
568  $this->tpl->setVariable("VAR", $a_var);
569  $this->tpl->setVariable("VALUE", $a_value);
570  $this->tpl->parseCurrentBlock();
571  }
+ Here is the caller graph for this function:

◆ unloadSahs()

ilSAHSPresentationGUI::unloadSahs ( )

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

References $_GET, and ilUtil\getStyleSheetLocation().

526  {
527  $this->tpl = new ilTemplate("tpl.sahs_unload_cbt.html", true, true, "Modules/ScormAicc");
528  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
529  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
530  $this->tpl->show();
531  }
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:

◆ view()

ilSAHSPresentationGUI::view ( )

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

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

288  {
289  $sc_gui_object =& ilSCORMObjectGUI::getInstance($_GET["obj_id"]);
290 
291  if(is_object($sc_gui_object))
292  {
293  $sc_gui_object->view();
294  }
295 
296  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
297  $this->tpl->show();
298  }
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
& getInstance($a_id)
get instance of specialized GUI class
+ Here is the call graph for this function:

Field Documentation

◆ $ilias

ilSAHSPresentationGUI::$ilias

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

Referenced by api(), and ilSAHSPresentationGUI().

◆ $lng

ilSAHSPresentationGUI::$lng

◆ $tpl

ilSAHSPresentationGUI::$tpl

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

Referenced by ilSAHSPresentationGUI().


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