5require_once
"./Services/Object/classes/class.ilObject.php";
6require_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',
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',
151 'SELECT localization FROM sahs_lm WHERE id = %s',
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',
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;
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;
615 $this->comments = $a_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',
1197 array($this->
getId())
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',
1228 array($this->
getId())
1231 while (
$row = $ilDB->fetchAssoc(
$res)) {
1232 $obj_id =
$row[
'obj_id'];
1235 DELETE FROM aicc_units WHERE obj_id = %s',
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',
1247 array($this->
getId())
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',
1264 array($this->
getId())
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',
1274 array($this->
getId())
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',
1283 array($this->
getId())
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");
1444 $new_obj->populateByDirectoy($source_obj->getDataDirectory());
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);
An exception for terminatinating execution or to throw for unit testing.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static _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
getViewButton()
get button for view
setTime_from_lms($a_time_from_lms)
getAPIAdapterName()
get api adapter name
getSequencingExpertMode()
Get sequencing expert mode.
getApiStudentId()
Get cmi.core.student_id / cmi.learner_id for API.
getObjectives()
objectives
getNameSetting()
get name_setting
getMaxAttempt()
get max attempt
setDebugPw($a_debug_pw)
debug pw
setAutoContinue($a_auto_continue)
get auto continue
setSession($a_session)
set session setting
setNameSetting($a_name_setting)
set name_setting
createDataDirectory()
creates data directory for package files ("./data/lm_data/lm_<id>")
getHideNavig()
hide navigation tree
getApiStudentName()
Get cmi.core.student_name / cmi.learner_name for API note: 'lastname, firstname' is required for SCOR...
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
static getAffectiveLocalization($a_id)
Get affective localization.
setAssignedGlossary($a_assigned_glossary)
set assigned glossary
getFourth_Edition()
SCORM 2004 4th edition features.
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
__construct($a_id=0, $a_call_by_reference=true)
Constructor @access public.
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.
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, )
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
getIdSetting()
update values for mastery_score / min_normalized_measure in database - not requested
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
checkMasteryScoreValues()
check mastery_score / min_normalized_measure of SCOs (SCORM 1.2) / objectives (SCORM 2004)
setCreditMode($a_credit_mode)
set credit mode
static getScormModulesForGlossary($a_glo_id)
Get SCORM modules that assign a certain glossary.
getMasteryScoreValues()
get mastery_score_values
setMasteryScore($a_mastery_score)
set mastery_score
getMasteryScore()
get mastery_score
setHideNavig($a_hide_navig)
disable menu
getStyleSheetId()
get ID of assigned style sheet object
getSessionDeactivated()
sessionDisabled for SCORM 2004
setIdSetting($a_id_setting)
set id_setting
setObjectives($a_objectives)
static _lookupOnline($a_id)
check wether scorm module is online
setAPIFunctionsPrefix($a_prefix)
set api functions prefix
getTime_from_lms()
time_from_lms
setSequencingExpertMode($a_val)
Set sequencing expert mode.
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 object data
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.
static getInstance($a_obj_id)
Class ilObject Basic functions for all objects.
deleteMetaData()
delete meta data entry
updateMetaData()
update meta data entry
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 _hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
static _lookupType($a_id, $a_reference=false)
lookup object type
static & _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)
zips given directory/file into given zip.file
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.
update($pash, $contents, Config $config)
foreach($_POST as $key=> $value) $res