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, api_adapter, c_type, editable, seq_exp_mode,localization) 54 VALUES (%s,%s,%s,%s,%s,%s)',
55 array(
'integer',
'text',
'text',
'integer',
'integer',
'text'),
73 'SELECT * FROM sahs_lm WHERE id = %s',
90 $this->
setTries($lm_rec[
"question_tries"]);
117 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
133 $ilDB = $DIC[
'ilDB'];
137 'SELECT localization FROM sahs_lm WHERE id = %s',
142 $inst_lang =
$lng->getInstalledLanguages();
143 if ($lm_rec[
"localization"] !=
"" && in_array($lm_rec[
"localization"], $inst_lang)) {
144 return $lm_rec[
"localization"];
146 return $lng->getLangKey();
157 $ilDB = $DIC[
'ilDB'];
159 $obj_set =
$ilDB->queryF(
160 'SELECT c_type FROM sahs_lm WHERE id = %s',
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;
233 $ilDB = $DIC[
'ilDB'];
236 'SELECT question_tries FROM sahs_lm WHERE id = %s',
242 return $lm_rec[
'question_tries'];
252 require_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
274 $lm_dir = $lm_data_dir .
"/lm_" . $this->
getId();
284 return $this->api_adapter;
292 $this->api_adapter = $a_api;
300 return $this->api_func_prefix;
308 $this->api_func_prefix = $a_prefix;
316 return $this->credit_mode;
324 $this->credit_mode = $a_credit_mode;
332 $this->lesson_mode = $a_lesson_mode;
341 if ($DIC[
'ilUser']->
getId() == 13) {
344 return $this->lesson_mode;
351 return $this->style_id;
359 $this->style_id = $a_style_id;
383 $this->auto_review = $a_auto_review;
390 return $this->auto_review;
398 return $this->max_attempt;
407 $this->max_attempt = $a_max_attempt;
415 return $this->module_version;
423 return $this->assigned_glossary;
431 $this->assigned_glossary = $a_assigned_glossary;
438 $this->module_version = $a_module_version;
454 $this->session = $a_session;
462 return $this->no_menu;
470 $this->no_menu = $a_no_menu;
478 return $this->hide_navig;
486 $this->hide_navig = $a_hide_navig;
497 if (
$lm_set->get(
"scormdebug_disable_cache") ==
"1") {
511 if (
$lm_set->get(
"scorm_without_session") ==
"1") {
525 if (
$lm_set->get(
"scormdebug_global_activate") ==
"1") {
536 return $this->ie_force_render;
541 $this->ie_force_render = $a_ie_force_render;
549 return $this->fourth_edition;
554 $this->fourth_edition = $a_fourth_edition;
562 return $this->sequencing;
567 $this->sequencing = $a_sequencing;
575 return $this->interactions;
580 $this->interactions = $a_interactions;
588 return $this->objectives;
593 $this->objectives = $a_objectives;
601 return $this->comments;
606 $this->comments = $a_comments;
614 return $this->time_from_lms;
619 $this->time_from_lms = $a_time_from_lms;
627 return $this->check_values;
632 $this->check_values = $a_check_values;
640 return $this->offline_mode;
645 $this->offline_mode = $a_offline_mode;
662 $this->debug = $a_debug;
670 return $this->debug_pw;
678 $this->debug_pw = $a_debug_pw;
686 $this->auto_continue = $a_auto_continue;
693 return $this->auto_continue;
701 return $this->auto_last_visited;
706 $this->auto_last_visited = $a_auto_last_visited;
717 $this->seq_exp_mode = $a_val;
727 return $this->seq_exp_mode;
735 $this->auto_suspend = $a_auto_suspend;
742 return $this->auto_suspend;
758 return $this->open_mode;
762 $this->open_mode = $a_open_mode;
774 $this->width = $a_width;
782 return $this->height;
786 $this->height = $a_height;
795 return $this->mastery_score;
803 $this->mastery_score = $a_mastery_score;
812 $ilDB = $DIC[
'ilDB'];
817 if (
$type ==
"scorm2004") {
818 $set =
$ilDB->query(
"SELECT minnormalmeasure FROM cp_objective, cp_node" .
819 " WHERE satisfiedbymeasure=1 AND minnormalmeasure is not null AND cp_objective.cp_node_id=cp_node.cp_node_id AND" .
820 " slm_id = " .
$ilDB->quote($this->getID(),
"integer"));
821 while ($rec =
$ilDB->fetchAssoc($set)) {
822 $tmpval = $rec[
"minnormalmeasure"] * 100;
823 if (!in_array($tmpval, $a_result)) {
824 $a_result[] = $tmpval;
828 $set =
$ilDB->query(
"SELECT masteryscore FROM sc_item,scorm_object" .
829 " WHERE sc_item.masteryscore is not null AND sc_item.obj_id=scorm_object.obj_id AND" .
830 " slm_id = " .
$ilDB->quote($this->getID(),
"integer"));
831 while ($rec =
$ilDB->fetchAssoc($set)) {
832 if (!in_array($rec[
"masteryscore"], $a_result)) {
833 $a_result[] = $rec[
"masteryscore"];
837 $s_result = implode(
", ", $a_result);
838 $this->mastery_score_values = $s_result;
846 return $this->mastery_score_values;
913 return $this->id_setting;
921 $this->id_setting = $a_id_setting;
929 return $this->name_setting;
937 $this->name_setting = $a_name_setting;
952 $ilDB = $DIC[
'ilDB'];
958 if ($s_mastery_score ==
"") {
959 $s_mastery_score = null;
962 $statement =
$ilDB->manipulateF(
965 SET api_adapter = %s, 966 api_func_prefix = %s, 968 default_lesson_mode = %s, 977 unlimited_session = %s, 994 auto_last_visited = %s, 998 ie_force_render = %s, 1094 $ilDB = $DIC[
'ilDB'];
1096 $set =
$ilDB->query(
"SELECT DISTINCT id FROM sahs_lm WHERE " .
1097 " glossary = " .
$ilDB->quote($a_glo_id,
"integer"));
1099 while ($rec =
$ilDB->fetchAssoc($set)) {
1101 $sms[] = $rec[
"id"];
1116 $ilDB = $DIC[
'ilDB'];
1118 $set =
$ilDB->query(
"SELECT DISTINCT glossary FROM sahs_lm WHERE " .
1119 " id = " .
$ilDB->quote($a_slm_id,
"integer"));
1120 $rec =
$ilDB->fetchAssoc($set);
1121 $glo_id = $rec[
"glossary"];
1134 $this->sub_type = $a_sub_type;
1142 return $this->sub_type;
1156 public function delete()
1159 $ilDB = $DIC[
'ilDB'];
1163 if (!parent::delete()) {
1175 'DELETE FROM sahs_lm WHERE id = %s',
1177 array($this->
getId())
1184 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMTree.php");
1185 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php");
1187 $r_id = $sc_tree->readRootId();
1189 $items = $sc_tree->getSubTree($sc_tree->getNodeData($r_id));
1190 foreach ($items as $item) {
1192 if (is_object($sc_object)) {
1193 $sc_object->delete();
1196 $sc_tree->removeTree($sc_tree->getTreeId());
1204 SELECT aicc_object.obj_id FROM aicc_object, aicc_units 1205 WHERE aicc_object.obj_id = aicc_units.obj_id 1206 AND aicc_object.slm_id = %s',
1208 array($this->
getId())
1212 $obj_id =
$row[
'obj_id'];
1215 DELETE FROM aicc_units WHERE obj_id = %s',
1223 SELECT aicc_object.obj_id FROM aicc_object, aicc_course 1224 WHERE aicc_object.obj_id = aicc_course.obj_id 1225 AND aicc_object.slm_id = %s',
1227 array($this->
getId())
1231 $obj_id =
$row[
'obj_id'];
1234 DELETE FROM aicc_course WHERE obj_id = %s',
1242 DELETE FROM aicc_object WHERE slm_id = %s',
1244 array($this->
getId())
1248 $q_log =
"DELETE FROM scorm_tracking WHERE obj_id = " .
$ilDB->quote($this->
getId());
1249 $ilLog->write(
"SAHS Delete(SAHSLM): " . $q_log);
1252 'DELETE FROM scorm_tracking WHERE obj_id = %s',
1254 array($this->
getId())
1257 $q_log =
"DELETE FROM sahs_user WHERE obj_id = " .
$ilDB->quote($this->
getId());
1258 $ilLog->write(
"SAHS Delete(SAHSLM): " . $q_log);
1261 'DELETE FROM sahs_user WHERE obj_id = %s',
1263 array($this->
getId())
1279 if (strcmp($this->
getSubType(),
"scorm2004") == 0) {
1281 if (!is_null(
$res)) {
1282 return $res * 100.0;
1306 if (strcmp($this->
getSubType(),
'scorm2004') == 0) {
1341 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
1344 $ilDB = $DIC[
'ilDB'];
1346 $ilias = $DIC[
'ilias'];
1349 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
1355 if ($cp_options->isRootNode($this->getRefId())) {
1356 $new_obj->setOfflineStatus(
true);
1370 $new_obj->setModuleVersion(1);
1373 $new_obj->setTries($this->
getTries());
1375 $new_obj->setNoMenu($this->
getNoMenu());
1377 $new_obj->setFourth_edition($this->getFourth_edition());
1383 $new_obj->setDebug($this->
getDebug());
1388 $new_obj->setWidth($this->
getWidth());
1389 $new_obj->setHeight($this->
getHeight());
1417 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
1423 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
1433 if ($new_obj->getEditable()) {
1434 $source_obj->copyAuthoredContent($new_obj);
1437 $new_obj->readObject();
1441 include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
1443 $obj_settings->cloneSettings($new_obj->getId());
1445 include_once(
'Services/Object/classes/class.ilObjectLP.php');
1448 $collection = $olp->getCollectionInstance();
1450 $collection->cloneCollection($new_obj->getRefId(), $cp_options->getCopyId());
1468 $ilias = $DIC[
'ilias'];
1470 $studentId = $ilias->account->getId();
1471 if ($idSetting % 2 == 1) {
1472 $studentId = $ilias->account->getLogin();
1474 if ($idSetting > 3) {
1475 $studentId .=
'_o_' . $this->
getId();
1476 } elseif ($idSetting > 1) {
1477 $studentId .=
'_r_' .
$_GET[
"ref_id"];
1489 $ilias = $DIC[
'ilias'];
1494 $studentName = $ilias->account->getLastname() .
', ' . $ilias->account->getFirstname();
1497 $studentName = $ilias->account->getFirstname() .
' ' . $ilias->account->getLastname();
1500 $studentName = $ilias->account->getFullname();
1503 switch ($ilias->account->getGender()) {
1505 $studentName =
$lng->txt(
'salutation_f') .
' ';
1509 $studentName =
$lng->txt(
'salutation_m') .
' ';
1517 $studentName =
$lng->txt(
'salutation') .
' ';
1519 $studentName .= $ilias->account->getLastname();
1522 $studentName = $ilias->account->getFirstname();
1525 return $studentName;
1533 $setUrl =
"ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=" . $this->getRefID();
1535 $setTarget =
"ilContObj" . $this->
getId();
1539 if (($om == 5 || $om == 1) && $width > 0 && $height > 0) {
1543 $setUrl =
"javascript:void(0); onclick=startSAHS('" . $setUrl .
"','ilContObj" . $this->
getId() .
"'," . $om .
"," . $width .
"," . $height .
");";
1546 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1548 $button->setCaption(
"view");
1549 $button->setPrimary(
true);
1550 $button->setUrl($setUrl);
1551 $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.
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
getOfflineStatus()
Get offline status.
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
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)
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