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)
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");
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();
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;
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;
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;
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;
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,
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"];
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()
1160 $ilLog =
$DIC[
'ilLog'];
1163 if (!parent::delete()) {
1175 'DELETE FROM sahs_lm WHERE id = %s',
1177 array($this->
getId())
1180 $ilLog->write(
"SAHS Delete(SAHSLM), Subtype: " . $this->
getSubType());
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())
1211 while ($row =
$ilDB->fetchAssoc(
$res)) {
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())
1230 while ($row =
$ilDB->fetchAssoc(
$res)) {
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)
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");
1430 $new_obj->populateByDirectoy($source_obj->getDataDirectory());
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);
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
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)
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
getOfflineStatus()
Get offline status.
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.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res