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();
142 global $ilUser, $ilDB;
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();
182 $query =
"SELECT * FROM scorm_tracking WHERE".
183 " user_id = ".$ilDB->quote($ilUser->getId()).
184 " AND sco_id = ".$ilDB->quote($sahs_id).
185 " AND obj_id = ".$ilDB->quote($this->slm->getId());
188 $val_set = $ilDB->query($query);
192 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
193 $val_rec[
"rvalue"] = str_replace(
"\r",
"\n", $val_rec[
"rvalue"]);
194 $val_rec[
"rvalue"] = str_replace(
"\n",
"%n%", $val_rec[
"rvalue"]);
195 $re_value[$val_rec[
"lvalue"]] = $val_rec[
"rvalue"];
198 foreach($re_value as $var => $value)
202 case "cmi.core.lesson_location":
203 case "cmi.core.lesson_status":
204 case "cmi.core.entry":
205 case "cmi.core.score.raw":
206 case "cmi.core.score.max":
207 case "cmi.core.score.min":
208 case "cmi.core.total_time":
209 case "cmi.core.exit":
210 case "cmi.suspend_data":
212 case "cmi.student_preference.audio":
213 case "cmi.student_preference.language":
214 case "cmi.student_preference.speed":
215 case "cmi.student_preference.text":
219 case "cmi.objectives._count":
221 $this->
setArray(
"cmi.objectives", $value,
"id", $re_value);
222 $this->
setArray(
"cmi.objectives", $value,
"score.raw", $re_value);
223 $this->
setArray(
"cmi.objectives", $value,
"score.max", $re_value);
224 $this->
setArray(
"cmi.objectives", $value,
"score.min", $re_value);
225 $this->
setArray(
"cmi.objectives", $value,
"status", $re_value);
228 case "cmi.interactions._count":
230 $this->
setArray(
"cmi.interactions", $value,
"id", $re_value);
231 for($i=0; $i<$value; $i++)
233 $var2 =
"cmi.interactions.".$i.
".objectives._count";
234 if (isset($v_array[$var2]))
236 $cnt = $v_array[$var2];
237 $this->
setArray(
"cmi.interactions.".$i.
".objectives",
238 $cnt,
"id", $re_value);
250 $this->
setArray(
"cmi.interactions", $value,
"time", $re_value);
251 $this->
setArray(
"cmi.interactions", $value,
"type", $re_value);
252 for($i=0; $i<$value; $i++)
254 $var2 =
"cmi.interactions.".$i.
".correct_responses._count";
255 if (isset($v_array[$var2]))
257 $cnt = $v_array[$var2];
258 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
259 $cnt,
"pattern", $re_value);
260 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
261 $cnt,
"weighting", $re_value);
264 $this->
setArray(
"cmi.interactions", $value,
"student_response", $re_value);
265 $this->
setArray(
"cmi.interactions", $value,
"result", $re_value);
266 $this->
setArray(
"cmi.interactions", $value,
"latency", $re_value);
272 $this->tpl->setCurrentBlock(
"switch_icon");
273 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
275 $this->tpl->setVariable(
"SCO_ALT",
276 $lng->txt(
"cont_status").
": "
277 .$lng->txt(
"cont_sc_stat_running")
279 $this->tpl->parseCurrentBlock();
282 $lesson_mode = $this->slm->getDefaultLessonMode();
283 if ($this->slm->getAutoReview())
285 if ($re_value[
"cmi.core.lesson_status"] ==
"completed" ||
286 $re_value[
"cmi.core.lesson_status"] ==
"passed" ||
287 $re_value[
"cmi.core.lesson_status"] ==
"failed")
289 $lesson_mode =
"review";
292 $this->tpl->setVariable(
"LESSON_MODE", $lesson_mode);
295 if ($lesson_mode ==
"normal")
297 $this->tpl->setVariable(
"CREDIT_MODE",
298 str_replace(
"_",
" ", $this->slm->getCreditMode()));
302 $this->tpl->setVariable(
"CREDIT_MODE",
"no-credit");
308 if (!isset($re_value[
"cmi.core.total_time"]))
310 $unit->insertTrackData(
"cmi.core.total_time",
"0000:00:00", $sahs_obj_id);
312 if (!isset($re_value[
"cmi.core.lesson_status"]))
314 $unit->insertTrackData(
"cmi.core.lesson_status",
"not attempted", $sahs_obj_id);
316 if (!isset($re_value[
"cmi.core.entry"]))
318 $unit->insertTrackData(
"cmi.core.entry",
"", $sahs_obj_id);