ILIAS  release_4-4 Revision
ilAICCPresentationGUI Class Reference

Class ilAICCPresentationGUI. More...

+ Inheritance diagram for ilAICCPresentationGUI:
+ Collaboration diagram for ilAICCPresentationGUI:

Public Member Functions

 ilAICCPresentationGUI ()
 
executeCommand ()
 execute command More...
 
 view ()
 
 explorer ($a_target="sahs_content")
 output table of content More...
 
 launchSahs ()
 
- Public Member Functions inherited from ilSCORMPresentationGUI
 ilSCORMPresentationGUI ()
 
executeCommand ()
 execute command More...
 
 attrib2arr (&$a_attributes)
 
 frameset ()
 Output main frameset. More...
 
 get_max_attempts ()
 Get max. More...
 
 get_actual_attempts ()
 Get number of actual attempts for the user. More...
 
 increase_attemptAndsave_module_version ()
 Increases attempts by one for this package. More...
 
 explorer ($a_target="sahs_content")
 save the active module version to scorm_tracking More...
 
 view ()
 SCORM content screen. More...
 
 contentSelect ()
 
 apiInitData ()
 SCORM Data for Javascript-API. More...
 
 api ()
 
 launchSahs ()
 This function is called by the API applet in the content frame when a SCO is started. More...
 
 finishSahs ()
 
 unloadSahs ()
 
 launchAsset ()
 
 pingSession ()
 
 logMessage ()
 
 logWarning ()
 
 setSingleVariable ($a_var, $a_value)
 set single value More...
 
 setArray ($a_left, $a_value, $a_name, &$v_array)
 set single value More...
 
 downloadCertificate ()
 Download the certificate for the active user. More...
 

Data Fields

 $ilias
 
 $slm
 
 $tpl
 
 $lng
 
- Data Fields inherited from ilSCORMPresentationGUI
 $ilias
 
 $slm
 
 $tpl
 
 $lng
 

Detailed Description

Class ilAICCPresentationGUI.

GUI class for aicc learning module presentation

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 39 of file class.ilAICCPresentationGUI.php.

Member Function Documentation

◆ executeCommand()

& ilAICCPresentationGUI::executeCommand ( )

execute command

Definition at line 64 of file class.ilAICCPresentationGUI.php.

References $_GET, $cmd, and $ilLog.

65  {
66  global $ilAccess, $ilLog;
67 
68  $next_class = $this->ctrl->getNextClass($this);
69  $cmd = $this->ctrl->getCmd("frameset");
70 
71  if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
72  {
73  $ilias->raiseError($lng->txt("permission_denied"), $ilias->error_obj->WARNING);
74  }
75 
76  switch($next_class)
77  {
78  default:
79  $this->$cmd();
80  }
81  }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35

◆ explorer()

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

output table of content

Definition at line 99 of file class.ilAICCPresentationGUI.php.

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

100  {
101  $this->tpl = new ilTemplate("tpl.sahs_exp_main.html", true, true, "Modules/ScormAicc");
102 
103  require_once("./Modules/ScormAicc/classes/AICC/class.ilAICCExplorer.php");
104  $exp = new ilAICCExplorer(
105  $this->ctrl->getLinkTarget($this, "view"), $this->slm);
106  $exp->setTargetGet("obj_id");
107  $exp->setFrameTarget($a_target);
108  //$exp->setFiltered(true);
109 
110  if ($_GET["scexpand"] == "")
111  {
112  $mtree = new ilSCORMTree($this->slm->getId());
113  $expanded = $mtree->readRootId();
114  }
115  else
116  {
117  $expanded = $_GET["scexpand"];
118  }
119  $exp->setExpand($expanded);
120 
121  $exp->forceExpandAll(true, false);
122 
123  // build html-output
124  //666$exp->setOutput(0);
125  $exp->setOutput(0);
126 
127  $output = $exp->getOutput();
128 
129  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
130  $this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
131  $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_content"));
132  $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
133  $this->tpl->setVariable("EXPLORER",$output);
134  $this->tpl->setVariable("ACTION", $this->ctrl->getLinkTarget($this, $_GET["cmd"])."&frame=".$_GET["frame"].
135  "&ref_id=".$this->slm->getRefId()."&scexpand=".$_GET["scexpand"]);
136  $this->tpl->parseCurrentBlock();
137  $this->tpl->show();
138  }
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.
readRootId()
read root id from database
+ Here is the call graph for this function:

◆ ilAICCPresentationGUI()

ilAICCPresentationGUI::ilAICCPresentationGUI ( )

Definition at line 46 of file class.ilAICCPresentationGUI.php.

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

