25 require_once
"classes/class.ilObject.php";
26 require_once
"./Modules/ScormAicc/classes/class.ilObjSCORMValidator.php";
71 INSERT INTO sahs_lm (id, c_online, api_adapter, c_type, editable)
72 VALUES (%s,%s,%s,%s,%s)',
73 array(
'integer',
'text',
'text',
'text',
'integer'),
86 $lm_set = $ilDB->queryF(
'SELECT * FROM sahs_lm WHERE id = %s',
87 array(
'integer'),array($this->
getId()));
89 while($lm_rec = $ilDB->fetchAssoc($lm_set))
103 $this->
setTries($lm_rec[
"question_tries"]);
120 $lm_set = $ilDB->queryF(
'SELECT c_online FROM sahs_lm WHERE id = %s',
121 array(
'integer'), array($a_id));
122 $lm_rec = $ilDB->fetchAssoc($lm_set);
136 $obj_set = $ilDB->queryF(
'SELECT c_type FROM sahs_lm WHERE id = %s',
137 array(
'integer'), array($a_obj_id));
138 $obj_rec = $ilDB->fetchAssoc($obj_set);
140 return $obj_rec[
"c_type"];
150 $this->editable = $a_editable;
160 return $this->editable;
171 $this->tries = $a_tries;
188 $lm_set = $ilDB->queryF(
'SELECT question_tries FROM sahs_lm WHERE id = %s',
189 array(
'integer'), array($a_id));
190 $lm_rec = $ilDB->fetchAssoc($lm_set);
192 return $lm_rec[
'question_tries'];
202 require_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
224 $lm_dir = $lm_data_dir.
"/lm_".$this->
getId();
234 return $this->api_adapter;
242 $this->api_adapter = $a_api;
250 return $this->api_func_prefix;
258 $this->api_func_prefix = $a_prefix;
266 return $this->credit_mode;
274 $this->credit_mode = $a_credit_mode;
282 $this->lesson_mode = $a_lesson_mode;
290 return $this->lesson_mode;
297 return $this->style_id;
305 $this->style_id = $a_style_id;
314 $this->auto_review = $a_auto_review;
321 return $this->auto_review;
330 return $this->max_attempt;
339 $this->max_attempt = $a_max_attempt;
347 return $this->module_version;
355 return $this->assigned_glossary;
363 $this->assigned_glossary = $a_assigned_glossary;
370 $this->module_version = $a_module_version;
378 return $this->session;
386 $this->session = $a_session;
394 return $this->no_menu;
402 $this->no_menu = $a_no_menu;
410 return $this->hide_navig;
418 $this->hide_navig = $a_hide_navig;
435 $this->debug = $a_debug;
443 return $this->debug_pw;
451 $this->debug_pw = $a_debug_pw;
459 $this->auto_continue = $a_auto_continue;
466 return $this->auto_continue;
506 $statement = $ilDB->manipulateF(
'
510 api_func_prefix = %s,
512 default_lesson_mode = %s,
521 unlimited_session = %s,
584 $set = $ilDB->query(
"SELECT DISTINCT id FROM sahs_lm WHERE ".
585 " glossary = ".$ilDB->quote($a_glo_id,
"integer"));
587 while ($rec = $ilDB->fetchAssoc($set))
602 $this->online = $a_online;
610 return $this->online;
618 $this->sub_type = $a_sub_type;
626 return $this->sub_type;
645 if (!parent::delete())
662 $ilDB->manipulateF(
'DELETE FROM sahs_lm WHERE id = %s',
663 array(
'integer'), array($this->
getId()));
665 $ilLog->write(
"SAHS Delete(SAHSLM), Subtype: ".$this->
getSubType());
670 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMTree.php");
671 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php");
673 $r_id = $sc_tree->readRootId();
676 $items = $sc_tree->getSubTree($sc_tree->getNodeData($r_id));
677 foreach($items as $item)
680 if (is_object($sc_object))
682 $sc_object->delete();
685 $sc_tree->removeTree($sc_tree->getTreeId());
692 $res = $ilDB->queryF(
'
693 SELECT aicc_object.obj_id FROM aicc_object, aicc_units
694 WHERE aicc_object.obj_id = aicc_units.obj_id
695 AND aicc_object.slm_id = %s',
696 array(
'integer'), array($this->
getId()));
698 while(
$row = $ilDB->fetchAssoc(
$res))
700 $obj_id =
$row[
'obj_id'];
702 DELETE FROM aicc_units WHERE obj_id = %s',
703 array(
'integer'), array($obj_id));
706 $res = $ilDB->queryF(
'
707 SELECT aicc_object.obj_id FROM aicc_object, aicc_course
708 WHERE aicc_object.obj_id = aicc_course.obj_id
709 AND aicc_object.slm_id = %s',
710 array(
'integer'), array($this->
getId()));
712 while(
$row = $ilDB->fetchAssoc(
$res))
714 $obj_id =
$row[
'obj_id'];
716 DELETE FROM aicc_course WHERE obj_id = %s',
717 array(
'integer'), array($obj_id));
721 DELETE FROM aicc_object WHERE slm_id = %s',
722 array(
'integer'), array($this->
getId()));
725 $q_log =
"DELETE FROM scorm_tracking WHERE obj_id = ".$ilDB->quote($this->
getId());
726 $ilLog->write(
"SAHS Delete(SAHSLM): ".$q_log);
728 $ilDB->manipulateF(
'DELETE FROM scorm_tracking WHERE obj_id = %s',
729 array(
'integer'), array($this->
getId()));
745 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
785 if ($a_node_id==
$_GET[
"ref_id"])
787 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
788 $parent_type = $parent_obj->getType();
789 if($parent_type == $this->
getType())
791 $a_node_id = (int) $tree->getParentId($a_node_id);
795 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
806 if (strcmp($this->
getSubType(),
"scorm2004") == 0)