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();
172 $query =
"SELECT * FROM scorm_tracking WHERE".
173 " user_id = ".$ilDB->quote($ilUser->getId()).
174 " AND sco_id = ".$ilDB->quote($sahs_id).
175 " AND obj_id = ".$ilDB->quote($this->slm->getId());
178 $val_set = $ilDB->query($query);
182 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
183 $val_rec[
"rvalue"] = str_replace(
"\r",
"\n", $val_rec[
"rvalue"]);
184 $val_rec[
"rvalue"] = str_replace(
"\n",
"%n%", $val_rec[
"rvalue"]);
185 $re_value[$val_rec[
"lvalue"]] = $val_rec[
"rvalue"];
188 foreach($re_value as $var => $value)
192 case "cmi.core.lesson_location":
193 case "cmi.core.lesson_status":
194 case "cmi.core.entry":
195 case "cmi.core.score.raw":
196 case "cmi.core.score.max":
197 case "cmi.core.score.min":
198 case "cmi.core.total_time":
199 case "cmi.core.exit":
200 case "cmi.suspend_data":
202 case "cmi.student_preference.audio":
203 case "cmi.student_preference.language":
204 case "cmi.student_preference.speed":
205 case "cmi.student_preference.text":
209 case "cmi.objectives._count":
211 $this->
setArray(
"cmi.objectives", $value,
"id", $re_value);
212 $this->
setArray(
"cmi.objectives", $value,
"score.raw", $re_value);
213 $this->
setArray(
"cmi.objectives", $value,
"score.max", $re_value);
214 $this->
setArray(
"cmi.objectives", $value,
"score.min", $re_value);
215 $this->
setArray(
"cmi.objectives", $value,
"status", $re_value);
218 case "cmi.interactions._count":
220 $this->
setArray(
"cmi.interactions", $value,
"id", $re_value);
221 for($i=0; $i<$value; $i++)
223 $var2 =
"cmi.interactions.".$i.
".objectives._count";
224 if (isset($v_array[$var2]))
226 $cnt = $v_array[$var2];
227 $this->
setArray(
"cmi.interactions.".$i.
".objectives",
228 $cnt,
"id", $re_value);
240 $this->
setArray(
"cmi.interactions", $value,
"time", $re_value);
241 $this->
setArray(
"cmi.interactions", $value,
"type", $re_value);
242 for($i=0; $i<$value; $i++)
244 $var2 =
"cmi.interactions.".$i.
".correct_responses._count";
245 if (isset($v_array[$var2]))
247 $cnt = $v_array[$var2];
248 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
249 $cnt,
"pattern", $re_value);
250 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
251 $cnt,
"weighting", $re_value);
254 $this->
setArray(
"cmi.interactions", $value,
"student_response", $re_value);
255 $this->
setArray(
"cmi.interactions", $value,
"result", $re_value);
256 $this->
setArray(
"cmi.interactions", $value,
"latency", $re_value);
262 $this->tpl->setCurrentBlock(
"switch_icon");
263 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
265 $this->tpl->setVariable(
"SCO_ALT",
266 $lng->txt(
"cont_status").
": "
267 .$lng->txt(
"cont_sc_stat_running")
269 $this->tpl->parseCurrentBlock();
272 $lesson_mode = $this->slm->getDefaultLessonMode();
273 if ($this->slm->getAutoReview())
275 if ($re_value[
"cmi.core.lesson_status"] ==
"completed" ||
276 $re_value[
"cmi.core.lesson_status"] ==
"passed" ||
277 $re_value[
"cmi.core.lesson_status"] ==
"failed")
279 $lesson_mode =
"review";
282 $this->tpl->setVariable(
"LESSON_MODE", $lesson_mode);
285 if ($lesson_mode ==
"normal")
287 $this->tpl->setVariable(
"CREDIT_MODE",
288 str_replace(
"_",
" ", $this->slm->getCreditMode()));
292 $this->tpl->setVariable(
"CREDIT_MODE",
"no-credit");
297 if (!isset($re_value[
"cmi.core.total_time"]))
299 $unit->insertTrackData(
"cmi.core.total_time",
"0000:00:00", $sahs_obj_id);
301 if (!isset($re_value[
"cmi.core.lesson_status"]))
303 $unit->insertTrackData(
"cmi.core.lesson_status",
"not attempted", $sahs_obj_id);
305 if (!isset($re_value[
"cmi.core.entry"]))
307 $unit->insertTrackData(
"cmi.core.entry",
"", $sahs_obj_id);