5 require_once
"./Services/Object/classes/class.ilObject.php";
6 require_once
"./Modules/ScormAicc/classes/class.ilObjSCORMValidator.php";
31 public function __construct($a_id = 0, $a_call_by_reference =
true)
34 parent::__construct($a_id, $a_call_by_reference);
40 public function create($upload=
false)
53 INSERT INTO sahs_lm (id, c_online, api_adapter, c_type, editable, seq_exp_mode,localization) 54 VALUES (%s,%s,%s,%s,%s,%s,%s)',
55 array(
'integer',
'text',
'text',
'text',
'integer',
'integer',
'text'),
72 'SELECT * FROM sahs_lm WHERE id = %s',
77 while ($lm_rec = $ilDB->fetchAssoc(
$lm_set)) {
90 $this->
setTries($lm_rec[
"question_tries"]);
117 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
132 'SELECT c_online FROM sahs_lm WHERE id = %s',
136 $lm_rec = $ilDB->fetchAssoc(
$lm_set);
151 'SELECT localization FROM sahs_lm WHERE id = %s',
155 $lm_rec = $ilDB->fetchAssoc(
$lm_set);
156 $inst_lang = $lng->getInstalledLanguages();
157 if ($lm_rec[
"localization"] !=
"" && in_array($lm_rec[
"localization"], $inst_lang)) {
158 return $lm_rec[
"localization"];
160 return $lng->getLangKey();
172 $obj_set = $ilDB->queryF(
173 'SELECT c_type FROM sahs_lm WHERE id = %s',
177 $obj_rec = $ilDB->fetchAssoc($obj_set);
179 return $obj_rec[
"c_type"];
189 $this->editable = $a_editable;
199 return $this->editable;
210 $this->tries = $a_tries;
230 $this->localization = $a_val;
240 return $this->localization;
248 'SELECT question_tries FROM sahs_lm WHERE id = %s',
252 $lm_rec = $ilDB->fetchAssoc(
$lm_set);
254 return $lm_rec[
'question_tries'];
264 require_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
286 $lm_dir = $lm_data_dir .
"/lm_" . $this->
getId();
296 return $this->api_adapter;
304 $this->api_adapter = $a_api;
312 return $this->api_func_prefix;
320 $this->api_func_prefix = $a_prefix;
328 return $this->credit_mode;
336 $this->credit_mode = $a_credit_mode;
344 $this->lesson_mode = $a_lesson_mode;
353 if ($ilUser->getId() == 13) {
356 return $this->lesson_mode;
363 return $this->style_id;
371 $this->style_id = $a_style_id;
395 $this->auto_review = $a_auto_review;
402 return $this->auto_review;
410 return $this->max_attempt;
419 $this->max_attempt = $a_max_attempt;
427 return $this->module_version;
435 return $this->assigned_glossary;
443 $this->assigned_glossary = $a_assigned_glossary;
450 $this->module_version = $a_module_version;
466 $this->session = $a_session;
474 return $this->no_menu;
482 $this->no_menu = $a_no_menu;
490 return $this->hide_navig;
498 $this->hide_navig = $a_hide_navig;
508 if (
$lm_set->get(
"scormdebug_disable_cache") ==
"1") {
521 if (
$lm_set->get(
"scorm_without_session") ==
"1") {
534 if (
$lm_set->get(
"scormdebug_global_activate") ==
"1") {
545 return $this->ie_force_render;
550 $this->ie_force_render = $a_ie_force_render;
558 return $this->fourth_edition;
563 $this->fourth_edition = $a_fourth_edition;
571 return $this->sequencing;
576 $this->sequencing = $a_sequencing;
584 return $this->interactions;
589 $this->interactions = $a_interactions;
597 return $this->objectives;
602 $this->objectives = $a_objectives;
610 return $this->comments;
623 return $this->time_from_lms;
628 $this->time_from_lms = $a_time_from_lms;
636 return $this->check_values;
641 $this->check_values = $a_check_values;
649 return $this->offline_mode;
654 $this->offline_mode = $a_offline_mode;
671 $this->debug = $a_debug;
679 return $this->debug_pw;
687 $this->debug_pw = $a_debug_pw;
695 $this->auto_continue = $a_auto_continue;
702 return $this->auto_continue;
710 return $this->auto_last_visited;
715 $this->auto_last_visited = $a_auto_last_visited;
726 $this->seq_exp_mode = $a_val;
736 return $this->seq_exp_mode;
744 $this->auto_suspend = $a_auto_suspend;
751 return $this->auto_suspend;
767 return $this->open_mode;
771 $this->open_mode = $a_open_mode;
783 $this->width = $a_width;
791 return $this->height;
795 $this->height = $a_height;
804 return $this->mastery_score;
812 $this->mastery_score = $a_mastery_score;
825 if (
$type ==
"scorm2004") {
826 $set = $ilDB->query(
"SELECT minnormalmeasure FROM cp_objective, cp_node" .
827 " WHERE satisfiedbymeasure=1 AND minnormalmeasure is not null AND cp_objective.cp_node_id=cp_node.cp_node_id AND" .
828 " slm_id = " . $ilDB->quote($this->getID(),
"integer"));
829 while ($rec = $ilDB->fetchAssoc($set)) {
830 $tmpval = $rec[
"minnormalmeasure"]*100;
831 if (!in_array($tmpval, $a_result)) {
832 $a_result[] = $tmpval;
836 $set = $ilDB->query(
"SELECT masteryscore FROM sc_item,scorm_object" .
837 " WHERE sc_item.masteryscore is not null AND sc_item.obj_id=scorm_object.obj_id AND" .
838 " slm_id = " . $ilDB->quote($this->getID(),
"integer"));
839 while ($rec = $ilDB->fetchAssoc($set)) {
840 if (!in_array($rec[
"masteryscore"], $a_result)) {
841 $a_result[] = $rec[
"masteryscore"];
845 $s_result = implode(
", ", $a_result);
846 $this->mastery_score_values = $s_result;
854 return $this->mastery_score_values;
920 return $this->id_setting;
928 $this->id_setting = $a_id_setting;
936 return $this->name_setting;
944 $this->name_setting = $a_name_setting;
964 if ($s_mastery_score ==
"") {
965 $s_mastery_score = null;
968 $statement = $ilDB->manipulateF(
973 api_func_prefix = %s, 975 default_lesson_mode = %s, 984 unlimited_session = %s, 1001 auto_last_visited = %s, 1005 ie_force_render = %s, 1104 $set = $ilDB->query(
"SELECT DISTINCT id FROM sahs_lm WHERE " .
1105 " glossary = " . $ilDB->quote($a_glo_id,
"integer"));
1107 while ($rec = $ilDB->fetchAssoc($set)) {
1109 $sms[] = $rec[
"id"];
1125 $set = $ilDB->query(
"SELECT DISTINCT glossary FROM sahs_lm WHERE " .
1126 " id = " . $ilDB->quote($a_slm_id,
"integer"));
1127 $rec = $ilDB->fetchAssoc($set);
1128 $glo_id = $rec[
"glossary"];
1140 $this->online = $a_online;
1148 return $this->online;
1156 $this->sub_type = $a_sub_type;
1164 return $this->sub_type;
1178 public function delete()
1183 if (!parent::delete()) {
1195 'DELETE FROM sahs_lm WHERE id = %s',
1200 $ilLog->write(
"SAHS Delete(SAHSLM), Subtype: " . $this->
getSubType());
1204 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMTree.php");
1205 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php");
1207 $r_id = $sc_tree->readRootId();
1209 $items = $sc_tree->getSubTree($sc_tree->getNodeData($r_id));
1210 foreach ($items as $item) {
1212 if (is_object($sc_object)) {
1213 $sc_object->delete();
1216 $sc_tree->removeTree($sc_tree->getTreeId());
1222 $res = $ilDB->queryF(
1224 SELECT aicc_object.obj_id FROM aicc_object, aicc_units 1225 WHERE aicc_object.obj_id = aicc_units.obj_id 1226 AND aicc_object.slm_id = %s',
1231 while (
$row = $ilDB->fetchAssoc(
$res)) {
1232 $obj_id =
$row[
'obj_id'];
1235 DELETE FROM aicc_units WHERE obj_id = %s',
1241 $res = $ilDB->queryF(
1243 SELECT aicc_object.obj_id FROM aicc_object, aicc_course 1244 WHERE aicc_object.obj_id = aicc_course.obj_id 1245 AND aicc_object.slm_id = %s',
1250 while (
$row = $ilDB->fetchAssoc(
$res)) {
1251 $obj_id =
$row[
'obj_id'];
1254 DELETE FROM aicc_course WHERE obj_id = %s',
1262 DELETE FROM aicc_object WHERE slm_id = %s',
1268 $q_log =
"DELETE FROM scorm_tracking WHERE obj_id = " . $ilDB->quote($this->
getId());
1269 $ilLog->write(
"SAHS Delete(SAHSLM): " . $q_log);
1272 'DELETE FROM scorm_tracking WHERE obj_id = %s',
1277 $q_log =
"DELETE FROM sahs_user WHERE obj_id = " . $ilDB->quote($this->
getId());
1278 $ilLog->write(
"SAHS Delete(SAHSLM): " . $q_log);
1281 'DELETE FROM sahs_user WHERE obj_id = %s',
1298 if (strcmp($this->
getSubType(),
"scorm2004") == 0) {
1300 if (!is_null(
$res)) {
1301 return $res * 100.0;
1324 if (strcmp($this->
getSubType(),
'scorm2004') == 0) {
1359 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
1363 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
1369 if (!$cp_options->isRootNode($this->getRefId())) {
1370 $new_obj->setOnline($this->
getOnline());
1384 $new_obj->setModuleVersion(1);
1387 $new_obj->setTries($this->
getTries());
1389 $new_obj->setNoMenu($this->
getNoMenu());
1391 $new_obj->setFourth_edition($this->getFourth_edition());
1397 $new_obj->setDebug($this->
getDebug());
1402 $new_obj->setWidth($this->
getWidth());
1403 $new_obj->setHeight($this->
getHeight());
1431 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
1437 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
1447 if ($new_obj->getEditable()) {
1448 $source_obj->copyAuthoredContent($new_obj);
1451 $new_obj->readObject();
1455 include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
1457 $obj_settings->cloneSettings($new_obj->getId());
1459 include_once(
'Services/Object/classes/class.ilObjectLP.php');
1462 $collection = $olp->getCollectionInstance();
1464 $collection->cloneCollection($new_obj->getRefId(), $cp_options->getCopyId());
1483 $studentId = $ilias->account->getId();
1484 if ($idSetting%2 == 1) {
1485 $studentId = $ilias->account->getLogin();
1487 if ($idSetting > 3) {
1488 $studentId .=
'_o_' . $this->
getId();
1489 } elseif ($idSetting > 1) {
1490 $studentId .=
'_r_' .
$_GET[
"ref_id"];
1501 global $ilias,
$lng;
1505 $studentName = $ilias->account->getLastname() .
', ' . $ilias->account->getFirstname();
1508 $studentName = $ilias->account->getFirstname() .
' ' . $ilias->account->getLastname();
1511 $studentName = $ilias->account->getFullname();
1514 switch ($ilias->account->getGender()) {
1516 $studentName = $lng->txt(
'salutation_f');
1520 $studentName = $lng->txt(
'salutation_m');
1524 $studentName = $lng->txt(
'salutation_n');
1528 $studentName = $lng->txt(
'salutation');
1530 $studentName .=
' ' . $ilias->account->getLastname();
1533 $studentName = $ilias->account->getFirstname();
1536 return $studentName;
1544 $setUrl =
"ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=" . $this->getRefID();
1546 $setTarget =
"ilContObj" . $this->
getId();
1550 if (($om == 5 || $om == 1) && $width > 0 && $height > 0) {
1554 $setUrl =
"javascript:void(0); onclick=startSAHS('" . $setUrl .
"','ilContObj" . $this->
getId() .
"'," . $om .
"," . $width .
"," . $height .
");";
1557 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1559 $button->setCaption(
"view");
1560 $button->setPrimary(
true);
1561 $button->setUrl($setUrl);
1562 $button->setTarget($setTarget);
setFourth_edition($a_fourth_edition)
getSequencingExpertMode()
Get sequencing expert mode.
getStyleSheetId()
get ID of assigned style sheet object
static tf2yn($a_tf)
convert true/false to "y"/"n"
getFourth_Edition()
SCORM 2004 4th edition features.
static lookupAssignedGlossary($a_slm_id)
Get SCORM modules that assign a certain glossary.
static _hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
getDiskUsage()
Gets the disk usage of the object in bytes.
static _lookupOnline($a_id)
check wether scorm module is online
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.
getNameSetting()
get name_setting
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 module version
updateMetaData()
update meta data entry
getInteractions()
interactions
getSessionDeactivated()
sessionDisabled for SCORM 2004
getAuto_last_visited()
auto_last_visited
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
getMasteryScore()
get mastery_score
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
checkMasteryScoreValues()
check mastery_score / min_normalized_measure of SCOs (SCORM 1.2) / objectives (SCORM 2004) ...
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
static _lookupDiskUsage($a_id)
Returns the number of bytes used on the harddisk by the learning module with the specified object id...
createDataDirectory()
creates data directory for package files ("./data/lm_data/lm_<id>")
setAutoContinue($a_auto_continue)
get auto continue
setIdSetting($a_id_setting)
set id_setting
create($upload=false)
create file based lm
populateByDirectoy($a_dir, $a_filename="")
Populate by directory.
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, )
setAutoReview($a_auto_review)
set auto review as true/false for SCORM 1.2
getMaxAttempt()
get max attempt
getDataDirectory($mode="filesystem")
get data directory of lm
getMasteryScoreValues()
get mastery_score_values
getIe_force_render()
force Internet Explorer to render again after some Milliseconds - useful for learning Modules with a ...
setLocalization($a_val)
Set localization.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
foreach($_POST as $key=> $value) $res
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
getId()
get object id public
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)
getSequencing()
sequencing
static _getUniqueScaledScoreForUser($a_id, $a_user)
Get the Unique Scaled Score of a course Conditions: Only one SCO may set cmi.score.scaled.
getDescription()
get object description
getApiStudentId()
Get cmi.core.student_id / cmi.learner_id for API.
cloneMetaData($target_obj)
Copy meta data.
setHideNavig($a_hide_navig)
disable menu
getHideNavig()
hide navigation tree
setMasteryScore($a_mastery_score)
set mastery_score
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
Create styles array
The data for the language used.
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
getApiStudentName()
Get cmi.core.student_name / cmi.learner_name for API note: 'lastname, firstname' is required for SCOR...
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.
setNameSetting($a_name_setting)
set name_setting
update($pash, $contents, Config $config)
getDebugActivated()
debugActivated
static getScormModulesForGlossary($a_glo_id)
Get SCORM modules that assign a certain glossary.
update()
update object data
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 ...
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...
getViewButton()
get button for view
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
static getAffectiveLocalization($a_id)
Get affective localization.
setDefaultLessonMode($a_lesson_mode)
set default lesson mode
static getInstance($a_obj_id)
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)
static & _getInstance($a_id, $a_slm_id)
get instance of specialized GUI class
setMaxAttempt($a_max_attempt)
set max attempt
setModuleVersion($a_module_version)
set max attempt
Class ilObjSCORMLearningModule.
getCacheDeactivated()
BrowserCacheDisabled for SCORM 2004 / ENABLE_JS_DEBUG.
getIdSetting()
update values for mastery_score / min_normalized_measure in database - not requested ...
__construct($a_id=0, $a_call_by_reference=true)
Constructor public.
getTime_from_lms()
time_from_lms