5 require_once
"./Services/Object/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"]);
105 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
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 $lm_set = $ilDB->queryF(
'SELECT localization FROM sahs_lm WHERE id = %s',
137 array(
'integer'), array($a_id));
138 $lm_rec = $ilDB->fetchAssoc($lm_set);
139 $inst_lang = $lng->getInstalledLanguages();
140 if ($lm_rec[
"localization"] !=
"" && in_array($lm_rec[
"localization"], $inst_lang))
142 return $lm_rec[
"localization"];
144 return $lng->getLangKey();
156 $obj_set = $ilDB->queryF(
'SELECT c_type FROM sahs_lm WHERE id = %s',
157 array(
'integer'), array($a_obj_id));
158 $obj_rec = $ilDB->fetchAssoc($obj_set);
160 return $obj_rec[
"c_type"];
170 $this->editable = $a_editable;
180 return $this->editable;
191 $this->tries = $a_tries;
211 $this->localization = $a_val;
221 return $this->localization;
228 $lm_set = $ilDB->queryF(
'SELECT question_tries FROM sahs_lm WHERE id = %s',
229 array(
'integer'), array($a_id));
230 $lm_rec = $ilDB->fetchAssoc($lm_set);
232 return $lm_rec[
'question_tries'];
242 require_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
264 $lm_dir = $lm_data_dir.
"/lm_".$this->
getId();
274 return $this->api_adapter;
282 $this->api_adapter = $a_api;
290 return $this->api_func_prefix;
298 $this->api_func_prefix = $a_prefix;
306 return $this->credit_mode;
314 $this->credit_mode = $a_credit_mode;
322 $this->lesson_mode = $a_lesson_mode;
330 return $this->lesson_mode;
337 return $this->style_id;
345 $this->style_id = $a_style_id;
354 $this->auto_review = $a_auto_review;
361 return $this->auto_review;
370 return $this->max_attempt;
379 $this->max_attempt = $a_max_attempt;
387 return $this->module_version;
395 return $this->assigned_glossary;
403 $this->assigned_glossary = $a_assigned_glossary;
410 $this->module_version = $a_module_version;
418 return $this->session;
426 $this->session = $a_session;
434 return $this->no_menu;
442 $this->no_menu = $a_no_menu;
450 return $this->hide_navig;
458 $this->hide_navig = $a_hide_navig;
468 if ($lm_set->get(
"scormdebug_disable_cache") ==
"1")
return true;
479 if ($lm_set->get(
"scormdebug_global_activate") ==
"1")
return true;
488 return $this->sequencing;
493 $this->sequencing = $a_sequencing;
501 return $this->interactions;
506 $this->interactions = $a_interactions;
514 return $this->objectives;
519 $this->objectives = $a_objectives;
527 return $this->comments;
532 $this->comments = $a_comments;
540 return $this->time_from_lms;
545 $this->time_from_lms = $a_time_from_lms;
553 return $this->check_values;
558 $this->check_values = $a_check_values;
574 $this->debug = $a_debug;
582 return $this->debug_pw;
590 $this->debug_pw = $a_debug_pw;
598 $this->auto_continue = $a_auto_continue;
605 return $this->auto_continue;
613 return $this->auto_last_visited;
618 $this->auto_last_visited = $a_auto_last_visited;
629 $this->seq_exp_mode = $a_val;
639 return $this->seq_exp_mode;
655 return $this->open_mode;
659 $this->open_mode = $a_open_mode;
671 $this->width = $a_width;
679 return $this->height;
683 $this->height = $a_height;
725 $statement = $ilDB->manipulateF(
'
729 api_func_prefix = %s,
731 default_lesson_mode = %s,
740 unlimited_session = %s,
756 auto_last_visited = %s,
839 $set = $ilDB->query(
"SELECT DISTINCT id FROM sahs_lm WHERE ".
840 " glossary = ".$ilDB->quote($a_glo_id,
"integer"));
842 while ($rec = $ilDB->fetchAssoc($set))
857 $this->online = $a_online;
865 return $this->online;
873 $this->sub_type = $a_sub_type;
881 return $this->sub_type;
900 if (!parent::delete())
917 $ilDB->manipulateF(
'DELETE FROM sahs_lm WHERE id = %s',
918 array(
'integer'), array($this->
getId()));
920 $ilLog->write(
"SAHS Delete(SAHSLM), Subtype: ".$this->
getSubType());
925 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMTree.php");
926 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php");
928 $r_id = $sc_tree->readRootId();
931 $items = $sc_tree->getSubTree($sc_tree->getNodeData($r_id));
932 foreach($items as $item)
935 if (is_object($sc_object))
937 $sc_object->delete();
940 $sc_tree->removeTree($sc_tree->getTreeId());
947 $res = $ilDB->queryF(
'
948 SELECT aicc_object.obj_id FROM aicc_object, aicc_units
949 WHERE aicc_object.obj_id = aicc_units.obj_id
950 AND aicc_object.slm_id = %s',
951 array(
'integer'), array($this->
getId()));
953 while(
$row = $ilDB->fetchAssoc(
$res))
955 $obj_id =
$row[
'obj_id'];
957 DELETE FROM aicc_units WHERE obj_id = %s',
958 array(
'integer'), array($obj_id));
961 $res = $ilDB->queryF(
'
962 SELECT aicc_object.obj_id FROM aicc_object, aicc_course
963 WHERE aicc_object.obj_id = aicc_course.obj_id
964 AND aicc_object.slm_id = %s',
965 array(
'integer'), array($this->
getId()));
967 while(
$row = $ilDB->fetchAssoc(
$res))
969 $obj_id =
$row[
'obj_id'];
971 DELETE FROM aicc_course WHERE obj_id = %s',
972 array(
'integer'), array($obj_id));
976 DELETE FROM aicc_object WHERE slm_id = %s',
977 array(
'integer'), array($this->
getId()));
980 $q_log =
"DELETE FROM scorm_tracking WHERE obj_id = ".$ilDB->quote($this->
getId());
981 $ilLog->write(
"SAHS Delete(SAHSLM): ".$q_log);
983 $ilDB->manipulateF(
'DELETE FROM scorm_tracking WHERE obj_id = %s',
984 array(
'integer'), array($this->
getId()));
1000 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
1040 if ($a_node_id==
$_GET[
"ref_id"])
1042 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
1043 $parent_type = $parent_obj->getType();
1044 if($parent_type == $this->
getType())
1046 $a_node_id = (int) $tree->getParentId($a_node_id);
1050 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
1061 if (strcmp($this->
getSubType(),
"scorm2004") == 0)
1066 return $res * 100.0;
1093 if(strcmp($this->
getSubType(),
'scorm2004') == 0)
1139 $new_obj->setTitle($this->
getTitle());
1149 $new_obj->setModuleVersion(1);
1152 $new_obj->setTries($this->
getTries());
1154 $new_obj->setNoMenu($this->
getNoMenu());
1161 $new_obj->setDebug($this->
getDebug());
1166 $new_obj->setWidth($this->
getWidth());
1167 $new_obj->setHeight($this->
getHeight());
1192 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
1198 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
1204 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
1210 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php");
1221 if ($new_obj->getEditable())
1223 $source_obj->copyAuthoredContent($new_obj);
1228 $new_obj->readObject();