5 require_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
6 require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMObjectGUI.php");
47 $next_class = $this->ctrl->getNextClass($this);
48 $cmd = $this->ctrl->getCmd(
"frameset");
50 if (!$ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]) &&
51 (!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]) ||
52 !$this->slm->getOnline()))
54 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->WARNING);
69 if(!is_array($a_attributes))
73 foreach ($a_attributes as $attribute)
75 $attr[$attribute->name()] = $attribute->value();
88 $javascriptAPI =
true;
89 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php");
95 header(
'Content-Type: text/html; charset=utf-8');
96 echo($lng->txt(
"cont_sc_max_attempt_exceed"));
107 if ($javascriptAPI ==
false) {
108 if (count($items) > 1
109 || strtolower(get_class($this->slm)) ==
"ilobjaicclearningmodule"
110 || strtolower(get_class($this->slm)) ==
"ilobjhacplearningmodule")
112 $this->ctrl->setParameter($this,
"expand",
"1");
113 $exp_link = $this->ctrl->getLinkTarget($this,
"explorer");
114 $this->tpl =
new ilTemplate(
"tpl.sahs_pres_frameset.html",
false,
false,
"Modules/ScormAicc");
115 $this->tpl->setVariable(
"EXPLORER_LINK", $exp_link);
116 $api_link = $this->ctrl->getLinkTarget($this,
"api");
117 $this->tpl->setVariable(
"API_LINK", $api_link);
118 $pres_link = $this->ctrl->getLinkTarget($this,
"view");
119 $this->tpl->setVariable(
"PRESENTATION_LINK", $pres_link);
120 $this->tpl->show(
"DEFAULT",
false);
122 else if (count($items) == 1)
124 $this->tpl =
new ilTemplate(
"tpl.sahs_pres_frameset_one_page.html",
false,
false,
"Modules/ScormAicc");
125 $this->ctrl->setParameter($this,
"autolaunch", $items[0]);
126 $api_link = $this->ctrl->getLinkTarget($this,
"api");
127 $this->tpl->setVariable(
"API_LINK", $api_link);
128 $pres_link = $this->ctrl->getLinkTarget($this,
"view");
129 $this->tpl->setVariable(
"PRESENTATION_LINK", $pres_link);
130 $this->tpl->show(
"DEFAULT",
false);
133 $debug = $this->slm->getDebug();
134 $template =
"tpl.sahs_pres_frameset_js";
135 if ($debug) $template .=
"_debug";
136 if (count($items) > 1
137 || strtolower(get_class($this->slm)) ==
"ilobjaicclearningmodule"
138 || strtolower(get_class($this->slm)) ==
"ilobjhacplearningmodule")
140 $template .=
".html";
141 $this->ctrl->setParameter($this,
"expand",
"1");
142 $this->ctrl->setParameter($this,
"jsApi",
"1");
143 $exp_link = $this->ctrl->getLinkTarget($this,
"explorer");
144 $this->tpl =
new ilTemplate($template,
false,
false,
"Modules/ScormAicc");
145 $this->tpl->setVariable(
"EXPLORER_LINK", $exp_link);
146 $pres_link = $this->ctrl->getLinkTarget($this,
"contentSelect");
147 $this->tpl->setVariable(
"PRESENTATION_LINK", $pres_link);
149 $template .=
"_one_page.html";
150 $this->tpl =
new ilTemplate($template,
false,
false,
"Modules/ScormAicc");
151 $this->ctrl->setParameter($this,
"autolaunch", $items[0]);
153 $api_link = $this->ctrl->getLinkTarget($this,
"apiInitData");
154 $this->tpl->setVariable(
"API_LINK", $api_link);
155 $this->tpl->show(
"DEFAULT",
false);
169 $val_set = $ilDB->queryF(
'SELECT * FROM sahs_lm WHERE id = %s',
170 array(
'integer'), array($this->slm->getId()));
171 $val_rec = $ilDB->fetchAssoc($val_set);
173 return $val_rec[
"max_attempt"];
180 global
$ilDB, $ilUser;
182 $val_set = $ilDB->queryF(
'
183 SELECT * FROM scorm_tracking
188 array(
'integer',
'integer',
'text',
'integer'),
189 array($ilUser->getId(),0,
'package_attempts',$this->slm->getId())
191 $val_rec = $ilDB->fetchAssoc($val_set);
193 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
194 if ($val_rec[
"rvalue"] == null) {
195 $val_rec[
"rvalue"]=0;
198 return $val_rec[
"rvalue"];
205 global
$ilDB, $ilUser;
208 $val_set = $ilDB->queryF(
'
209 SELECT * FROM scorm_tracking
214 array(
'integer',
'integer',
'text',
'integer'),
215 array($ilUser->getId(),0,
'package_attempts',$this->slm->getId())
218 $val_rec = $ilDB->fetchAssoc($val_set);
220 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
221 if ($val_rec[
"rvalue"] == null) {
222 $val_rec[
"rvalue"]=0;
224 $new_rec = $val_rec[
"rvalue"]+1;
226 if($ilDB->numRows($val_set) > 0)
228 $ilDB->update(
'scorm_tracking',
230 'rvalue' => array(
'clob', $new_rec),
234 'user_id' => array(
'integer', $ilUser->getId()),
235 'sco_id' => array(
'integer', 0),
236 'lvalue' => array(
'text',
'package_attempts'),
237 'obj_id' => array(
'integer', $this->slm->getId())
243 $ilDB->insert(
'scorm_tracking', array(
244 'obj_id' => array(
'integer', $this->slm->getId()),
245 'user_id' => array(
'integer', $ilUser->getId()),
246 'sco_id' => array(
'integer', 0),
247 'lvalue' => array(
'text',
'package_attempts'),
248 'rvalue' => array(
'clob', $new_rec),
253 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
262 global
$ilDB, $ilUser;
264 $val_set = $ilDB->queryF(
'
265 SELECT * FROM scorm_tracking
270 array(
'integer',
'integer',
'text',
'integer'),
271 array($ilUser->getId(),0,
'module_version',$this->slm->getId())
275 if($ilDB->numRows($val_set) > 0)
277 $ilDB->update(
'scorm_tracking',
279 'rvalue' => array(
'clob', $this->slm->getModuleVersion()),
283 'user_id' => array(
'integer', $ilUser->getId()),
284 'sco_id' => array(
'integer', 0),
285 'lvalue' => array(
'text',
'module_version'),
286 'obj_id' => array(
'integer', $this->slm->getId())
292 $ilDB->insert(
'scorm_tracking', array(
293 'obj_id' => array(
'integer', $this->slm->getId()),
294 'user_id' => array(
'integer', $ilUser->getId()),
295 'sco_id' => array(
'integer', 0),
296 'lvalue' => array(
'text',
'module_version'),
297 'rvalue' => array(
'clob', $this->slm->getModuleVersion()),
302 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
314 $ilBench->start(
"SCORMExplorer",
"initExplorer");
316 $this->tpl =
new ilTemplate(
"tpl.sahs_exp_main.html",
true,
true,
"Modules/ScormAicc");
318 require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
321 $exp->setFrameTarget($a_target);
325 if (
$_GET[
"jsApi"] ==
"1") $jsApi=
true;
327 if (
$_GET[
"scexpand"] ==
"")
334 $expanded =
$_GET[
"scexpand"];
336 $exp->setExpand($expanded);
338 $exp->forceExpandAll(
true,
false);
339 $ilBench->stop(
"SCORMExplorer",
"initExplorer");
342 $ilBench->start(
"SCORMExplorer",
"setOutput");
344 $ilBench->stop(
"SCORMExplorer",
"setOutput");
346 $ilBench->start(
"SCORMExplorer",
"getOutput");
347 $output = $exp->getOutput($jsApi);
348 $ilBench->stop(
"SCORMExplorer",
"getOutput");
351 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.sahs_explorer.html",
"Modules/ScormAicc");
353 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
354 $this->tpl->setVariable(
"EXPLORER",$output);
355 $this->tpl->setVariable(
"ACTION",
"ilias.php?baseClass=ilSAHSPresentationGUI&cmd=".
$_GET[
"cmd"].
"&frame=".
$_GET[
"frame"].
356 "&ref_id=".$this->slm->getRefId().
"&scexpand=".
$_GET[
"scexpand"]);
357 $this->tpl->parseCurrentBlock();
369 if(is_object($sc_gui_object))
371 $sc_gui_object->view();
375 $this->tpl->show(
false);
380 $this->tpl =
new ilTemplate(
"tpl.scorm_content_select.html",
true,
true,
"Modules/ScormAicc");
382 $this->tpl->setVariable(
'TXT_SPECIALPAGE',$lng->txt(
"seq_toc"));
392 function encodeURIComponent($str) {
393 $revert = array(
'%21'=>
'!',
'%2A'=>
'*',
'%27'=>
"'",
'%28'=>
'(',
'%29'=>
')',
'%7E'=>
'~');
394 return strtr(rawurlencode($str), $revert);
397 if (
$_GET[
"ref_id"] ==
"") {
398 print (
'alert("no start without ref_id");');
403 header(
'Content-Type: text/javascript; charset=UTF-8');
404 print(
"function iliasApi() {\r\n");
405 $js_data = file_get_contents(
"./Modules/ScormAicc/scripts/basisAPI.js");
407 $js_data = file_get_contents(
"./Modules/ScormAicc/scripts/SCORM1_2standard.js");
412 $b_checkSetValues=
'true';
413 $b_storeObjectives=
'true';
414 $b_storeInteractions=
'true';
415 $b_readInteractions=
'false';
416 $c_storeSessionTime=
's';
417 $i_lessonScoreMax=
'-1';
418 $i_lessonMasteryScore=
'-1';
421 $b_messageLog=
'false';
422 if ($ilLog->current_log_level == 30) $b_messageLog=
'true';
424 if (
$_GET[
"autolaunch"] !=
"") $launchId=
$_GET[
"autolaunch"];
425 $session_timeout = 0;
426 if ($slm_obj->getSession()) {
427 $session_timeout = (int)($ilias->ini->readVariable(
"session",
"expire"))/2;
429 $b_autoReview=
'false';
430 if ($this->slm->getAutoReview()) $b_autoReview=
'true';
432 if ($this->slm->getDebug()) $b_debug=
'true';
433 $b_autoContinue=
'false';
434 if ($this->slm->getAutoContinue()) $b_autoContinue=
'true';
436 $s_out=
'IliasScormVars={'
437 .
'refId:'.
$_GET[
"ref_id"].
','
438 .
'objId:'.$this->slm->getId().
','
439 .
'launchId:'.$launchId.
','
441 .
'pingSession:'. $session_timeout.
','
442 .
'studentId:'.$ilias->account->getId().
','
443 .
'studentName:"'.encodeURIComponent($ilias->account->getLastname().
', '.$ilias->account->getFirstname()).
'",'
444 .
'studentLogin:"'.encodeURIComponent($ilias->account->getLogin()).
'",'
445 .
'studentOu:"'.encodeURIComponent($ilias->account->getDepartment()).
'",'
446 .
'credit:"'.str_replace(
"_",
"-", $this->slm->getCreditMode()).
'",'
447 .
'lesson_mode:"'.$this->slm->getDefaultLessonMode().
'",'
448 .
'b_autoReview:'.$b_autoReview.
','
449 .
'b_messageLog:'.$b_messageLog.
','
450 .
'b_checkSetValues:'.$b_checkSetValues.
','
451 .
'b_storeObjectives:'.$b_storeObjectives.
','
452 .
'b_storeInteractions:'.$b_storeInteractions.
','
453 .
'b_readInteractions:'.$b_readInteractions.
','
454 .
'c_storeSessionTime:"'.$c_storeSessionTime.
'",'
455 .
'b_autoContinue:'.$b_autoContinue.
','
456 .
'i_lessonScoreMax:'.$i_lessonScoreMax.
','
457 .
'i_lessonMasteryScore:'.$i_lessonMasteryScore.
','
458 .
'b_debug:'.$b_debug.
','
459 .
'dataDirectory:"'.encodeURIComponent($this->slm->getDataDirectory(
"output").
'/').
'",'
471 .
'wait:"'.encodeURIComponent($lng->txt(
"please_wait")).
'",'
472 .
'status:"'.encodeURIComponent($lng->txt(
"cont_status")).
'",'
473 .
'browsed:"'.encodeURIComponent($lng->txt(
"cont_sc_stat_browsed")).
'",'
474 .
'completed:"'.encodeURIComponent($lng->txt(
"cont_sc_stat_completed")).
'",'
475 .
'failed:"'.encodeURIComponent($lng->txt(
"cont_sc_stat_failed")).
'",'
476 .
'incomplete:"'.encodeURIComponent($lng->txt(
"cont_sc_stat_incomplete")).
'",'
477 .
'not_attempted:"'.encodeURIComponent($lng->txt(
"cont_sc_stat_not_attempted")).
'",'
478 .
'passed:"'.encodeURIComponent($lng->txt(
"cont_sc_stat_passed")).
'",'
479 .
'running:"'.encodeURIComponent($lng->txt(
"cont_sc_stat_running")).
'"'
484 print($s_out.
"\r\n");
486 $s_out =
'IliasScormData=[';
487 $tquery =
'SELECT sco_id,lvalue,rvalue FROM scorm_tracking '
488 .
'WHERE user_id = %s AND obj_id = %s '
489 .
"AND sco_id > 0 AND lvalue <> 'cmi.core.entry' AND lvalue <> 'cmi.core.session_time'";
490 if ($b_readInteractions ==
'false') $tquery.=
" AND LEFT(lvalue,16) <> 'cmi.interactions'";
491 $val_set = $ilDB->queryF($tquery,
492 array(
'integer',
'integer'),
493 array($ilUser->getId(),$this->slm->getId())
495 while($val_rec = $ilDB->fetchAssoc($val_set)) {
496 if (!strpos($val_rec[
"lvalue"],
"._count"))
497 $s_out.=
'['.$val_rec[
"sco_id"].
',"'.$val_rec[
"lvalue"].
'","'.encodeURIComponent($val_rec[
"rvalue"]).
'"],';
500 $val_set = $ilDB->queryF(
'
501 SELECT sc_item.obj_id,maxtimeallowed,timelimitaction,datafromlms,masteryscore
502 FROM sc_item, scorm_object
503 WHERE scorm_object.obj_id=sc_item.obj_id
504 AND scorm_object.c_type = %s
505 AND scorm_object.slm_id = %s',
506 array(
'text',
'integer'),
507 array(
'sit',$this->slm->getId())
509 while($val_rec = $ilDB->fetchAssoc($val_set)) {
510 if($val_rec[
"maxtimeallowed"]!=null)
511 $s_out.=
'['.$val_rec[
"obj_id"].
',"cmi.student_data.max_time_allowed","'.encodeURIComponent($val_rec[
"maxtimeallowed"]).
'"],';
512 if($val_rec[
"timelimitaction"]!=null)
513 $s_out.=
'['.$val_rec[
"obj_id"].
',"cmi.student_data.time_limit_action","'.encodeURIComponent($val_rec[
"timelimitaction"]).
'"],';
514 if($val_rec[
"datafromlms"]!=null)
515 $s_out.=
'['.$val_rec[
"obj_id"].
',"cmi.launch_data","'.encodeURIComponent($val_rec[
"datafromlms"]).
'"],';
516 if($val_rec[
"masteryscore"]!=null)
517 $s_out.=
'['.$val_rec[
"obj_id"].
',"cmi.student_data.mastery_score","'.encodeURIComponent($val_rec[
"masteryscore"]).
'"],';
519 if(substr($s_out,(strlen($s_out)-1))==
",") $s_out=substr($s_out,0,(strlen($s_out)-1));
521 print($s_out.
"\r\n");
524 $s_out=
'IliasScormResources=[';
525 $val_set = $ilDB->queryF(
"
526 SELECT scorm_tree.lft, scorm_tree.child,
527 CASE WHEN sc_resource.scormtype = 'asset' THEN 1 ELSE 0 END AS asset,
529 FROM scorm_tree, sc_resource, sc_item
530 WHERE scorm_tree.slm_id=%s
531 AND sc_item.obj_id=scorm_tree.child
532 AND sc_resource.import_id=sc_item.identifierref
533 ORDER BY scorm_tree.lft",
535 array($this->slm->getId())
537 while($val_rec = $ilDB->fetchAssoc($val_set)) {
538 $s_out.=
'['.$val_rec[
"lft"].
','.$val_rec[
"child"].
','.$val_rec[
"asset"].
',"'.encodeURIComponent($val_rec[
"href"]).
'"],';
540 if(substr($s_out,(strlen($s_out)-1))==
",") $s_out=substr($s_out,0,(strlen($s_out)-1));
543 if ($this->slm->getAPIAdapterName() !=
"API") $s_out.=
'var '.$this->slm->getAPIAdapterName().
'=new iliasApi();';
544 else $s_out.=
'var API=new iliasApi();';
557 $this->tpl =
new ilTemplate(
"tpl.sahs_api.html",
true,
true,
"Modules/ScormAicc");
560 if (
$_GET[
"autolaunch"] !=
"")
562 $this->tpl->setCurrentBlock(
"auto_launch");
563 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
564 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
566 $id_ref = $sc_object->getIdentifierRef();
570 if ($scormtype ==
"asset")
572 $item_command =
"IliasLaunchAsset";
576 $item_command =
"IliasLaunchSahs";
578 $this->tpl->setVariable(
"AUTO_LAUNCH_ID",
$_GET[
"autolaunch"]);
579 $this->tpl->setVariable(
"AUTO_LAUNCH_CMD",
"this.autoLaunch();");
580 $this->tpl->setVariable(
"AUTO_LAUNCH_ITEM_CMD", $item_command);
581 $this->tpl->parseCurrentBlock();
585 if ($slm_obj->getSession()) {
586 $session_timeout = (int)($ilias->ini->readVariable(
"session",
"expire"))/2;
588 $session_timeout = 0;
590 $this->tpl->setVariable(
"PING_SESSION",$session_timeout);
592 $this->tpl->setVariable(
"USER_ID",$ilias->account->getId());
593 $this->tpl->setVariable(
"USER_FIRSTNAME",$ilias->account->getFirstname());
594 $this->tpl->setVariable(
"USER_LASTNAME",$ilias->account->getLastname());
595 $this->tpl->setVariable(
"USER_LOGIN",$ilias->account->getLogin());
596 $this->tpl->setVariable(
"USER_OU",$ilias->account->getDepartment());
597 $this->tpl->setVariable(
"REF_ID",
$_GET[
"ref_id"]);
598 $this->tpl->setVariable(
"SESSION_ID",session_id());
599 $this->tpl->setVariable(
"CODE_BASE",
"http://".$_SERVER[
'SERVER_NAME'].substr($_SERVER[
'PHP_SELF'], 0, strpos ($_SERVER[
'PHP_SELF'],
"/ilias.php")));
601 $this->tpl->parseCurrentBlock();
602 $this->tpl->show(
false);
612 global $ilUser,
$ilDB;
614 $sco_id = (
$_GET[
"sahs_id"] ==
"")
623 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
624 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
627 $id_ref = $item->getIdentifierRef();
629 $resource->readByIdRef($id_ref, $item->getSLMId());
631 $href = $resource->getHref();
632 $this->tpl =
new ilTemplate(
"tpl.sahs_launch_cbt.html",
true,
true,
"Modules/ScormAicc");
633 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
636 $this->tpl->setVariable(
"LAUNCH_DATA", $item->getDataFromLms());
637 $this->tpl->setVariable(
"MAST_SCORE", $item->getMasteryScore());
638 $this->tpl->setVariable(
"MAX_TIME", $item->getMaxTimeAllowed());
639 $this->tpl->setVariable(
"LIMIT_ACT", $item->getTimeLimitAction());
642 if ($this->slm->getAPIAdapterName() !=
"API")
644 $this->tpl->setCurrentBlock(
"alt_api_ref");
645 $this->tpl->setVariable(
"API_NAME", $this->slm->getAPIAdapterName());
646 $this->tpl->parseCurrentBlock();
649 $val_set = $ilDB->queryF(
'
650 SELECT * FROM scorm_tracking
654 array(
'integer',
'integer',
'integer'),
655 array($ilUser->getId(),$sco_id,$this->slm->getId())
658 while($val_rec = $ilDB->fetchAssoc($val_set))
660 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
661 $val_rec[
"rvalue"] = str_replace(
"\r",
"\n", $val_rec[
"rvalue"]);
662 $val_rec[
"rvalue"] = str_replace(
"\n",
"\\n", $val_rec[
"rvalue"]);
663 $re_value[$val_rec[
"lvalue"]] = $val_rec[
"rvalue"];
666 foreach($re_value as $var => $value)
670 case "cmi.core.lesson_location":
671 case "cmi.core.lesson_status":
672 case "cmi.core.entry":
673 case "cmi.core.score.raw":
674 case "cmi.core.score.max":
675 case "cmi.core.score.min":
676 case "cmi.core.total_time":
677 case "cmi.core.exit":
678 case "cmi.suspend_data":
680 case "cmi.student_preference.audio":
681 case "cmi.student_preference.language":
682 case "cmi.student_preference.speed":
683 case "cmi.student_preference.text":
687 case "cmi.objectives._count":
689 $this->
setArray(
"cmi.objectives", $value,
"id", $re_value);
690 $this->
setArray(
"cmi.objectives", $value,
"score.raw", $re_value);
691 $this->
setArray(
"cmi.objectives", $value,
"score.max", $re_value);
692 $this->
setArray(
"cmi.objectives", $value,
"score.min", $re_value);
693 $this->
setArray(
"cmi.objectives", $value,
"status", $re_value);
696 case "cmi.interactions._count":
698 $this->
setArray(
"cmi.interactions", $value,
"id", $re_value);
699 for($i=0; $i<$value; $i++)
701 $var2 =
"cmi.interactions.".$i.
".objectives._count";
702 if (isset($v_array[$var2]))
704 $cnt = $v_array[$var2];
705 $this->
setArray(
"cmi.interactions.".$i.
".objectives",
706 $cnt,
"id", $re_value);
718 $this->
setArray(
"cmi.interactions", $value,
"time", $re_value);
719 $this->
setArray(
"cmi.interactions", $value,
"type", $re_value);
720 for($i=0; $i<$value; $i++)
722 $var2 =
"cmi.interactions.".$i.
".correct_responses._count";
723 if (isset($v_array[$var2]))
725 $cnt = $v_array[$var2];
726 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
727 $cnt,
"pattern", $re_value);
728 $this->
setArray(
"cmi.interactions.".$i.
".correct_responses",
729 $cnt,
"weighting", $re_value);
732 $this->
setArray(
"cmi.interactions", $value,
"student_response", $re_value);
733 $this->
setArray(
"cmi.interactions", $value,
"result", $re_value);
734 $this->
setArray(
"cmi.interactions", $value,
"latency", $re_value);
740 $this->tpl->setCurrentBlock(
"switch_icon");
741 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
743 $this->tpl->setVariable(
"SCO_ALT",
744 $lng->txt(
"cont_status").
": "
745 .$lng->txt(
"cont_sc_stat_running")
747 $this->tpl->parseCurrentBlock();
751 if (count($items) > 1
752 || strtolower(get_class($this->slm)) ==
"ilobjaicclearningmodule"
753 || strtolower(get_class($this->slm)) ==
"ilobjhacplearningmodule")
755 $this->tpl->setVariable(
"SWITCH_ICON_CMD",
"switch_icon();");
760 $lesson_mode = $this->slm->getDefaultLessonMode();
761 if ($this->slm->getAutoReview())
763 if ($re_value[
"cmi.core.lesson_status"] ==
"completed" ||
764 $re_value[
"cmi.core.lesson_status"] ==
"passed" ||
765 $re_value[
"cmi.core.lesson_status"] ==
"failed")
767 $lesson_mode =
"review";
770 $this->tpl->setVariable(
"LESSON_MODE", $lesson_mode);
773 if ($lesson_mode ==
"normal")
775 $this->tpl->setVariable(
"CREDIT_MODE",
776 str_replace(
"_",
"-", $this->slm->getCreditMode()));
780 $this->tpl->setVariable(
"CREDIT_MODE",
"no-credit");
785 if (!isset($re_value[
"cmi.core.total_time"]))
787 $item->insertTrackData(
"cmi.core.total_time",
"0000:00:00", $sahs_obj_id);
789 if (!isset($re_value[
"cmi.core.lesson_status"]))
791 $item->insertTrackData(
"cmi.core.lesson_status",
"not attempted", $sahs_obj_id);
793 if (!isset($re_value[
"cmi.core.entry"]))
795 $item->insertTrackData(
"cmi.core.entry",
"", $sahs_obj_id);
805 $this->tpl =
new ilTemplate(
"tpl.sahs_finish_cbt.html",
true,
true,
"Modules/ScormAicc");
810 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
812 "scorm/".str_replace(
" ",
"_",
$_GET[
"status"]).
'.gif')
814 $this->tpl->setVariable(
"SCO_ALT",
815 $lng->txt(
"cont_status").
": "
816 .$lng->txt(
"cont_sc_stat_".str_replace(
" ",
"_",
$_GET[
"status"])).
", "
817 .$lng->txt(
"cont_total_time").
": "
827 $launch_id =
$_GET[
'launch'];
828 if ($launch_id ==
'null' || $launch_id == null) {
829 require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMTree.php");
832 if ($node_data && $node_data[type] ==
'sit')
834 $launch_id = $node_data[
'child'];
838 $this->tpl->setVariable(
"SCO_LAUNCH_ID", $launch_id);
845 $this->tpl =
new ilTemplate(
"tpl.sahs_unload_cbt.html",
true,
true,
"Modules/ScormAicc");
847 $this->tpl->setVariable(
"SCO_ID",
$_GET[
"sahs_id"]);
854 global $ilUser,
$ilDB;
856 $sco_id = (
$_GET[
"asset_id"] ==
"")
865 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
866 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
869 $id_ref = $item->getIdentifierRef();
871 $resource->readByIdRef($id_ref, $item->getSLMId());
872 $href = $resource->getHref();
873 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
874 $this->tpl =
new ilTemplate(
"tpl.scorm_launch_asset.html",
true,
true,
"Modules/ScormAicc");
875 $this->tpl->setVariable(
"HREF", $this->slm->getDataDirectory(
"output").
"/".$href);
886 $logString = file_get_contents(
'php://input');
887 $ilLog->write(
"ScormAicc: ApiLog: Message: ".$logString);
892 $logString = file_get_contents(
'php://input');
893 $ilLog->write(
"ScormAicc: ApiLog: Warning: ".$logString,20);
901 $this->tpl->setCurrentBlock(
"set_value");
902 $this->tpl->setVariable(
"VAR", $a_var);
903 $this->tpl->setVariable(
"VALUE", $a_value);
904 $this->tpl->parseCurrentBlock();
910 function setArray($a_left, $a_value, $a_name, &$v_array)
912 for($i=0; $i<$a_value; $i++)
914 $var = $a_left.
".".$i.
".".$a_name;
915 if (isset($v_array[$var]))
917 $this->tpl->setCurrentBlock(
"set_value");
918 $this->tpl->setVariable(
"VAR", $var);
919 $this->tpl->setVariable(
"VALUE", $v_array[$var]);
920 $this->tpl->parseCurrentBlock();
930 global $ilUser, $tree;
935 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php";
938 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
943 include_once
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php";
948 include_once
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php";
959 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
960 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
964 "last_access" => $last_access
966 $certificate->outCertificate($params,
true);
970 $parent = $tree->getParentId(
$_GET[
"ref_id"]);
971 $cmd_link =
"repository.php?ref_id=".$parent;