5require_once
"./Services/Object/classes/class.ilObject.php";
6require_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()));
85 $this->
setTries($lm_rec[
"question_tries"]);
111 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
126 $lm_set =
$ilDB->queryF(
'SELECT c_online FROM sahs_lm WHERE id = %s',
127 array(
'integer'), array($a_id));
142 $lm_set =
$ilDB->queryF(
'SELECT localization FROM sahs_lm WHERE id = %s',
143 array(
'integer'), array($a_id));
145 $inst_lang =
$lng->getInstalledLanguages();
146 if ($lm_rec[
"localization"] !=
"" && in_array($lm_rec[
"localization"], $inst_lang))
148 return $lm_rec[
"localization"];
150 return $lng->getLangKey();
162 $obj_set =
$ilDB->queryF(
'SELECT c_type FROM sahs_lm WHERE id = %s',
163 array(
'integer'), array($a_obj_id));
164 $obj_rec =
$ilDB->fetchAssoc($obj_set);
166 return $obj_rec[
"c_type"];
176 $this->editable = $a_editable;
186 return $this->editable;
197 $this->tries = $a_tries;
217 $this->localization = $a_val;
227 return $this->localization;
234 $lm_set =
$ilDB->queryF(
'SELECT question_tries FROM sahs_lm WHERE id = %s',
235 array(
'integer'), array($a_id));
238 return $lm_rec[
'question_tries'];
248 require_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
270 $lm_dir = $lm_data_dir.
"/lm_".$this->
getId();
280 return $this->api_adapter;
288 $this->api_adapter = $a_api;
296 return $this->api_func_prefix;
304 $this->api_func_prefix = $a_prefix;
312 return $this->credit_mode;
320 $this->credit_mode = $a_credit_mode;
328 $this->lesson_mode = $a_lesson_mode;
336 return $this->lesson_mode;
343 return $this->style_id;
351 $this->style_id = $a_style_id;
375 $this->auto_review = $a_auto_review;
382 return $this->auto_review;
390 return $this->max_attempt;
399 $this->max_attempt = $a_max_attempt;
407 return $this->module_version;
415 return $this->assigned_glossary;
423 $this->assigned_glossary = $a_assigned_glossary;
430 $this->module_version = $a_module_version;
438 return $this->session;
446 $this->session = $a_session;
454 return $this->no_menu;
462 $this->no_menu = $a_no_menu;
470 return $this->hide_navig;
478 $this->hide_navig = $a_hide_navig;
488 if (
$lm_set->get(
"scormdebug_disable_cache") ==
"1")
return true;
499 if (
$lm_set->get(
"scorm_without_session") ==
"1")
return true;
510 if (
$lm_set->get(
"scormdebug_global_activate") ==
"1")
return true;
519 return $this->ie_compatibility;
524 $this->ie_compatibility = $a_ie_compatibility;
532 return $this->ie_force_render;
537 $this->ie_force_render = $a_ie_force_render;
545 return $this->fourth_edition;
550 $this->fourth_edition = $a_fourth_edition;
558 return $this->sequencing;
563 $this->sequencing = $a_sequencing;
571 return $this->interactions;
576 $this->interactions = $a_interactions;
584 return $this->objectives;
589 $this->objectives = $a_objectives;
597 return $this->comments;
602 $this->comments = $a_comments;
610 return $this->time_from_lms;
615 $this->time_from_lms = $a_time_from_lms;
623 return $this->check_values;
628 $this->check_values = $a_check_values;
636 return $this->offline_mode;
641 $this->offline_mode = $a_offline_mode;
658 $this->debug = $a_debug;
666 return $this->debug_pw;
674 $this->debug_pw = $a_debug_pw;
682 $this->auto_continue = $a_auto_continue;
689 return $this->auto_continue;
697 return $this->auto_last_visited;
702 $this->auto_last_visited = $a_auto_last_visited;
713 $this->seq_exp_mode = $a_val;
723 return $this->seq_exp_mode;
731 $this->auto_suspend = $a_auto_suspend;
738 return $this->auto_suspend;
754 return $this->open_mode;
758 $this->open_mode = $a_open_mode;
770 $this->width = $a_width;
778 return $this->height;
782 $this->height = $a_height;
791 return $this->mastery_score;
799 $this->mastery_score = $a_mastery_score;
812 if (
$type ==
"scorm2004") {
813 $set =
$ilDB->query(
"SELECT minnormalmeasure FROM cp_objective, cp_node".
814 " WHERE satisfiedbymeasure=1 AND minnormalmeasure is not null AND cp_objective.cp_node_id=cp_node.cp_node_id AND".
815 " slm_id = ".
$ilDB->quote($this->getID(),
"integer"));
816 while ($rec =
$ilDB->fetchAssoc($set)) {
817 $tmpval = $rec[
"minnormalmeasure"]*100;
818 if (!in_array($tmpval,$a_result)) $a_result[] = $tmpval;
821 $set =
$ilDB->query(
"SELECT masteryscore FROM sc_item,scorm_object".
822 " WHERE sc_item.masteryscore is not null AND sc_item.obj_id=scorm_object.obj_id AND".
823 " slm_id = ".
$ilDB->quote($this->getID(),
"integer"));
824 while ($rec =
$ilDB->fetchAssoc($set)) {
825 if (!in_array($rec[
"masteryscore"],$a_result)) $a_result[] = $rec[
"masteryscore"];
828 $s_result = implode(
", ",$a_result);
829 $this->mastery_score_values = $s_result;
837 return $this->mastery_score_values;
913 if ($s_mastery_score ==
"") $s_mastery_score =
null;
915 $statement =
$ilDB->manipulateF(
'
919 api_func_prefix = %s,
921 default_lesson_mode = %s,
930 unlimited_session = %s,
947 auto_last_visited = %s,
951 ie_compatibility = %s,
952 ie_force_render = %s,
1047 $set =
$ilDB->query(
"SELECT DISTINCT id FROM sahs_lm WHERE ".
1048 " glossary = ".
$ilDB->quote($a_glo_id,
"integer"));
1050 while ($rec =
$ilDB->fetchAssoc($set))
1054 $sms[] = $rec[
"id"];
1070 $set =
$ilDB->query(
"SELECT DISTINCT glossary FROM sahs_lm WHERE ".
1071 " id = ".
$ilDB->quote($a_slm_id,
"integer"));
1072 $rec =
$ilDB->fetchAssoc($set);
1073 $glo_id = $rec[
"glossary"];
1086 $this->online = $a_online;
1094 return $this->online;
1102 $this->sub_type = $a_sub_type;
1110 return $this->sub_type;
1129 if (!parent::delete())
1146 $ilDB->manipulateF(
'DELETE FROM sahs_lm WHERE id = %s',
1147 array(
'integer'), array($this->
getId()));
1149 $ilLog->write(
"SAHS Delete(SAHSLM), Subtype: ".$this->
getSubType());
1154 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMTree.php");
1155 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php");
1157 $r_id = $sc_tree->readRootId();
1160 $items = $sc_tree->getSubTree($sc_tree->getNodeData($r_id));
1161 foreach($items as $item)
1164 if (is_object($sc_object))
1166 $sc_object->delete();
1169 $sc_tree->removeTree($sc_tree->getTreeId());
1176 $res = $ilDB->queryF(
'
1177 SELECT aicc_object.obj_id FROM aicc_object, aicc_units
1178 WHERE aicc_object.obj_id = aicc_units.obj_id
1179 AND aicc_object.slm_id = %s',
1180 array(
'integer'), array($this->
getId()));
1182 while(
$row = $ilDB->fetchAssoc(
$res))
1184 $obj_id =
$row[
'obj_id'];
1185 $ilDB->manipulateF(
'
1186 DELETE FROM aicc_units WHERE obj_id = %s',
1187 array(
'integer'), array($obj_id));
1191 SELECT aicc_object.obj_id FROM aicc_object, aicc_course
1192 WHERE aicc_object.obj_id = aicc_course.obj_id
1193 AND aicc_object.slm_id = %s',
1194 array(
'integer'), array($this->
getId()));
1196 while(
$row = $ilDB->fetchAssoc(
$res))
1198 $obj_id =
$row[
'obj_id'];
1199 $ilDB->manipulateF(
'
1200 DELETE FROM aicc_course WHERE obj_id = %s',
1201 array(
'integer'), array($obj_id));
1204 $ilDB->manipulateF(
'
1205 DELETE FROM aicc_object WHERE slm_id = %s',
1206 array(
'integer'), array($this->
getId()));
1209 $q_log =
"DELETE FROM scorm_tracking WHERE obj_id = ".$ilDB->quote($this->
getId());
1210 $ilLog->write(
"SAHS Delete(SAHSLM): ".$q_log);
1212 $ilDB->manipulateF(
'DELETE FROM scorm_tracking WHERE obj_id = %s',
1213 array(
'integer'), array($this->
getId()));
1215 $q_log =
"DELETE FROM sahs_user WHERE obj_id = ".$ilDB->quote($this->
getId());
1216 $ilLog->write(
"SAHS Delete(SAHSLM): ".$q_log);
1218 $ilDB->manipulateF(
'DELETE FROM sahs_user WHERE obj_id = %s',
1219 array(
'integer'), array($this->
getId()));
1235 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
1275 if ($a_node_id==
$_GET[
"ref_id"])
1277 $parent_obj =& $this->
ilias->obj_factory->getInstanceByRefId($a_node_id);
1278 $parent_type = $parent_obj->getType();
1279 if($parent_type == $this->
getType())
1281 $a_node_id = (int) $tree->getParentId($a_node_id);
1285 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
1296 if (strcmp($this->
getSubType(),
"scorm2004") == 0)
1301 return $res * 100.0;
1328 if(strcmp($this->
getSubType(),
'scorm2004') == 0)
1370 $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
1376 if(!$cp_options->isRootNode($this->getRefId()))
1378 $new_obj->setOnline($this->
getOnline());
1382 $new_obj->setTitle($this->
getTitle());
1392 $new_obj->setModuleVersion(1);
1395 $new_obj->setTries($this->
getTries());
1397 $new_obj->setNoMenu($this->
getNoMenu());
1399 $new_obj->setFourth_edition($this->getFourth_edition());
1405 $new_obj->setDebug($this->
getDebug());
1410 $new_obj->setWidth($this->
getWidth());
1411 $new_obj->setHeight($this->
getHeight());
1441 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
1447 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
1453 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
1459 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php");
1467 $new_obj->populateByDirectoy($source_obj->getDataDirectory());
1470 if ($new_obj->getEditable())
1472 $source_obj->copyAuthoredContent($new_obj);
1477 $new_obj->readObject();
static _getInstance($a_copy_id)
Get instance of copy wizard options.
Class ilObjAICCLearningModule.
Class ilObjAICCLearningModule.
_lookupDiskUsage($a_id)
Returns the number of bytes used on the harddisk by the learning module with the specified object id.
Class ilObjSCORMLearningModule.
getAuto_last_visited()
auto_last_visited
getAPIFunctionsPrefix()
get api functions prefix
populateByDirectoy($a_dir, $a_filename="")
Populate by directory.
getDefaultLessonMode()
get default lesson mode
setAutoSuspend($a_auto_suspend)
get auto continue
getMaxPoints()
Returns score.max for the learning module, refered to the last sco where score.max is set.
setSubType($a_sub_type)
get sub type
setTime_from_lms($a_time_from_lms)
getAPIAdapterName()
get api adapter name
getSequencingExpertMode()
Get sequencing expert mode.
getObjectives()
objectives
getMaxAttempt()
get max attempt
setDebugPw($a_debug_pw)
debug pw
setAutoContinue($a_auto_continue)
get auto continue
setSession($a_session)
set session setting
createDataDirectory()
creates data directory for package files ("./data/lm_data/lm_<id>")
getAffectiveLocalization($a_id)
Get affective localization.
getHideNavig()
hide navigation tree
getDiskUsage()
Gets the disk usage of the object in bytes.
getLocalization()
Get localization.
setInteractions($a_interactions)
setAuto_last_visited($a_auto_last_visited)
setAutoReview($a_auto_review)
set auto review as true/false for SCORM 1.2, HACP, SAHS, AICC
setAssignedGlossary($a_assigned_glossary)
set assigned glossary
getFourth_Edition()
SCORM 2004 4th edition features.
setIe_compatibility($a_ie_compatibility)
getIe_force_render()
force Internet Explorer to render again after some Milliseconds - useful for learning Modules with a ...
setDefaultLessonMode($a_lesson_mode)
set default lesson mode
getCheck_values()
check_values
setIe_force_render($a_ie_force_render)
setNoMenu($a_no_menu)
disable menu
getModuleVersion()
get module version
setModuleVersion($a_module_version)
set max attempt
static lookupAssignedGlossary($a_slm_id)
Get SCORM modules that assign a certain glossary.
getSession()
get session setting
setOnline($a_online)
get online
getInteractions()
interactions
setMaxAttempt($a_max_attempt)
set max attempt
getAutoReviewChar()
get auto review as Char for SCORM 2004
getCreditMode()
get credit mode
getPointsInPercent()
Returns the points in percent for the learning module This is called by the certificate generator if ...
setEditable($a_editable)
Set Editable.
getOpenMode()
open_mode 0: in Tab/new Window like in previous versions 1: in iFrame with width=100% and heigth=100%...
setOpenMode($a_open_mode)
create($upload=false)
create file based lm
getEditable()
Get Editable.
getAssignedGlossary()
get assigned glossary
getAutoContinue()
set auto continue
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
setLocalization($a_val)
Set localization.
getCacheDeactivated()
BrowserCacheDisabled for SCORM 2004 / ENABLE_JS_DEBUG.
setFourth_edition($a_fourth_edition)
setAPIAdapterName($a_api)
set api adapter name
getSequencing()
sequencing
getAutoReview()
get auto review as true/false for SCORM 1.2, HACP, SAHS, AICC
checkMasteryScoreValues()
check mastery_score / min_normalized_measure of SCOs (SCORM 1.2) / objectives (SCORM 2004)
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...
setCreditMode($a_credit_mode)
set credit mode
static getScormModulesForGlossary($a_glo_id)
Get SCORM modules that assign a certain glossary.
_lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
getMasteryScoreValues()
get mastery_score_values
setMasteryScore($a_mastery_score)
set mastery_score
getMasteryScore()
get mastery_score
setHideNavig($a_hide_navig)
disable menu
cloneObject($a_target_id, $a_copy_id=0)
Clone scorm object.
_lookupOnline($a_id)
check wether scorm module is online
getStyleSheetId()
get ID of assigned style sheet object
getSessionDeactivated()
sessionDisabled for SCORM 2004
setObjectives($a_objectives)
getIe_compatibility()
set compatibility mode for Internet Exlorer manually
setAPIFunctionsPrefix($a_prefix)
set api functions prefix
getTime_from_lms()
time_from_lms
setSequencingExpertMode($a_val)
Set sequencing expert mode.
ilObjSAHSLearningModule($a_id=0, $a_call_by_reference=true)
Constructor @access public.
getDebugActivated()
debugActivated
setTries($a_tries)
Set default tries for questions.
setOfflineMode($a_offline_mode)
getAutoSuspend()
set auto continue
getDataDirectory($mode="filesystem")
get data directory of lm
setCheck_values($a_check_values)
setSequencing($a_sequencing)
setAutoReviewChar($a_auto_review)
set auto review as Char for SCORM 2004
getOfflineMode()
offlineMode
update()
update values for mastery_score / min_normalized_measure in database - not requested
Class ilObjSCORM2004LearningModule.
static _getMaxScoreForUser($a_id, $a_user)
Returns score.max for the learning module, refered to the last sco where score.max is set.
static _getUniqueScaledScoreForUser($a_id, $a_user)
Get the Unique Scaled Score of a course Conditions: Only one SCO may set cmi.score....
Class ilObjSCORMLearningModule.
Class ilObject Basic functions for all objects.
getType()
get object type @access public
deleteMetaData()
delete meta data entry
updateMetaData()
update meta data entry
_hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
createMetaData()
create meta data entry
getRefId()
get reference id @access public
getDescription()
get object description
cloneMetaData($target_obj)
Copy meta data.
getId()
get object id @access public
static _lookupType($a_id, $a_reference=false)
lookup object type
getTitle()
get object title @access public
& _getInstance($a_id, $a_slm_id)
get instance of specialized GUI class
static getDataDir()
get data directory (outside webspace)
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static tf2yn($a_tf)
convert true/false to "y"/"n"
static getWebspaceDir($mode="filesystem")
get webspace directory
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static zip($a_dir, $a_file, $compress_content=false)
static yn2tf($a_yn)
convert "y"/"n" to true/false
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
redirection script todo: (a better solution should control the processing via a xml file)