5 require_once
"classes/class.ilObject.php";
6 require_once
"./Modules/ScormAicc/classes/class.ilObjSCORMValidator.php";
51 INSERT INTO sahs_lm (id, c_online, api_adapter, c_type, editable, seq_exp_mode,localization)
52 VALUES (%s,%s,%s,%s,%s,%s,%s)',
53 array(
'integer',
'text',
'text',
'text',
'integer',
'integer',
'text'),
68 $lm_set = $ilDB->queryF(
'SELECT * FROM sahs_lm WHERE id = %s',
69 array(
'integer'),array($this->
getId()));
71 while($lm_rec = $ilDB->fetchAssoc($lm_set))
85 $this->
setTries($lm_rec[
"question_tries"]);
112 $lm_set = $ilDB->queryF(
'SELECT c_online FROM sahs_lm WHERE id = %s',
113 array(
'integer'), array($a_id));
114 $lm_rec = $ilDB->fetchAssoc($lm_set);
128 $lm_set = $ilDB->queryF(
'SELECT localization FROM sahs_lm WHERE id = %s',
129 array(
'integer'), array($a_id));
130 $lm_rec = $ilDB->fetchAssoc($lm_set);
131 $inst_lang = $lng->getInstalledLanguages();
132 if ($lm_rec[
"localization"] !=
"" && in_array($lm_rec[
"localization"], $inst_lang))
134 return $lm_rec[
"localization"];
136 return $lng->getLangKey();
148 $obj_set = $ilDB->queryF(
'SELECT c_type FROM sahs_lm WHERE id = %s',
149 array(
'integer'), array($a_obj_id));
150 $obj_rec = $ilDB->fetchAssoc($obj_set);
152 return $obj_rec[
"c_type"];
162 $this->editable = $a_editable;
172 return $this->editable;
183 $this->tries = $a_tries;
203 $this->localization = $a_val;
213 return $this->localization;
220 $lm_set = $ilDB->queryF(
'SELECT question_tries FROM sahs_lm WHERE id = %s',
221 array(
'integer'), array($a_id));
222 $lm_rec = $ilDB->fetchAssoc($lm_set);
224 return $lm_rec[
'question_tries'];
234 require_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
256 $lm_dir = $lm_data_dir.
"/lm_".$this->
getId();
266 return $this->api_adapter;
274 $this->api_adapter = $a_api;
282 return $this->api_func_prefix;
290 $this->api_func_prefix = $a_prefix;
298 return $this->credit_mode;
306 $this->credit_mode = $a_credit_mode;
314 $this->lesson_mode = $a_lesson_mode;
322 return $this->lesson_mode;
329 return $this->style_id;
337 $this->style_id = $a_style_id;
346 $this->auto_review = $a_auto_review;
353 return $this->auto_review;
362 return $this->max_attempt;
371 $this->max_attempt = $a_max_attempt;
379 return $this->module_version;
387 return $this->assigned_glossary;
395 $this->assigned_glossary = $a_assigned_glossary;
402 $this->module_version = $a_module_version;
410 return $this->session;
418 $this->session = $a_session;
426 return $this->no_menu;
434 $this->no_menu = $a_no_menu;
442 return $this->hide_navig;
450 $this->hide_navig = $a_hide_navig;
460 if ($lm_set->get(
"scormdebug_disable_cache") ==
"1")
return true;
471 if ($lm_set->get(
"scormdebug_global_activate") ==
"1")
return true;
480 return $this->sequencing;
485 $this->sequencing = $a_sequencing;
493 return $this->interactions;
498 $this->interactions = $a_interactions;
506 return $this->objectives;
511 $this->objectives = $a_objectives;
519 return $this->comments;
524 $this->comments = $a_comments;
532 return $this->time_from_lms;
537 $this->time_from_lms = $a_time_from_lms;
554 $this->debug = $a_debug;
562 return $this->debug_pw;
570 $this->debug_pw = $a_debug_pw;
578 $this->auto_continue = $a_auto_continue;
585 return $this->auto_continue;
596 $this->seq_exp_mode = $a_val;
606 return $this->seq_exp_mode;
622 return $this->open_mode;
626 $this->open_mode = $a_open_mode;
638 $this->width = $a_width;
646 return $this->height;
650 $this->height = $a_height;
692 $statement = $ilDB->manipulateF(
'
696 api_func_prefix = %s,
698 default_lesson_mode = %s,
707 unlimited_session = %s,
800 $set = $ilDB->query(
"SELECT DISTINCT id FROM sahs_lm WHERE ".
801 " glossary = ".$ilDB->quote($a_glo_id,
"integer"));
803 while ($rec = $ilDB->fetchAssoc($set))
818 $this->online = $a_online;
826 return $this->online;
834 $this->sub_type = $a_sub_type;
842 return $this->sub_type;
861 if (!parent::delete())
878 $ilDB->manipulateF(
'DELETE FROM sahs_lm WHERE id = %s',
879 array(
'integer'), array($this->
getId()));
881 $ilLog->write(
"SAHS Delete(SAHSLM), Subtype: ".$this->
getSubType());
886 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMTree.php");
887 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php");
889 $r_id = $sc_tree->readRootId();
892 $items = $sc_tree->getSubTree($sc_tree->getNodeData($r_id));
893 foreach($items as $item)
896 if (is_object($sc_object))
898 $sc_object->delete();
901 $sc_tree->removeTree($sc_tree->getTreeId());
908 $res = $ilDB->queryF(
'
909 SELECT aicc_object.obj_id FROM aicc_object, aicc_units
910 WHERE aicc_object.obj_id = aicc_units.obj_id
911 AND aicc_object.slm_id = %s',
912 array(
'integer'), array($this->
getId()));
914 while(
$row = $ilDB->fetchAssoc(
$res))
916 $obj_id =
$row[
'obj_id'];
918 DELETE FROM aicc_units WHERE obj_id = %s',
919 array(
'integer'), array($obj_id));
922 $res = $ilDB->queryF(
'
923 SELECT aicc_object.obj_id FROM aicc_object, aicc_course
924 WHERE aicc_object.obj_id = aicc_course.obj_id
925 AND aicc_object.slm_id = %s',
926 array(
'integer'), array($this->
getId()));
928 while(
$row = $ilDB->fetchAssoc(
$res))
930 $obj_id =
$row[
'obj_id'];
932 DELETE FROM aicc_course WHERE obj_id = %s',
933 array(
'integer'), array($obj_id));
937 DELETE FROM aicc_object WHERE slm_id = %s',
938 array(
'integer'), array($this->
getId()));
941 $q_log =
"DELETE FROM scorm_tracking WHERE obj_id = ".$ilDB->quote($this->
getId());
942 $ilLog->write(
"SAHS Delete(SAHSLM): ".$q_log);
944 $ilDB->manipulateF(
'DELETE FROM scorm_tracking WHERE obj_id = %s',
945 array(
'integer'), array($this->
getId()));
961 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
1001 if ($a_node_id==
$_GET[
"ref_id"])
1003 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
1004 $parent_type = $parent_obj->getType();
1005 if($parent_type == $this->
getType())
1007 $a_node_id = (int) $tree->getParentId($a_node_id);
1011 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
1022 if (strcmp($this->
getSubType(),
"scorm2004") == 0)
1027 return $res * 100.0;
1054 if(strcmp($this->
getSubType(),
'scorm2004') == 0)