24 require_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php");
25 require_once(
"./Modules/ScormAicc/classes/AICC/class.ilAICCObjectGUI.php");
26 require_once(
"./Modules/ScormAicc/classes/AICC/class.ilAICCPresentationGUI.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);
88 $this->tpl =
new ilTemplate(
"tpl.sahs_exp_main.html",
true,
true,
"Modules/ScormAicc");
90 require_once(
"./Modules/ScormAicc/classes/HACP/class.ilHACPExplorer.php");
93 $exp->setFrameTarget($a_target);
96 if (
$_GET[
"scexpand"] ==
"")
103 $expanded =
$_GET[
"scexpand"];
105 $exp->setExpand($expanded);
107 $exp->forceExpandAll(
true,
false);
113 $output = $exp->getOutput();
116 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
117 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"cont_content"));
118 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
119 $this->tpl->setVariable(
"EXPLORER",$output);
120 $this->tpl->setVariable(
"ACTION", $this->ctrl->getLinkTarget($this,
$_GET[
"cmd"]).
"&frame=".
$_GET[
"frame"].
121 "&ref_id=".$this->slm->getRefId().
"&scexpand=".
$_GET[
"scexpand"]);
122 $this->tpl->parseCurrentBlock();
131 global $ilUser,
$ilDB;
133 $sahs_id = (
$_GET[
"sahs_id"] ==
"")
142 include_once(
"./Modules/ScormAicc/classes/AICC/class.ilAICCUnit.php");
146 $url=$unit->getCommand_line();
148 $url=$unit->getFilename();
149 if (strcasecmp(substr($unit->getFilename(),0,4),
"http")!=0)
150 $url=$unit->slm->getDataDirectory(
"output").
"/".$url;
151 if (strlen($unit->getWebLaunch())>0)
152 $url.=
"?".$unit->getWebLaunch();
160 $this->tpl =
new ilTemplate(
"tpl.sahs_launch_cbt.html",
true,
true,
"Modules/ScormAicc");
161 $this->tpl->setVariable(
"HREF", $url);
163 $this->tpl->setVariable(
"MAST_SCORE", $unit->getMasteryScore());
164 $this->tpl->setVariable(
"MAX_TIME", $unit->getMaxTimeAllowed());
165 $this->tpl->setVariable(
"LIMIT_ACT", $unit->getTimeLimitAction());
166 if($ilUser->getFirstName() ==
"Joe")
168 $this->tpl->setCurrentBlock(
"credit");
169 $this->tpl->setVariable(
"CREDIT_MODE",
"normal");
170 $this->tpl->parseCurrentBlock();
173 $val_set = $ilDB->queryF(
'
174 SELECT * FROM scorm_tracking
178 array(
'integer',
'integer',
'integer'),
179 array($ilUser->getId(),$sahs_id,$this->slm->getId()));
183 while($val_rec = $ilDB->fetchAssoc($val_set))
186 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
187 $val_rec[
"rvalue"] = str_replace(
"\r",
"\n", $val_rec[
"rvalue"]);
188 $val_rec[
"rvalue"] = str_replace(
"\n",
"%n%", $val_rec[
"rvalue"]);
189 $re_value[$val_rec[
"lvalue"]] = $val_rec[
"rvalue"];
192 foreach($re_value as $var => $value)
196 case "cmi.core.lesson_location":
197 case "cmi.core.lesson_status":
198 case "cmi.core.entry":
199 case "cmi.core.score.raw":
200 case "cmi.core.score.max":
201 case "cmi.core.score.min":
202 case "cmi.core.total_time":
203 case "cmi.core.exit":
204 case "cmi.suspend_data":
206 case "cmi.student_preference.audio":
207 case "cmi.student_preference.language":
208 case "cmi.student_preference.speed":
209 case "cmi.student_preference.text":
213 case "cmi.objectives._count":
215 $this->
setArray(
"cmi.objectives", $value,
"id", $re_value);
216 $this->
setArray(
"cmi.objectives", $value,
"score.raw", $re_value);
217 $this->
setArray(
"cmi.objectives", $value,
"score.max", $re_value);
218 $this->
setArray(
"cmi.objectives", $value,
"score.min", $re_value);
219 $this->
setArray(
"cmi.objectives", $value,
"status", $re_value);
222 case "cmi.interactions._count":
224 $this->
setArray(
"cmi.interactions", $value,
"id", $re_value);
225 for($i=0; $i<$value; $i++)
227 $var2 =
"cmi.interactions.".$i.
".objectives._count";
228 if (isset($v_array[$var2]))
230 $cnt = $v_array[$var2];
231 $this->
setArray(
"cmi.interactions.".$i.
".objectives",
232 $cnt,
"id", $re_value);
244 $this->
setArray(
"cmi.interactions", $value,
"time", $re_value);
245 $this->
setArray(
"cmi.interactions", $value,
"type", $re_value);
246 for($i=0; $i<$value; $i++)
248 $var2 =
"cmi.interactions.".$i.
".correct_responses._count";
249 if (isset($v_array[$var2]))
251 $cnt = $v_array[$var2];
252 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
253 $cnt,
"pattern", $re_value);
254 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
255 $cnt,
"weighting", $re_value);
258 $this->
setArray(
"cmi.interactions", $value,
"student_response", $re_value);
259 $this->
setArray(
"cmi.interactions", $value,
"result", $re_value);
260 $this->
setArray(
"cmi.interactions", $value,
"latency", $re_value);
266 $this->tpl->setCurrentBlock(
"switch_icon");
267 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
269 $this->tpl->setVariable(
"SCO_ALT",
270 $lng->txt(
"cont_status").
": "
271 .$lng->txt(
"cont_sc_stat_running")
273 $this->tpl->parseCurrentBlock();
276 $lesson_mode = $this->slm->getDefaultLessonMode();
277 if ($this->slm->getAutoReview())
279 if ($re_value[
"cmi.core.lesson_status"] ==
"completed" ||
280 $re_value[
"cmi.core.lesson_status"] ==
"passed" ||
281 $re_value[
"cmi.core.lesson_status"] ==
"failed")
283 $lesson_mode =
"review";
286 $this->tpl->setVariable(
"LESSON_MODE", $lesson_mode);
289 if ($lesson_mode ==
"normal")
291 $this->tpl->setVariable(
"CREDIT_MODE",
292 str_replace(
"_",
" ", $this->slm->getCreditMode()));
296 $this->tpl->setVariable(
"CREDIT_MODE",
"no-credit");
301 if (!isset($re_value[
"cmi.core.total_time"]))
303 $unit->insertTrackData(
"cmi.core.total_time",
"0000:00:00", $sahs_obj_id);
305 if (!isset($re_value[
"cmi.core.lesson_status"]))
307 $unit->insertTrackData(
"cmi.core.lesson_status",
"not attempted", $sahs_obj_id);
309 if (!isset($re_value[
"cmi.core.entry"]))
311 $unit->insertTrackData(
"cmi.core.entry",
"", $sahs_obj_id);