24 require_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
25 require_once(
"./Modules/ScormAicc/classes/AICC/class.ilAICCObjectGUI.php");
26 require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php");
68 $next_class = $this->ctrl->getNextClass($this);
69 $cmd = $this->ctrl->getCmd(
"frameset");
71 if (!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
73 $ilias->raiseError(
$lng->txt(
"permission_denied"),
$ilias->error_obj->WARNING);
87 if(is_object($sc_gui_object))
89 $sc_gui_object->view();
101 $this->tpl =
new ilTemplate(
"tpl.sahs_exp_main.html",
true,
true,
"Modules/ScormAicc");
103 require_once(
"./Modules/ScormAicc/classes/AICC/class.ilAICCExplorer.php");
105 $this->ctrl->getLinkTarget($this,
"view"),
$this->slm);
107 $exp->setFrameTarget($a_target);
110 if (
$_GET[
"scexpand"] ==
"")
117 $expanded =
$_GET[
"scexpand"];
119 $exp->setExpand($expanded);
121 $exp->forceExpandAll(
true,
false);
127 $output = $exp->getOutput();
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();
144 $sahs_id = (
$_GET[
"sahs_id"] ==
"")
153 include_once(
"./Modules/ScormAicc/classes/AICC/class.ilAICCUnit.php");
157 $url=$unit->getCommand_line();
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();
170 $this->tpl =
new ilTemplate(
"tpl.sahs_launch_cbt.html",
true,
true,
"Modules/ScormAicc");
171 $this->tpl->setVariable(
"HREF", $url);
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")
178 $this->tpl->setCurrentBlock(
"credit");
179 $this->tpl->setVariable(
"CREDIT_MODE",
"normal");
180 $this->tpl->parseCurrentBlock();
183 $val_set = $ilDB->queryF(
'
184 SELECT * FROM scorm_tracking
188 array(
'integer',
'integer',
'integer'),
189 array($ilUser->getId(),$sahs_id,$this->slm->getId()));
193 while($val_rec = $ilDB->fetchAssoc($val_set))
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"];
201 foreach($re_value as $var => $value)
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":
215 case "cmi.student_preference.audio":
216 case "cmi.student_preference.language":
217 case "cmi.student_preference.speed":
218 case "cmi.student_preference.text":
222 case "cmi.objectives._count":
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);
231 case "cmi.interactions._count":
233 $this->
setArray(
"cmi.interactions", $value,
"id", $re_value);
234 for($i=0; $i<$value; $i++)
236 $var2 =
"cmi.interactions.".$i.
".objectives._count";
237 if (isset($v_array[$var2]))
239 $cnt = $v_array[$var2];
240 $this->
setArray(
"cmi.interactions.".$i.
".objectives",
241 $cnt,
"id", $re_value);
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++)
257 $var2 =
"cmi.interactions.".$i.
".correct_responses._count";
258 if (isset($v_array[$var2]))
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);
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);
275 $this->tpl->setCurrentBlock(
"switch_icon");
276 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
278 $this->tpl->setVariable(
"SCO_ALT",
279 $lng->txt(
"cont_status").
": "
280 .$lng->txt(
"cont_sc_stat_running")
282 $this->tpl->parseCurrentBlock();
285 $lesson_mode = $this->slm->getDefaultLessonMode();
286 if ($this->slm->getAutoReview())
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")
292 $lesson_mode =
"review";
295 $this->tpl->setVariable(
"LESSON_MODE", $lesson_mode);
298 if ($lesson_mode ==
"normal")
300 $this->tpl->setVariable(
"CREDIT_MODE",
301 str_replace(
"_",
" ", $this->slm->getCreditMode()));
305 $this->tpl->setVariable(
"CREDIT_MODE",
"no-credit");
311 if (!isset($re_value[
"cmi.core.total_time"]))
313 $unit->insertTrackData(
"cmi.core.total_time",
"0000:00:00", $sahs_obj_id);
315 if (!isset($re_value[
"cmi.core.lesson_status"]))
317 $unit->insertTrackData(
"cmi.core.lesson_status",
"not attempted", $sahs_obj_id);
319 if (!isset($re_value[
"cmi.core.entry"]))
321 $unit->insertTrackData(
"cmi.core.entry",
"", $sahs_obj_id);