47  {
48  global $ilias, $tpl, $lng, $ilCtrl;
49 
50  $this->ilias =& $ilias;
51  $this->tpl =& $tpl;
52  $this->lng =& $lng;
53  $this->ctrl =& $ilCtrl;
54 
55  $cmd = (!empty($_GET["cmd"])) ? $_GET["cmd"] : "frameset";
56 
57  // Todo: check lm id
58  $this->slm =& new ilObjAICCLearningModule($_GET["ref_id"], true);
59  }
$_GET["client_id"]
Class ilObjAICCLearningModule.
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...

◆ launchSahs()

ilAICCPresentationGUI::launchSahs ( )

Definition at line 140 of file class.ilAICCPresentationGUI.php.

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

141  {
142  global $ilUser, $ilDB;
143 
144  $sahs_id = ($_GET["sahs_id"] == "")
145  ? $_POST["sahs_id"]
146  : $_GET["sahs_id"];
147  $ref_id = ($_GET["ref_id"] == "")
148  ? $_POST["ref_id"]
149  : $_GET["ref_id"];
150 
151  $this->slm =& new ilObjAICCLearningModule($ref_id, true);
152 
153  include_once("./Modules/ScormAicc/classes/AICC/class.ilAICCUnit.php");
154  $unit =& new ilAICCUnit($sahs_id);
155 
156  //guess the url
157  $url=$unit->getCommand_line();
158  if (strlen($url)==0)
159  $url=$unit->getFilename();
160  if (strcasecmp(substr($unit->getFilename(),0,4),"http")!=0)
161  $url=$this->slm->getDataDirectory("output")."/".$url;
162  if (strlen($unit->getWebLaunch())>0)
163  $url.="?".$unit->getWebLaunch();
164 /*
165  if (strcasecmp(substr($unit->getFilename(),0,4),"http")==0)
166  $href=$unit->getFilename();
167  else
168  $href=$this->slm->getDataDirectory("output")."/".$unit->getFilename();
169 */
170  $this->tpl = new ilTemplate("tpl.sahs_launch_cbt.html", true, true, "Modules/ScormAicc");
171  $this->tpl->setVariable("HREF", $url);
172 // $this->tpl->setVariable("LAUNCH_DATA", $unit->getDataFromLms());
173  $this->tpl->setVariable("MAST_SCORE", $unit->getMasteryScore());
174  $this->tpl->setVariable("MAX_TIME", $unit->getMaxTimeAllowed());
175  $this->tpl->setVariable("LIMIT_ACT", $unit->getTimeLimitAction());
176  if($ilUser->getFirstName() == "Joe") // for test purpose
177  {
178  $this->tpl->setCurrentBlock("credit");
179  $this->tpl->setVariable("CREDIT_MODE", "normal");
180  $this->tpl->parseCurrentBlock();
181  }
182 
183  $val_set = $ilDB->queryF('
184  SELECT * FROM scorm_tracking
185  WHERE user_id = %s
186  AND sco_id = %s
187  AND obj_id = %s',
188  array('integer','integer','integer'),
189  array($ilUser->getId(),$sahs_id,$this->slm->getId()));
190 
191  $re_value = array();
192 
193  while($val_rec = $ilDB->fetchAssoc($val_set))
194  {
195  $val_rec["rvalue"] = str_replace("\r\n", "\n", $val_rec["rvalue"]);
196  $val_rec["rvalue"] = str_replace("\r", "\n", $val_rec["rvalue"]);
197  $val_rec["rvalue"] = str_replace("\n", "%n%", $val_rec["rvalue"]);
198  $re_value[$val_rec["lvalue"]] = $val_rec["rvalue"];
199  }
200 
201  foreach($re_value as $var => $value)
202  {
203  switch ($var)
204  {
205  case "cmi.core.lesson_location":
206  case "cmi.core.lesson_status":
207  case "cmi.core.entry":
208  case "cmi.core.score.raw":
209  case "cmi.core.score.max":
210  case "cmi.core.score.min":
211  case "cmi.core.total_time":
212  case "cmi.core.exit":
213  case "cmi.suspend_data":
214  case "cmi.comments":
215  case "cmi.student_preference.audio":
216  case "cmi.student_preference.language":
217  case "cmi.student_preference.speed":
218  case "cmi.student_preference.text":
219  $this->setSingleVariable($var, $value);
220  break;
221 
222  case "cmi.objectives._count":
223  $this->setSingleVariable($var, $value);
224  $this->setArray("cmi.objectives", $value, "id", $re_value);
225  $this->setArray("cmi.objectives", $value, "score.raw", $re_value);
226  $this->setArray("cmi.objectives", $value, "score.max", $re_value);
227  $this->setArray("cmi.objectives", $value, "score.min", $re_value);
228  $this->setArray("cmi.objectives", $value, "status", $re_value);
229  break;
230 
231  case "cmi.interactions._count":
232  $this->setSingleVariable($var, $value);
233  $this->setArray("cmi.interactions", $value, "id", $re_value);
234  for($i=0; $i<$value; $i++)
235  {
236  $var2 = "cmi.interactions.".$i.".objectives._count";
237  if (isset($v_array[$var2]))
238  {
239  $cnt = $v_array[$var2];
240  $this->setArray("cmi.interactions.".$i.".objectives",
241  $cnt, "id", $re_value);
242  /*
243  $this->setArray("cmi.interactions.".$i.".objectives",
244  $cnt, "score.raw", $re_value);
245  $this->setArray("cmi.interactions.".$i.".objectives",
246  $cnt, "score.max", $re_value);
247  $this->setArray("cmi.interactions.".$i.".objectives",
248  $cnt, "score.min", $re_value);
249  $this->setArray("cmi.interactions.".$i.".objectives",
250  $cnt, "status", $re_value);*/
251  }
252  }
253  $this->setArray("cmi.interactions", $value, "time", $re_value);
254  $this->setArray("cmi.interactions", $value, "type", $re_value);
255  for($i=0; $i<$value; $i++)
256  {
257  $var2 = "cmi.interactions.".$i.".correct_responses._count";
258  if (isset($v_array[$var2]))
259  {
260  $cnt = $v_array[$var2];
261  $this->setArray("cmi.interactions.".$i.".correct_responses",
262  $cnt, "pattern", $re_value);
263  $this->setArray("cmi.interactions.".$i.".correct_responses",
264  $cnt, "weighting", $re_value);
265  }
266  }
267  $this->setArray("cmi.interactions", $value, "student_response", $re_value);
268  $this->setArray("cmi.interactions", $value, "result", $re_value);
269  $this->setArray("cmi.interactions", $value, "latency", $re_value);
270  break;
271  }
272  }
273 
274  global $lng;
275  $this->tpl->setCurrentBlock("switch_icon");
276  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
277  $this->tpl->setVariable("SCO_ICO", ilUtil::getImagePath("scorm/running.png"));
278  $this->tpl->setVariable("SCO_ALT",
279  $lng->txt("cont_status").": "
280  .$lng->txt("cont_sc_stat_running")
281  );
282  $this->tpl->parseCurrentBlock();
283 
284  // lesson mode
285  $lesson_mode = $this->slm->getDefaultLessonMode();
286  if ($this->slm->getAutoReview())
287  {
288  if ($re_value["cmi.core.lesson_status"] == "completed" ||
289  $re_value["cmi.core.lesson_status"] == "passed" ||
290  $re_value["cmi.core.lesson_status"] == "failed")
291  {
292  $lesson_mode = "review";
293  }
294  }
295  $this->tpl->setVariable("LESSON_MODE", $lesson_mode);
296 
297  // credit mode
298  if ($lesson_mode == "normal")
299  {
300  $this->tpl->setVariable("CREDIT_MODE",
301  str_replace("_", " ", $this->slm->getCreditMode()));
302  }
303  else
304  {
305  $this->tpl->setVariable("CREDIT_MODE", "no-credit");
306  }
307 
308  // init cmi.core.total_time, cmi.core.lesson_status and cmi.core.entry
309  $sahs_obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
310 
311  if (!isset($re_value["cmi.core.total_time"]))
312  {
313  $unit->insertTrackData("cmi.core.total_time", "0000:00:00", $sahs_obj_id);
314  }
315  if (!isset($re_value["cmi.core.lesson_status"]))
316  {
317  $unit->insertTrackData("cmi.core.lesson_status", "not attempted", $sahs_obj_id);
318  }
319  if (!isset($re_value["cmi.core.entry"]))
320  {
321  $unit->insertTrackData("cmi.core.entry", "", $sahs_obj_id);
322  }
323 
324  $this->tpl->show();
325  }
$_POST['username']
Definition: cron.php:12
setArray($a_left, $a_value, $a_name, &$v_array)
set single value
$_GET["client_id"]
Class ilObjAICCLearningModule.
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
global $ilUser
Definition: imgupload.php:15
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ view()

ilAICCPresentationGUI::view ( )

Definition at line 83 of file class.ilAICCPresentationGUI.php.

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

84  {
85  $sc_gui_object =& ilAICCObjectGUI::getInstance($_GET["obj_id"]);
86 
87  if(is_object($sc_gui_object))
88  {
89  $sc_gui_object->view();
90  }
91 
92  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
93  $this->tpl->show();
94  }
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

ilAICCPresentationGUI::$ilias

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

Referenced by ilAICCPresentationGUI().

◆ $lng

ilAICCPresentationGUI::$lng

Definition at line 44 of file class.ilAICCPresentationGUI.php.

Referenced by ilAICCPresentationGUI(), and launchSahs().

◆ $slm

ilAICCPresentationGUI::$slm

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

Referenced by explorer().

◆ $tpl

ilAICCPresentationGUI::$tpl

Definition at line 43 of file class.ilAICCPresentationGUI.php.

Referenced by ilAICCPresentationGUI().


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