25 require_once
"classes/class.ilObject.php";
26 require_once
"./Modules/ScormAicc/classes/class.ilObjSCORMValidator.php";
70 INSERT INTO sahs_lm (id, c_online, api_adapter, c_type, editable)
71 VALUES (%s,%s,%s,%s,%s)',
72 array(
'integer',
'text',
'text',
'text',
'integer'),
85 $lm_set = $ilDB->queryF(
'SELECT * FROM sahs_lm WHERE id = %s',
86 array(
'integer'),array($this->
getId()));
88 while($lm_rec = $ilDB->fetchAssoc($lm_set))
102 $this->
setTries($lm_rec[
"question_tries"]);
118 $lm_set = $ilDB->queryF(
'SELECT c_online FROM sahs_lm WHERE id = %s',
119 array(
'integer'), array($a_id));
120 $lm_rec = $ilDB->fetchAssoc($lm_set);
134 $obj_set = $ilDB->queryF(
'SELECT c_type FROM sahs_lm WHERE id = %s',
135 array(
'integer'), array($a_obj_id));
136 $obj_rec = $ilDB->fetchAssoc($obj_set);
138 return $obj_rec[
"c_type"];
148 $this->editable = $a_editable;
158 return $this->editable;
169 $this->tries = $a_tries;
186 $lm_set = $ilDB->queryF(
'SELECT question_tries FROM sahs_lm WHERE id = %s',
187 array(
'integer'), array($a_id));
188 $lm_rec = $ilDB->fetchAssoc($lm_set);
190 return $lm_rec[
'question_tries'];
200 require_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
222 $lm_dir = $lm_data_dir.
"/lm_".$this->
getId();
232 return $this->api_adapter;
240 $this->api_adapter = $a_api;
248 return $this->api_func_prefix;
256 $this->api_func_prefix = $a_prefix;
264 return $this->credit_mode;
272 $this->credit_mode = $a_credit_mode;
280 $this->lesson_mode = $a_lesson_mode;
288 return $this->lesson_mode;
295 return $this->style_id;
303 $this->style_id = $a_style_id;
312 $this->auto_review = $a_auto_review;
319 return $this->auto_review;
328 return $this->max_attempt;
337 $this->max_attempt = $a_max_attempt;
345 return $this->module_version;
353 return $this->assigned_glossary;
361 $this->assigned_glossary = $a_assigned_glossary;
368 $this->module_version = $a_module_version;
376 return $this->session;
384 $this->session = $a_session;
392 return $this->no_menu;
400 $this->no_menu = $a_no_menu;
408 return $this->hide_navig;
416 $this->hide_navig = $a_hide_navig;
433 $this->debug = $a_debug;
441 return $this->debug_pw;
449 $this->debug_pw = $a_debug_pw;
490 $statement = $ilDB->manipulateF(
'
494 api_func_prefix = %s,
496 default_lesson_mode = %s,
505 unlimited_session = %s,
561 $this->online = $a_online;
569 return $this->online;
577 $this->sub_type = $a_sub_type;
585 return $this->sub_type;
604 if (!parent::delete())
621 $ilDB->manipulateF(
'DELETE FROM sahs_lm WHERE id = %s',
622 array(
'integer'), array($this->
getId()));
624 $ilLog->write(
"SAHS Delete(SAHSLM), Subtype: ".$this->
getSubType());
629 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMTree.php");
630 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php");
632 $r_id = $sc_tree->readRootId();
635 $items = $sc_tree->getSubTree($sc_tree->getNodeData($r_id));
636 foreach($items as $item)
639 if (is_object($sc_object))
641 $sc_object->delete();
644 $sc_tree->removeTree($sc_tree->getTreeId());
651 $res = $ilDB->queryF(
'
652 SELECT aicc_object.obj_id FROM aicc_object, aicc_units
653 WHERE aicc_object.obj_id = aicc_units.obj_id
654 AND aicc_object.slm_id = %s',
655 array(
'integer'), array($this->
getId()));
657 while(
$row = $ilDB->fetchAssoc(
$res))
659 $obj_id =
$row[
'obj_id'];
661 DELETE FROM aicc_units WHERE obj_id = %s',
662 array(
'integer'), array($obj_id));
665 $res = $ilDB->queryF(
'
666 SELECT aicc_object.obj_id FROM aicc_object, aicc_course
667 WHERE aicc_object.obj_id = aicc_course.obj_id
668 AND aicc_object.slm_id = %s',
669 array(
'integer'), array($this->
getId()));
671 while(
$row = $ilDB->fetchAssoc(
$res))
673 $obj_id =
$row[
'obj_id'];
675 DELETE FROM aicc_course WHERE obj_id = %s',
676 array(
'integer'), array($obj_id));
680 DELETE FROM aicc_object WHERE slm_id = %s',
681 array(
'integer'), array($this->
getId()));
684 $q_log =
"DELETE FROM scorm_tracking WHERE obj_id = ".$ilDB->quote($this->
getId());
685 $ilLog->write(
"SAHS Delete(SAHSLM): ".$q_log);
687 $ilDB->manipulateF(
'DELETE FROM scorm_tracking WHERE obj_id = %s',
688 array(
'integer'), array($this->
getId()));
704 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
744 if ($a_node_id==
$_GET[
"ref_id"])
746 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
747 $parent_type = $parent_obj->getType();
748 if($parent_type == $this->
getType())
750 $a_node_id = (int) $tree->getParentId($a_node_id);
754 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
765 if (strcmp($this->
getSubType(),
"scorm2004") == 0)