5 require_once
"./Services/Object/classes/class.ilObject.php";
6 require_once
"./Modules/ScormAicc/classes/class.ilObjSCORMValidator.php";
34 parent::ilObject($a_id,$a_call_by_reference);
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"]);
110 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
125 $lm_set = $ilDB->queryF(
'SELECT c_online FROM sahs_lm WHERE id = %s',
126 array(
'integer'), array($a_id));
127 $lm_rec = $ilDB->fetchAssoc(
$lm_set);
141 $lm_set = $ilDB->queryF(
'SELECT localization FROM sahs_lm WHERE id = %s',
142 array(
'integer'), array($a_id));
143 $lm_rec = $ilDB->fetchAssoc(
$lm_set);
144 $inst_lang = $lng->getInstalledLanguages();
145 if ($lm_rec[
"localization"] !=
"" && in_array($lm_rec[
"localization"], $inst_lang))
147 return $lm_rec[
"localization"];
149 return $lng->getLangKey();
161 $obj_set = $ilDB->queryF(
'SELECT c_type FROM sahs_lm WHERE id = %s',
162 array(
'integer'), array($a_obj_id));
163 $obj_rec = $ilDB->fetchAssoc($obj_set);
165 return $obj_rec[
"c_type"];
175 $this->editable = $a_editable;
185 return $this->editable;
196 $this->tries = $a_tries;
216 $this->localization = $a_val;
226 return $this->localization;
233 $lm_set = $ilDB->queryF(
'SELECT question_tries FROM sahs_lm WHERE id = %s',
234 array(
'integer'), array($a_id));
235 $lm_rec = $ilDB->fetchAssoc(
$lm_set);
237 return $lm_rec[
'question_tries'];
247 require_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
269 $lm_dir = $lm_data_dir.
"/lm_".$this->
getId();
279 return $this->api_adapter;
287 $this->api_adapter = $a_api;
295 return $this->api_func_prefix;
303 $this->api_func_prefix = $a_prefix;
311 return $this->credit_mode;
319 $this->credit_mode = $a_credit_mode;
327 $this->lesson_mode = $a_lesson_mode;
335 return $this->lesson_mode;
342 return $this->style_id;
350 $this->style_id = $a_style_id;
374 $this->auto_review = $a_auto_review;
381 return $this->auto_review;
389 return $this->max_attempt;
398 $this->max_attempt = $a_max_attempt;
406 return $this->module_version;
414 return $this->assigned_glossary;
422 $this->assigned_glossary = $a_assigned_glossary;
429 $this->module_version = $a_module_version;
437 return $this->session;
445 $this->session = $a_session;
453 return $this->no_menu;
461 $this->no_menu = $a_no_menu;
469 return $this->hide_navig;
477 $this->hide_navig = $a_hide_navig;
487 if (
$lm_set->get(
"scormdebug_disable_cache") ==
"1")
return true;
498 if (
$lm_set->get(
"scorm_without_session") ==
"1")
return true;
509 if (
$lm_set->get(
"scormdebug_global_activate") ==
"1")
return true;
518 return $this->ie_compatibility;
523 $this->ie_compatibility = $a_ie_compatibility;
531 return $this->ie_force_render;
536 $this->ie_force_render = $a_ie_force_render;
544 return $this->fourth_edition;
549 $this->fourth_edition = $a_fourth_edition;
557 return $this->sequencing;
562 $this->sequencing = $a_sequencing;
570 return $this->interactions;
575 $this->interactions = $a_interactions;
583 return $this->objectives;
588 $this->objectives = $a_objectives;
596 return $this->comments;
601 $this->comments = $a_comments;
609 return $this->time_from_lms;
614 $this->time_from_lms = $a_time_from_lms;
622 return $this->check_values;
627 $this->check_values = $a_check_values;
635 return $this->offline_mode;
640 $this->offline_mode = $a_offline_mode;
657 $this->debug = $a_debug;
665 return $this->debug_pw;
673 $this->debug_pw = $a_debug_pw;
681 $this->auto_continue = $a_auto_continue;
688 return $this->auto_continue;
696 return $this->auto_last_visited;
701 $this->auto_last_visited = $a_auto_last_visited;
712 $this->seq_exp_mode = $a_val;
722 return $this->seq_exp_mode;
730 $this->auto_suspend = $a_auto_suspend;
737 return $this->auto_suspend;
753 return $this->open_mode;
757 $this->open_mode = $a_open_mode;
769 $this->width = $a_width;
777 return $this->height;
781 $this->height = $a_height;
824 if ($uStyleSheetId == null) $uStyleSheetId=0;
826 if ($uOpenMode == null) $uOpenMode=0;
828 if ($uWidth == null) $uWidth=950;
830 if ($uHeight == null) $uHeight=650;
832 $statement = $ilDB->manipulateF(
' 836 api_func_prefix = %s, 838 default_lesson_mode = %s, 847 unlimited_session = %s, 864 auto_last_visited = %s, 868 ie_compatibility = %s, 961 $set = $ilDB->query(
"SELECT DISTINCT id FROM sahs_lm WHERE ".
962 " glossary = ".$ilDB->quote($a_glo_id,
"integer"));
964 while ($rec = $ilDB->fetchAssoc($set))
984 $set = $ilDB->query(
"SELECT DISTINCT glossary FROM sahs_lm WHERE ".
985 " id = ".$ilDB->quote($a_slm_id,
"integer"));
986 $rec = $ilDB->fetchAssoc($set);
987 $glo_id = $rec[
"glossary"];
1000 $this->online = $a_online;
1008 return $this->online;
1016 $this->sub_type = $a_sub_type;
1024 return $this->sub_type;
1043 if (!parent::delete())
1060 $ilDB->manipulateF(
'DELETE FROM sahs_lm WHERE id = %s',
1061 array(
'integer'), array($this->
getId()));
1063 $ilLog->write(
"SAHS Delete(SAHSLM), Subtype: ".$this->
getSubType());
1068 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMTree.php");
1069 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php");
1071 $r_id = $sc_tree->readRootId();
1074 $items = $sc_tree->getSubTree($sc_tree->getNodeData($r_id));
1075 foreach($items as $item)
1078 if (is_object($sc_object))
1080 $sc_object->delete();
1083 $sc_tree->removeTree($sc_tree->getTreeId());
1090 $res = $ilDB->queryF(
' 1091 SELECT aicc_object.obj_id FROM aicc_object, aicc_units 1092 WHERE aicc_object.obj_id = aicc_units.obj_id 1093 AND aicc_object.slm_id = %s',
1094 array(
'integer'), array($this->
getId()));
1096 while(
$row = $ilDB->fetchAssoc(
$res))
1098 $obj_id =
$row[
'obj_id'];
1099 $ilDB->manipulateF(
' 1100 DELETE FROM aicc_units WHERE obj_id = %s',
1101 array(
'integer'), array($obj_id));
1104 $res = $ilDB->queryF(
' 1105 SELECT aicc_object.obj_id FROM aicc_object, aicc_course 1106 WHERE aicc_object.obj_id = aicc_course.obj_id 1107 AND aicc_object.slm_id = %s',
1108 array(
'integer'), array($this->
getId()));
1110 while(
$row = $ilDB->fetchAssoc(
$res))
1112 $obj_id =
$row[
'obj_id'];
1113 $ilDB->manipulateF(
' 1114 DELETE FROM aicc_course WHERE obj_id = %s',
1115 array(
'integer'), array($obj_id));
1118 $ilDB->manipulateF(
' 1119 DELETE FROM aicc_object WHERE slm_id = %s',
1120 array(
'integer'), array($this->
getId()));
1123 $q_log =
"DELETE FROM scorm_tracking WHERE obj_id = ".$ilDB->quote($this->
getId());
1124 $ilLog->write(
"SAHS Delete(SAHSLM): ".$q_log);
1126 $ilDB->manipulateF(
'DELETE FROM scorm_tracking WHERE obj_id = %s',
1127 array(
'integer'), array($this->
getId()));
1129 $q_log =
"DELETE FROM sahs_user WHERE obj_id = ".$ilDB->quote($this->
getId());
1130 $ilLog->write(
"SAHS Delete(SAHSLM): ".$q_log);
1132 $ilDB->manipulateF(
'DELETE FROM sahs_user WHERE obj_id = %s',
1133 array(
'integer'), array($this->
getId()));
1149 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
1189 if ($a_node_id==
$_GET[
"ref_id"])
1191 $parent_obj =& $this->
ilias->obj_factory->getInstanceByRefId($a_node_id);
1192 $parent_type = $parent_obj->getType();
1193 if($parent_type == $this->
getType())
1195 $a_node_id = (int) $tree->getParentId($a_node_id);
1199 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
1210 if (strcmp($this->
getSubType(),
"scorm2004") == 0)
1215 return $res * 100.0;
1242 if(strcmp($this->
getSubType(),
'scorm2004') == 0)
1284 $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
1288 $new_obj->setTitle($this->
getTitle());
1298 $new_obj->setModuleVersion(1);
1301 $new_obj->setTries($this->
getTries());
1303 $new_obj->setNoMenu($this->
getNoMenu());
1305 $new_obj->setFourth_edition($this->getFourth_edition());
1311 $new_obj->setDebug($this->
getDebug());
1316 $new_obj->setWidth($this->
getWidth());
1317 $new_obj->setHeight($this->
getHeight());
1347 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
1353 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
1359 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
1365 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php");
1376 if ($new_obj->getEditable())
1378 $source_obj->copyAuthoredContent($new_obj);
1383 $new_obj->readObject();
setFourth_edition($a_fourth_edition)
getSequencingExpertMode()
Get sequencing expert mode.
getStyleSheetId()
get ID of assigned style sheet object
_lookupOnline($a_id)
check wether scorm module is online
static tf2yn($a_tf)
convert true/false to "y"/"n"
getFourth_Edition()
SCORM 2004 4th edition features.
getIe_compatibility()
set compatibility mode for Internet Exlorer manually
static lookupAssignedGlossary($a_slm_id)
Get SCORM modules that assign a certain glossary.
getDiskUsage()
Gets the disk usage of the object in bytes.
getSession()
get session setting
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
setSequencing($a_sequencing)
getMaxPoints()
Returns score.max for the learning module, refered to the last sco where score.max is set...
setOpenMode($a_open_mode)
getCheck_values()
check_values
getModuleVersion()
get max attempt
updateMetaData()
update meta data entry
Class ilObjAICCLearningModule.
getInteractions()
interactions
getSessionDeactivated()
sessionDisabled for SCORM 2004
getAuto_last_visited()
auto_last_visited
Class ilObject Basic functions for all objects.
getObjectives()
objectives
getAutoContinue()
set auto continue
setCreditMode($a_credit_mode)
set credit mode
setAPIFunctionsPrefix($a_prefix)
set api functions prefix
setOfflineMode($a_offline_mode)
setSubType($a_sub_type)
get sub type
Class ilObjAICCLearningModule.
getAutoReviewChar()
get auto review as Char for SCORM 2004
createMetaData()
create meta data entry
getAPIAdapterName()
get api adapter name
setAutoSuspend($a_auto_suspend)
get auto continue
getAssignedGlossary()
get assigned glossary
getAutoReview()
get auto review as true/false for SCORM 1.2, HACP, SAHS, AICC
setTries($a_tries)
Set default tries for questions.
setAutoReviewChar($a_auto_review)
set auto review as Char for SCORM 2004
getEditable()
Get Editable.
getAPIFunctionsPrefix()
get api functions prefix
createDataDirectory()
creates data directory for package files ("./data/lm_data/lm_<id>")
setAutoContinue($a_auto_continue)
get auto continue
create($upload=false)
create file based lm
populateByDirectoy($a_dir, $a_filename="")
Populate by directory.
setAutoReview($a_auto_review)
set auto review as true/false for SCORM 1.2, HACP, SAHS, AICC
getMaxAttempt()
get max attempt
notify($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
notifys an object about an event occured Based on the event happend, each object may decide how it re...
getDataDirectory($mode="filesystem")
get data directory of lm
getIe_force_render()
force Internet Explorer to render again after some Milliseconds - useful for learning Modules with a ...
setLocalization($a_val)
Set localization.
_lookupDiskUsage($a_id)
Returns the number of bytes used on the harddisk by the learning module with the specified object id...
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
getId()
get object id public
setIe_compatibility($a_ie_compatibility)
getOpenMode()
open_mode 0: in Tab/new Window like in previous versions 1: in iFrame with width=100% and heigth=100%...
setAuto_last_visited($a_auto_last_visited)
ilObjSAHSLearningModule($a_id=0, $a_call_by_reference=true)
Constructor public.
getSequencing()
sequencing
_lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
static _getUniqueScaledScoreForUser($a_id, $a_user)
Get the Unique Scaled Score of a course Conditions: Only one SCO may set cmi.score.scaled.
getTitle()
get object title public
getDescription()
get object description
redirection script todo: (a better solution should control the processing via a xml file) ...
cloneMetaData($target_obj)
Copy meta data.
setHideNavig($a_hide_navig)
disable menu
getHideNavig()
hide navigation tree
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
getType()
get object type public
static _lookupType($a_id, $a_reference=false)
lookup object type
getAutoSuspend()
set auto continue
setSession($a_session)
set session setting
setDebugPw($a_debug_pw)
debug pw
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
setIe_force_render($a_ie_force_render)
setSequencingExpertMode($a_val)
Set sequencing expert mode.
getDebugActivated()
debugActivated
static getScormModulesForGlossary($a_glo_id)
Get SCORM modules that assign a certain glossary.
_hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
update()
update meta data only
static getDataDir()
get data directory (outside webspace)
getCreditMode()
get credit mode
getPointsInPercent()
Returns the points in percent for the learning module This is called by the certificate generator if ...
getAffectiveLocalization($a_id)
Get affective localization.
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
setAPIAdapterName($a_api)
set api adapter name
Class ilObjSCORM2004LearningModule.
setInteractions($a_interactions)
setOnline($a_online)
get online
setCheck_values($a_check_values)
getRefId()
get reference id public
getOfflineMode()
offlineMode
deleteMetaData()
delete meta data entry
getLocalization()
Get localization.
static _getMaxScoreForUser($a_id, $a_user)
Returns score.max for the learning module, refered to the last sco where score.max is set...
setEditable($a_editable)
Set Editable.
getDefaultLessonMode()
get default lesson mode
static yn2tf($a_yn)
convert "y"/"n" to true/false
setNoMenu($a_no_menu)
disable menu
& _getInstance($a_id, $a_slm_id)
get instance of specialized GUI class
setDefaultLessonMode($a_lesson_mode)
set default lesson mode
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getWebspaceDir($mode="filesystem")
get webspace directory
setObjectives($a_objectives)
setAssignedGlossary($a_assigned_glossary)
set assigned glossary
Class ilObjSCORMLearningModule.
setTime_from_lms($a_time_from_lms)
setMaxAttempt($a_max_attempt)
set max attempt
setModuleVersion($a_module_version)
set max attempt
Class ilObjSCORMLearningModule.
getCacheDeactivated()
BrowserCacheDisabled for SCORM 2004 / ENABLE_JS_DEBUG.
cloneObject($a_target_id, $a_copy_id=0)
Clone scorm object.
getTime_from_lms()
time_from_lms