ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilObjSAHSLearningModule Class Reference

Class ilObjSCORMLearningModule. More...

+ Inheritance diagram for ilObjSAHSLearningModule:
+ Collaboration diagram for ilObjSAHSLearningModule:

Public Member Functions

 __construct (int $a_id=0, bool $a_call_by_reference=true)
 Constructor. More...
 
 create (bool $upload=false)
 create file based lm More...
 
 read ()
 read object More...
 
 getEditable ()
 
 setTries (int $a_tries)
 Set default tries for questions. More...
 
 getTries ()
 
 setLocalization (string $a_val)
 
 getLocalization ()
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 createDataDirectory ()
 creates data directory for package files ("./public/data/lm_data/lm_<id>") More...
 
 getDataDirectory (?string $mode="filesystem")
 get data directory of lm More...
 
 getRID ()
 
 setRID (?string $rid)
 
 hasContainerResource ()
 True when the module's content lives in a Resource Storage container. More...
 
 getResource ()
 
 getContainerBaseUri (float $valid_for_at_least_minutes=480.0)
 Base URL of the content container, ending in the sub-request separator so the player can append relative paths (e.g. More...
 
 removeContainerResource ()
 
 getManifestFromContainer (string $manifest_file='imsmanifest.xml')
 Read the imsmanifest.xml of the current container revision (migrated modules). More...
 
 replaceContainerFromZipPath (string $absolute_zip_path, ?string $revision_title=null)
 Replace the content of the module's container resource with a new ZIP as a new revision (migrated modules only). More...
 
 moveDataDirectoryToContainer ()
 Move the on-disk data directory into a new container resource and remove the directory. More...
 
 extractContainerToDataDirectory ()
 Extract the current container revision back onto disk at getDataDirectory(). More...
 
 writeContentZip (string $target_zip_path)
 Write the module content to $target_zip_path as a zip without the lm_<id> top directory (export "content.zip"). More...
 
 getAPIAdapterName ()
 get api adapter name More...
 
 setAPIAdapterName (string $a_api)
 set api adapter name More...
 
 getAPIFunctionsPrefix ()
 get api functions prefix More...
 
 setAPIFunctionsPrefix (string $a_prefix)
 set api functions prefix More...
 
 getCreditMode ()
 get credit mode More...
 
 setDefaultLessonMode (string $a_lesson_mode)
 set default lesson mode More...
 
 getDefaultLessonMode ()
 get default lesson mode More...
 
 getStyleSheetId ()
 get ID of assigned style sheet object More...
 
 setStyleSheetId (int $a_style_id)
 set ID of assigned style sheet object More...
 
 setAutoReview (bool $a_auto_review)
 set auto review as true/false for SCORM 1.2 More...
 
 getAutoReview ()
 get auto review as true/false for SCORM 1.2 More...
 
 setAutoReviewChar (?string $a_auto_review)
 set auto review as Char for SCORM 2004 More...
 
 getAutoReviewChar ()
 get auto review as Char for SCORM 2004 More...
 
 getMaxAttempt ()
 
 setMaxAttempt (int $a_max_attempt)
 
 getModuleVersion ()
 
 getAssignedGlossary ()
 
 setAssignedGlossary (int $a_assigned_glossary)
 
 setModuleVersion (int $a_module_version)
 
 getSession ()
 
 setSession (bool $a_session)
 
 getNoMenu ()
 disable menu More...
 
 setNoMenu (bool $a_no_menu)
 disable menu More...
 
 getHideNavig ()
 hide navigation tree More...
 
 setHideNavig (bool $a_hide_navig)
 disable menu More...
 
 getCacheDeactivated ()
 BrowserCacheDisabled for SCORM 2004 / ENABLE_JS_DEBUG. More...
 
 getSessionDeactivated ()
 sessionDisabled for SCORM 2004 More...
 
 getDebugActivated ()
 debugActivated More...
 
 getIe_force_render ()
 force Internet Explorer to render again after some Milliseconds - useful for learning Modules with a lot of iframes or frames and IE >=10 More...
 
 setIe_force_render (bool $a_ie_force_render)
 
 getFourth_Edition ()
 SCORM 2004 4th edition features. More...
 
 setFourth_edition (bool $a_fourth_edition)
 
 getSequencing ()
 
 setSequencing (bool $a_sequencing)
 
 getInteractions ()
 
 setInteractions (bool $a_interactions)
 
 getObjectives ()
 
 setObjectives (bool $a_objectives)
 
 getComments ()
 
 setComments (bool $a_comments)
 
 getTime_from_lms ()
 
 setTime_from_lms (bool $a_time_from_lms)
 
 getCheck_values ()
 
 setCheck_values (bool $a_check_values)
 
 getDebug ()
 
 setDebug (bool $a_debug)
 
 setAutoContinue (bool $a_auto_continue)
 
 getAutoContinue ()
 
 getAuto_last_visited ()
 
 setAuto_last_visited (bool $a_auto_last_visited)
 
 setAutoSuspend (bool $a_auto_suspend)
 
 getAutoSuspend ()
 
 getOpenMode ()
 open_mode 0: in Tab/new Window like in previous versions 1: in iFrame with width=100% and heigth=100% 2: in iFrame with specified width and height 3: 4: 5: in new Window without specified width and height 6: in new Window with specified width and height More...
 
 setOpenMode (int $a_open_mode)
 
 getWidth ()
 
 setWidth (int $a_width)
 
 getHeight ()
 
 setHeight (int $a_height)
 
 getMasteryScore ()
 
 setMasteryScore (?int $a_mastery_score)
 
 checkMasteryScoreValues ()
 check mastery_score / min_normalized_measure of SCOs (SCORM 1.2) / objectives (SCORM 2004) More...
 
 getMasteryScoreValues ()
 
 getIdSetting ()
 
 setIdSetting (int $a_id_setting)
 
 getNameSetting ()
 
 setNameSetting (int $a_name_setting)
 
 update ()
 
 setSubType (string $a_sub_type)
 
 getSubType ()
 
 adoptSettingsFrom (ilObjSAHSLearningModule $source)
 Adopt compatible SCORM runtime/settings from another SCORM module. More...
 
 delete ()
 delete SCORM learning module and all related data More...
 
 getPointsInPercent ()
 Returns the points in percent for the learning module This is called by the certificate generator if [SCORM_POINTS] is inserted. More...
 
 getMaxPoints ()
 Returns score.max for the learning module, refered to the last sco where score.max is set. More...
 
 populateByDirectoy (string $a_dir, string $a_filename="")
 Populate by directory. More...
 
 getApiStudentId ()
 Get cmi.core.student_id / cmi.learner_id for API. More...
 
 getApiStudentName ()
 Get cmi.core.student_name / cmi.learner_name for API note: 'lastname, firstname' is required for SCORM 1.2; 9 = no name to hide student_name for external content. More...
 
 getViewButton ()
 get button for view More...
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id, int $new_obj_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static getAffectiveLocalization (int $a_id)
 Get affective localization. More...
 
static _lookupSubType (int $a_obj_id)
 lookup subtype id (scorm, ) More...
 
static _getTries (int $a_id)
 obsolet? More...
 
static getScormModulesForGlossary (int $a_glo_id)
 Get SCORM modules that assign a certain glossary. More...
 
static lookupAssignedGlossary (int $a_slm_id)
 Get SCORM modules that assign a certain glossary. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", ?int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static getIconForType (string $type)
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, ?\ilDBInterface $ilDB=null)
 

Protected Member Functions

 getIrss ()
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Protected Attributes

bool $sequencing = false
 
string $localization = ""
 
string $mastery_score_values = ""
 
int $tries = 0
 
string $api_adapter = 'API'
 
ILIAS DI UIServices $ui
 
string $rid = null
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
LOMServices $lom_services
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Private Attributes

string $api_func_prefix = 'LMS'
 
string $lesson_mode = 'normal'
 
int $style_id = 0
 
string $auto_review = 'n'
 
int $max_attempt = 0
 
int $module_version = 1
 
int $assigned_glossary = 0
 
bool $session = false
 
bool $no_menu = false
 
bool $hide_navig = false
 
bool $ie_force_render = false
 
bool $fourth_edition = false
 
bool $interactions = true
 
bool $objectives = true
 
bool $comments = true
 
bool $time_from_lms = false
 
bool $check_values = true
 
bool $debug = false
 
bool $auto_continue = false
 
bool $auto_last_visited = true
 
bool $auto_suspend = false
 
int $open_mode = 0
 
int $width = 950
 
int $height = 650
 
int $mastery_score = null
 
int $id_setting = 0
 
int $name_setting = 0
 
string $sub_type = 'scorm'
 

Additional Inherited Members

- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjSAHSLearningModule::__construct ( int  $a_id = 0,
bool  $a_call_by_reference = true 
)

Constructor.

Parameters
integer$a_idreference_id or object_id
boolean$a_call_by_referencetreat the id as reference_id (true) or object_id (false)

Reimplemented in ilObjSCORM2004LearningModule, and ilObjSCORMLearningModule.

Definition at line 89 of file class.ilObjSAHSLearningModule.php.

90 {
91 global $DIC;
92 $this->ui = $DIC->ui();
93 $this->type = "sahs";
94 parent::__construct($a_id, $a_call_by_reference);
95 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getTries()

static ilObjSAHSLearningModule::_getTries ( int  $a_id)
static

obsolet?

Definition at line 271 of file class.ilObjSAHSLearningModule.php.

271 : int
272 {
273 global $DIC;
274 $ilDB = $DIC->database();
275
276 $lm_set = $ilDB->queryF(
277 'SELECT question_tries FROM sahs_lm WHERE id = %s',
278 array('integer'),
279 array($a_id)
280 );
281 $lm_rec = $ilDB->fetchAssoc($lm_set);
282
283 return (int) $lm_rec['question_tries'];
284 }
$lm_set

References $DIC, $ilDB, and $lm_set.

◆ _lookupSubType()

static ilObjSAHSLearningModule::_lookupSubType ( int  $a_obj_id)
static

lookup subtype id (scorm, )

Definition at line 213 of file class.ilObjSAHSLearningModule.php.

213 : string
214 {
215 global $DIC;
216 $ilDB = $DIC->database();
217
218 $obj_set = $ilDB->queryF(
219 'SELECT c_type FROM sahs_lm WHERE id = %s',
220 array('integer'),
221 array($a_obj_id)
222 );
223 $obj_rec = $ilDB->fetchAssoc($obj_set);
224 if ($obj_rec == null || $obj_rec["c_type"] == null) {
225 return '';
226 }
227 return $obj_rec["c_type"];
228 }

References $DIC, and $ilDB.

Referenced by ilLPStatusSCORM\_getStatusInfo(), ilObjSCORMLearningModuleGUI\applyAdoptSettings(), checkMasteryScoreValues(), ilLPStatusSCORM\determinePercentage(), ilSAHSPresentationGUI\executeCommand(), ilSAHSEditGUI\executeCommand(), ilLPCollectionSettingsTableGUI\fillRow(), ilTrQuery\getParticipantsForObject(), ilLPCollectionOfSCOs\getPossibleItems(), ilObjSAHSLearningModuleListGUI\getProperties(), ilScormLP\getValidModes(), ilObjSCORM2004LearningModuleGUI\initPropertiesForm(), ilObjSCORMLearningModuleGUI\initPropertiesForm(), ilSCORMAdoptSettingsNodeRetrieval\isSelectableSource(), ilLPCollectionOfSCOs\itemsAreEqual(), ilObjSCORMLearningModuleGUI\newModuleVersion(), ilLPStatusSCORM\refreshStatus(), and ilSAHSPresentationGUI\setInfoTabs().

+ Here is the caller graph for this function:

◆ adoptSettingsFrom()

ilObjSAHSLearningModule::adoptSettingsFrom ( ilObjSAHSLearningModule  $source)

Adopt compatible SCORM runtime/settings from another SCORM module.

Returns false if source and target are not compatible.

Definition at line 1223 of file class.ilObjSAHSLearningModule.php.

1223 : bool
1224 {
1225 if ($source->getId() === $this->getId()) {
1226 return false;
1227 }
1228
1229 $sub_type = $this->getSubType();
1230 if ($sub_type !== "scorm" && $sub_type !== "scorm2004") {
1231 return false;
1232 }
1233
1234 if ($source->getSubType() !== $sub_type) {
1235 return false;
1236 }
1237
1238 $this->setOpenMode($source->getOpenMode());
1239 $this->setWidth($source->getWidth());
1240 $this->setHeight($source->getHeight());
1241 $this->setAuto_last_visited($source->getAuto_last_visited());
1242 $this->setDefaultLessonMode($source->getDefaultLessonMode());
1243 $this->setAutoReviewChar($source->getAutoReviewChar());
1244 $this->setMasteryScore($source->getMasteryScore());
1245 $this->setSession($source->getSession());
1246 $this->setInteractions($source->getInteractions());
1247 $this->setObjectives($source->getObjectives());
1248 $this->setTime_from_lms($source->getTime_from_lms());
1249 $this->setCheck_values($source->getCheck_values());
1250 $this->setAutoSuspend($source->getAutoSuspend());
1251 $this->setDebug($source->getDebug());
1252 $this->setIdSetting($source->getIdSetting());
1253 $this->setNameSetting($source->getNameSetting());
1254
1255 if ($sub_type === "scorm") {
1256 $this->setAutoContinue($source->getAutoContinue());
1257 return true;
1258 }
1259
1260 if ($sub_type === "scorm2004") {
1261 $this->setIe_force_render($source->getIe_force_render());
1262 $this->setNoMenu($source->getNoMenu());
1263 $this->setHideNavig($source->getHideNavig());
1264 $this->setFourth_edition($source->getFourth_Edition());
1265 $this->setSequencing($source->getSequencing());
1266 $this->setComments($source->getComments());
1267 return true;
1268 }
1269
1270 return false;
1271 }
getDefaultLessonMode()
get default lesson mode
setDefaultLessonMode(string $a_lesson_mode)
set default lesson mode
setNoMenu(bool $a_no_menu)
disable menu
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 ...
setFourth_edition(bool $a_fourth_edition)
getAutoReviewChar()
get auto review as Char for SCORM 2004
getOpenMode()
open_mode 0: in Tab/new Window like in previous versions 1: in iFrame with width=100% and heigth=100%...
setIe_force_render(bool $a_ie_force_render)
setHideNavig(bool $a_hide_navig)
disable menu
setAutoReviewChar(?string $a_auto_review)
set auto review as Char for SCORM 2004
setAuto_last_visited(bool $a_auto_last_visited)

References $sub_type, getAuto_last_visited(), getAutoContinue(), getAutoReviewChar(), getAutoSuspend(), getCheck_values(), getComments(), getDebug(), getDefaultLessonMode(), getFourth_Edition(), getHeight(), getHideNavig(), ilObject\getId(), getIdSetting(), getIe_force_render(), getInteractions(), getMasteryScore(), getNameSetting(), getNoMenu(), getObjectives(), getOpenMode(), getSequencing(), getSession(), getSubType(), getTime_from_lms(), getWidth(), setAuto_last_visited(), setAutoContinue(), setAutoReviewChar(), setAutoSuspend(), setCheck_values(), setComments(), setDebug(), setDefaultLessonMode(), setFourth_edition(), setHeight(), setHideNavig(), setIdSetting(), setIe_force_render(), setInteractions(), setMasteryScore(), setNameSetting(), setNoMenu(), setObjectives(), setOpenMode(), setSequencing(), setSession(), setTime_from_lms(), and setWidth().

+ Here is the call graph for this function:

◆ checkMasteryScoreValues()

ilObjSAHSLearningModule::checkMasteryScoreValues ( )

check mastery_score / min_normalized_measure of SCOs (SCORM 1.2) / objectives (SCORM 2004)

Definition at line 987 of file class.ilObjSAHSLearningModule.php.

987 : void
988 {
989 global $DIC;
990 $ilDB = $DIC->database();
991 $s_result = "";
992 $a_result = array();
993 $type = self::_lookupSubType($this->getID());
994
995 if ($type === "scorm2004") {
996 $set = $ilDB->query("SELECT minnormalmeasure FROM cp_objective, cp_node" .
997 " WHERE satisfiedbymeasure=1 AND minnormalmeasure is not null AND cp_objective.cp_node_id=cp_node.cp_node_id AND" .
998 " slm_id = " . $ilDB->quote($this->getID(), "integer"));
999 while ($rec = $ilDB->fetchAssoc($set)) {
1000 $tmpval = $rec["minnormalmeasure"] * 100;
1001 if (!in_array($tmpval, $a_result)) {
1002 $a_result[] = $tmpval;
1003 }
1004 }
1005 } else {
1006 $set = $ilDB->query("SELECT masteryscore FROM sc_item,scorm_object" .
1007 " WHERE sc_item.masteryscore is not null AND sc_item.obj_id=scorm_object.obj_id AND" .
1008 " slm_id = " . $ilDB->quote($this->getID(), "integer"));
1009 while ($rec = $ilDB->fetchAssoc($set)) {
1010 if (!in_array($rec["masteryscore"], $a_result)) {
1011 $a_result[] = $rec["masteryscore"];
1012 }
1013 }
1014 }
1015 $s_result = implode(", ", $a_result);
1016 $this->mastery_score_values = $s_result;
1017 }
static _lookupSubType(int $a_obj_id)
lookup subtype id (scorm, )
string $type

References $DIC, $ilDB, ilObject\$type, and _lookupSubType().

+ Here is the call graph for this function:

◆ create()

ilObjSAHSLearningModule::create ( bool  $upload = false)

create file based lm

Definition at line 100 of file class.ilObjSAHSLearningModule.php.

100 : int
101 {
102 global $DIC;
103 $ilDB = $DIC->database();
104
105 $id = parent::create();
106 if (!$upload) {
107 $this->createMetaData();
108 }
109
110 $this->createDataDirectory();
111 $ilDB->manipulateF(
112 '
113 INSERT INTO sahs_lm (id, api_adapter, c_type, editable, seq_exp_mode,localization)
114 VALUES (%s,%s,%s,%s,%s,%s)',
115 array('integer', 'text', 'text', 'integer','integer','text'),
116 array($this->getId(),'API', $this->getSubType(),(int) $this->getEditable(),
117 0, $this->getLocalization()
118 )
119 );
120 return $id;
121 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
createDataDirectory()
creates data directory for package files ("./public/data/lm_data/lm_<id>")

References $DIC, $id, $ilDB, createDataDirectory(), ilObject\createMetaData(), getEditable(), ilObject\getId(), getLocalization(), and getSubType().

+ Here is the call graph for this function:

◆ createDataDirectory()

ilObjSAHSLearningModule::createDataDirectory ( )

creates data directory for package files ("./public/data/lm_data/lm_<id>")

Definition at line 301 of file class.ilObjSAHSLearningModule.php.

301 : void
302 {
303 $lm_data_dir = ilFileUtils::getWebspaceDir() . "/lm_data";
304 ilFileUtils::makeDir($lm_data_dir);
306 }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
getDataDirectory(?string $mode="filesystem")
get data directory of lm

References getDataDirectory(), ilFileUtils\getWebspaceDir(), and ilFileUtils\makeDir().

Referenced by create(), and extractContainerToDataDirectory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilObjSAHSLearningModule::delete ( )

delete SCORM learning module and all related data

this method has been tested on may 9th 2004 meta data, scorm lm data, scorm tree, scorm objects (organization(s), manifest, resources and items), tracking data and data directory have been deleted correctly as desired

Returns
boolean true if all object data were removed; false if only a references were removed

Reimplemented from ilObject.

Definition at line 1283 of file class.ilObjSAHSLearningModule.php.

1283 : bool
1284 {
1285 global $DIC;
1286 $ilDB = $DIC->database();
1287 $ilLog = ilLoggerFactory::getLogger('sahs');
1288
1289 // always call parent delete function first!!
1290 if (!parent::delete()) {
1291 return false;
1292 }
1293
1294 // delete meta data of scorm content object
1295 $this->deleteMetaData();
1296
1297 // delete content container resource (migrated modules)
1298 $this->removeContainerResource();
1299
1300 // delete data directory
1302
1303 // delete scorm learning module record
1304 $ilDB->manipulateF(
1305 'DELETE FROM sahs_lm WHERE id = %s',
1306 array('integer'),
1307 array($this->getId())
1308 );
1309
1310 $ilLog->debug("SAHS Delete(SAHSLM), Subtype: " . $this->getSubType());
1311
1312 if ($this->getSubType() === "scorm") {
1313 $sc_tree = new ilSCORMTree($this->getId());
1314 $r_id = $sc_tree->readRootId();
1315 if ($r_id > 0) {
1316 $items = $sc_tree->getSubTree($sc_tree->getNodeData($r_id));
1317 foreach ($items as $item) {
1318 $sc_object = ilSCORMObject::_getInstance((int) $item["obj_id"], $this->getId());
1319 if (is_object($sc_object)) {
1320 $sc_object->delete();
1321 }
1322 }
1323 $sc_tree->removeTree($sc_tree->getTreeId());
1324 }
1325 }
1326
1327 if ($this->getSubType() !== "scorm") {
1328 // delete aicc data
1329 $res = $ilDB->queryF(
1330 '
1331 SELECT aicc_object.obj_id FROM aicc_object, aicc_units
1332 WHERE aicc_object.obj_id = aicc_units.obj_id
1333 AND aicc_object.slm_id = %s',
1334 array('integer'),
1335 array($this->getId())
1336 );
1337
1338 while ($row = $ilDB->fetchAssoc($res)) {
1339 $obj_id = $row['obj_id'];
1340 $ilDB->manipulateF(
1341 '
1342 DELETE FROM aicc_units WHERE obj_id = %s',
1343 array('integer'),
1344 array($obj_id)
1345 );
1346 }
1347
1348 $res = $ilDB->queryF(
1349 '
1350 SELECT aicc_object.obj_id FROM aicc_object, aicc_course
1351 WHERE aicc_object.obj_id = aicc_course.obj_id
1352 AND aicc_object.slm_id = %s',
1353 array('integer'),
1354 array($this->getId())
1355 );
1356
1357 while ($row = $ilDB->fetchAssoc($res)) {
1358 $obj_id = $row['obj_id'];
1359 $ilDB->manipulateF(
1360 '
1361 DELETE FROM aicc_course WHERE obj_id = %s',
1362 array('integer'),
1363 array($obj_id)
1364 );
1365 }
1366
1367 $ilDB->manipulateF(
1368 '
1369 DELETE FROM aicc_object WHERE slm_id = %s',
1370 array('integer'),
1371 array($this->getId())
1372 );
1373 }
1374
1375 $q_log = "DELETE FROM scorm_tracking WHERE obj_id = " . $ilDB->quote($this->getId());
1376 $ilLog->info("SAHS Delete(SAHSLM): " . $q_log);
1377
1378 $ilDB->manipulateF(
1379 'DELETE FROM scorm_tracking WHERE obj_id = %s',
1380 array('integer'),
1381 array($this->getId())
1382 );
1383
1384 $q_log = "DELETE FROM sahs_user WHERE obj_id = " . $ilDB->quote($this->getId());
1385 $ilLog->info("SAHS Delete(SAHSLM): " . $q_log);
1386
1387 $ilDB->manipulateF(
1388 'DELETE FROM sahs_user WHERE obj_id = %s',
1389 array('integer'),
1390 array($this->getId())
1391 );
1392
1393 // always call parent delete function at the end!!
1394 return true;
1395 }
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getLogger(string $a_component_id)
Get component logger.
static & _getInstance(int $a_id, int $a_slm_id)
SCORM Object Tree.
foreach($_POST as $key=> $value) $res

References $DIC, $ilDB, $res, ilSCORMObject\_getInstance(), ilFileUtils\delDir(), ilObject\deleteMetaData(), getDataDirectory(), ilObject\getId(), ilLoggerFactory\getLogger(), getSubType(), and removeContainerResource().

+ Here is the call graph for this function:

◆ extractContainerToDataDirectory()

ilObjSAHSLearningModule::extractContainerToDataDirectory ( )

Extract the current container revision back onto disk at getDataDirectory().

Used to re-parse the manifest (cp_* tables) for a freshly cloned module. The caller must remove the directory afterwards.

Definition at line 495 of file class.ilObjSAHSLearningModule.php.

495 : bool
496 {
497 $resource = $this->getResource();
498 if ($resource === null) {
499 return false;
500 }
501 $this->createDataDirectory();
502 $options = (new UnzipOptions())
503 ->withZipOutputPath($this->getDataDirectory())
504 ->withOverwrite(true);
505
506 return $this->getIrss()
507 ->consume()
508 ->containerZIP($resource->getIdentification())
509 ->getZIP($options)
510 ->extract();
511 }

References ILIAS\UI\Implementation\Component\Input\Field\$options, createDataDirectory(), getDataDirectory(), getIrss(), and getResource().

Referenced by writeContentZip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAffectiveLocalization()

static ilObjSAHSLearningModule::getAffectiveLocalization ( int  $a_id)
static

Get affective localization.

Definition at line 191 of file class.ilObjSAHSLearningModule.php.

191 : string
192 {
193 global $DIC;
194 $ilDB = $DIC->database();
195 $lng = $DIC->language();
196
197 $lm_set = $ilDB->queryF(
198 'SELECT localization FROM sahs_lm WHERE id = %s',
199 array('integer'),
200 array($a_id)
201 );
202 $lm_rec = $ilDB->fetchAssoc($lm_set);
203 $inst_lang = $lng->getInstalledLanguages();
204 if ($lm_rec["localization"] != "" && in_array($lm_rec["localization"], $inst_lang)) {
205 return $lm_rec["localization"];
206 }
207 return $lng->getLangKey();
208 }
getLangKey()
Return lang key.
getInstalledLanguages()
Get installed languages.
ilLanguage $lng

References $DIC, $ilDB, $lm_set, ilObject\$lng, ilLanguage\getInstalledLanguages(), and ilLanguage\getLangKey().

+ Here is the call graph for this function:

◆ getAPIAdapterName()

ilObjSAHSLearningModule::getAPIAdapterName ( )

get api adapter name

Definition at line 537 of file class.ilObjSAHSLearningModule.php.

537 : string
538 {
539 return $this->api_adapter;
540 }

References $api_adapter.

Referenced by update().

+ Here is the caller graph for this function:

◆ getAPIFunctionsPrefix()

ilObjSAHSLearningModule::getAPIFunctionsPrefix ( )

get api functions prefix

Returns
string

Definition at line 554 of file class.ilObjSAHSLearningModule.php.

554 : string
555 {
557 }

References $api_func_prefix.

Referenced by update().

+ Here is the caller graph for this function:

◆ getApiStudentId()

ilObjSAHSLearningModule::getApiStudentId ( )

Get cmi.core.student_id / cmi.learner_id for API.

Definition at line 1582 of file class.ilObjSAHSLearningModule.php.

1582 : string
1583 {
1584 global $DIC;
1585 $usr = $DIC->user();
1586 $idSetting = $this->getIdSetting();
1587 $studentId = (string) $usr->getId();
1588 if ($idSetting % 2 == 1) {
1589 $studentId = $usr->getLogin();
1590 }
1591 if ($idSetting > 3) {
1592 $studentId .= '_o_' . $this->getId();
1593 } elseif ($idSetting > 1) {
1594 $studentId .= '_r_' . $this->getRefId();
1595 }
1596 return $studentId;
1597 }

References $DIC, ilObject\getId(), getIdSetting(), and ilObject\getRefId().

Referenced by ilObjSCORMInitData\getIliasScormVars().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getApiStudentName()

ilObjSAHSLearningModule::getApiStudentName ( )

Get cmi.core.student_name / cmi.learner_name for API note: 'lastname, firstname' is required for SCORM 1.2; 9 = no name to hide student_name for external content.

Definition at line 1603 of file class.ilObjSAHSLearningModule.php.

1603 : string
1604 {
1605 global $DIC;
1606 $lng = $DIC->language();
1607 $usr = $DIC->user();
1608 $studentName = " ";
1609 switch ($this->getNameSetting()) {
1610 case 0:
1611 $studentName = $usr->getLastname() . ', ' . $usr->getFirstname();
1612 break;
1613 case 1:
1614 $studentName = $usr->getFirstname() . ' ' . $usr->getLastname();
1615 break;
1616 case 2:
1617 $studentName = $usr->getFullname();
1618 break;
1619 case 3:
1620 switch ($usr->getGender()) {
1621 case 'f':
1622 $studentName = $lng->txt('salutation_f') . ' ';
1623 break;
1624
1625 case 'm':
1626 $studentName = $lng->txt('salutation_m') . ' ';
1627 break;
1628
1629 case 'n':
1630 $studentName = '';//$lng->txt('salutation_n');
1631 break;
1632
1633 default:
1634 $studentName = $lng->txt('salutation') . ' ';
1635 }
1636 $studentName .= $usr->getLastname();
1637 break;
1638 case 4:
1639 $studentName = $usr->getFirstname();
1640 break;
1641 }
1642 return $studentName;
1643 }
txt(string|LanguageIdentifier $a_topic, ?int $n=null)
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...

References $DIC, ilObject\$lng, getNameSetting(), and ilLanguage\txt().

Referenced by ilObjSCORMInitData\getIliasScormVars().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAssignedGlossary()

ilObjSAHSLearningModule::getAssignedGlossary ( )

Definition at line 668 of file class.ilObjSAHSLearningModule.php.

668 : int
669 {
671 }

References $assigned_glossary.

Referenced by update().

+ Here is the caller graph for this function:

◆ getAuto_last_visited()

ilObjSAHSLearningModule::getAuto_last_visited ( )

Definition at line 893 of file class.ilObjSAHSLearningModule.php.

893 : bool
894 {
896 }

References $auto_last_visited.

Referenced by adoptSettingsFrom(), ilObjSCORMInitData\getIliasScormVars(), and update().

+ Here is the caller graph for this function:

◆ getAutoContinue()

ilObjSAHSLearningModule::getAutoContinue ( )

Definition at line 888 of file class.ilObjSAHSLearningModule.php.

888 : bool
889 {
891 }

References $auto_continue.

Referenced by adoptSettingsFrom(), ilObjSCORMInitData\getIliasScormVars(), and update().

+ Here is the caller graph for this function:

◆ getAutoReview()

ilObjSAHSLearningModule::getAutoReview ( )

get auto review as true/false for SCORM 1.2

Definition at line 628 of file class.ilObjSAHSLearningModule.php.

628 : bool
629 {
630 return ilUtil::yn2tf($this->auto_review);
631 }
static yn2tf(string $a_yn)

References ilUtil\yn2tf().

Referenced by ilObjSCORMInitData\getIliasScormVars().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAutoReviewChar()

ilObjSAHSLearningModule::getAutoReviewChar ( )

get auto review as Char for SCORM 2004

Definition at line 648 of file class.ilObjSAHSLearningModule.php.

648 : string
649 {
650 return $this->auto_review;
651 }

References $auto_review.

Referenced by adoptSettingsFrom(), and update().

+ Here is the caller graph for this function:

◆ getAutoSuspend()

ilObjSAHSLearningModule::getAutoSuspend ( )

Definition at line 929 of file class.ilObjSAHSLearningModule.php.

929 : bool
930 {
931 return $this->auto_suspend;
932 }

References $auto_suspend.

Referenced by adoptSettingsFrom(), ilObjSCORMInitData\getIliasScormVars(), and update().

+ Here is the caller graph for this function:

◆ getCacheDeactivated()

ilObjSAHSLearningModule::getCacheDeactivated ( )

BrowserCacheDisabled for SCORM 2004 / ENABLE_JS_DEBUG.

Definition at line 728 of file class.ilObjSAHSLearningModule.php.

728 : bool
729 {
730 global $DIC;
731 $ilSetting = $DIC->settings();
732 $lm_set = new ilSetting("lm");
733 return $lm_set->get("scormdebug_disable_cache") == "1";
734 }
ILIAS Setting Class.
global $ilSetting
Definition: privfeed.php:26

References $DIC, $ilSetting, and $lm_set.

◆ getCheck_values()

ilObjSAHSLearningModule::getCheck_values ( )

Definition at line 834 of file class.ilObjSAHSLearningModule.php.

834 : bool
835 {
836 return $this->check_values;
837 }

References $check_values.

Referenced by adoptSettingsFrom(), ilObjSCORMInitData\getIliasScormVars(), and update().

+ Here is the caller graph for this function:

◆ getComments()

ilObjSAHSLearningModule::getComments ( )

Definition at line 814 of file class.ilObjSAHSLearningModule.php.

814 : bool
815 {
816 return $this->comments;
817 }

References $comments.

Referenced by adoptSettingsFrom(), and update().

+ Here is the caller graph for this function:

◆ getContainerBaseUri()

ilObjSAHSLearningModule::getContainerBaseUri ( float  $valid_for_at_least_minutes = 480.0)

Base URL of the content container, ending in the sub-request separator so the player can append relative paths (e.g.

"<base>/-/sco1/index.html"). Returns null for un-migrated modules; callers must then fall back to the web path of getDataDirectory().

Definition at line 363 of file class.ilObjSAHSLearningModule.php.

363 : ?string
364 {
365 $resource = $this->getResource();
366 if ($resource === null) {
367 return null;
368 }
369 $uri = $this->getIrss()->consume()->containerURI(
370 $resource->getIdentification(),
371 '',
372 $valid_for_at_least_minutes
373 )->getURI();
374 if ($uri === null) {
375 return null;
376 }
377
378 // The player appends relative file paths to this base, so it must end
379 // with the sub-request separator "/-/". new URI() strips the trailing
380 // slash for an empty start file, leaving ".../-" — restore it, otherwise
381 // requests miss the separator and the whole container ZIP is delivered.
382 $base = (string) $uri;
383 if (str_ends_with($base, '/-')) {
384 $base .= '/';
385 }
386 return $base;
387 }

References getIrss(), and getResource().

Referenced by ilObjSCORMInitData\getIliasScormVars().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCreditMode()

ilObjSAHSLearningModule::getCreditMode ( )

get credit mode

Definition at line 570 of file class.ilObjSAHSLearningModule.php.

570 : string
571 {
572 $learningProgress = ilObjectLP::getInstance($this->getID());
573 $currentMode = $learningProgress->getCurrentMode();
574 if ($currentMode === ilLPObjSettings::LP_MODE_SCORM || $currentMode === ilLPObjSettings::LP_MODE_SCORM_PACKAGE) {
575 return "credit";
576 } else {
577 return "no-credit";
578 }
579 }
static getInstance(int $obj_id)

References ilObjectLP\getInstance(), ilLPObjSettings\LP_MODE_SCORM, and ilLPObjSettings\LP_MODE_SCORM_PACKAGE.

Referenced by ilObjSCORMInitData\getIliasScormVars(), and update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDataDirectory()

ilObjSAHSLearningModule::getDataDirectory ( ?string  $mode = "filesystem")

get data directory of lm

Definition at line 311 of file class.ilObjSAHSLearningModule.php.

311 : string
312 {
313 $lm_data_dir = ilFileUtils::getWebspaceDir($mode) . "/lm_data";
314 return $lm_data_dir . "/lm_" . $this->getId();
315 }

References ilObject\getId(), and ilFileUtils\getWebspaceDir().

Referenced by ilObjSCORM2004LearningModule\convert_1_2_to_2004(), createDataDirectory(), delete(), extractContainerToDataDirectory(), ilObjSCORMInitData\getIliasScormVars(), moveDataDirectoryToContainer(), populateByDirectoy(), ilObjSCORM2004LearningModule\readObject(), ilObjSCORMLearningModule\readObject(), and writeContentZip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDebug()

ilObjSAHSLearningModule::getDebug ( )

Definition at line 857 of file class.ilObjSAHSLearningModule.php.

857 : bool
858 {
859 return $this->debug;
860 }

References $debug.

Referenced by adoptSettingsFrom(), ilObjSCORMInitData\getIliasScormVars(), and update().

+ Here is the caller graph for this function:

◆ getDebugActivated()

ilObjSAHSLearningModule::getDebugActivated ( )

debugActivated

Definition at line 750 of file class.ilObjSAHSLearningModule.php.

750 : bool
751 {
752 global $DIC;
753 $ilSetting = $DIC->settings();
754 $lm_set = new ilSetting("lm");
755 return $lm_set->get("scormdebug_global_activate") === "1";
756 }

References $DIC, $ilSetting, and $lm_set.

◆ getDefaultLessonMode()

ilObjSAHSLearningModule::getDefaultLessonMode ( )

get default lesson mode

Definition at line 592 of file class.ilObjSAHSLearningModule.php.

592 : string
593 {
594 global $DIC;
595 if ($DIC->user()->getId() == 13) {
596 return "browse";
597 }
598 return $this->lesson_mode;
599 }

References $DIC, and $lesson_mode.

Referenced by adoptSettingsFrom(), ilObjSCORMInitData\getIliasScormVars(), and update().

+ Here is the caller graph for this function:

◆ getDiskUsage()

ilObjSAHSLearningModule::getDiskUsage ( )

Gets the disk usage of the object in bytes.

Returns
integer the disk usage in bytes

Definition at line 291 of file class.ilObjSAHSLearningModule.php.

291 : int
292 {
294 }
static _lookupDiskUsage(int $a_id)
Returns the number of bytes used on the harddisk by the learning module with the specified object id.

References ilObjSAHSLearningModuleAccess\_lookupDiskUsage().

+ Here is the call graph for this function:

◆ getEditable()

ilObjSAHSLearningModule::getEditable ( )

Definition at line 240 of file class.ilObjSAHSLearningModule.php.

240 : bool
241 {
242 return false;
243 }

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getFourth_Edition()

ilObjSAHSLearningModule::getFourth_Edition ( )

SCORM 2004 4th edition features.

Definition at line 774 of file class.ilObjSAHSLearningModule.php.

774 : bool
775 {
777 }

References $fourth_edition.

Referenced by adoptSettingsFrom().

+ Here is the caller graph for this function:

◆ getHeight()

ilObjSAHSLearningModule::getHeight ( )

Definition at line 964 of file class.ilObjSAHSLearningModule.php.

964 : int
965 {
966 return $this->height;
967 }

References $height.

Referenced by adoptSettingsFrom(), getViewButton(), and update().

+ Here is the caller graph for this function:

◆ getHideNavig()

ilObjSAHSLearningModule::getHideNavig ( )

hide navigation tree

Definition at line 712 of file class.ilObjSAHSLearningModule.php.

712 : bool
713 {
714 return $this->hide_navig;
715 }

References $hide_navig.

Referenced by adoptSettingsFrom(), and update().

+ Here is the caller graph for this function:

◆ getIdSetting()

ilObjSAHSLearningModule::getIdSetting ( )

Definition at line 1024 of file class.ilObjSAHSLearningModule.php.

1024 : int
1025 {
1026 return $this->id_setting;
1027 }

References $id_setting.

Referenced by adoptSettingsFrom(), getApiStudentId(), and update().

+ Here is the caller graph for this function:

◆ getIe_force_render()

ilObjSAHSLearningModule::getIe_force_render ( )

force Internet Explorer to render again after some Milliseconds - useful for learning Modules with a lot of iframes or frames and IE >=10

Definition at line 761 of file class.ilObjSAHSLearningModule.php.

761 : bool
762 {
764 }

References $ie_force_render.

Referenced by adoptSettingsFrom(), and update().

+ Here is the caller graph for this function:

◆ getInteractions()

ilObjSAHSLearningModule::getInteractions ( )

Definition at line 794 of file class.ilObjSAHSLearningModule.php.

794 : bool
795 {
796 return $this->interactions;
797 }

References $interactions.

Referenced by adoptSettingsFrom(), ilObjSCORMInitData\getIliasScormVars(), and update().

+ Here is the caller graph for this function:

◆ getIrss()

ilObjSAHSLearningModule::getIrss ( )
protected

Definition at line 327 of file class.ilObjSAHSLearningModule.php.

327 : IRSS
328 {
329 global $DIC;
330 return $DIC->resourceStorage();
331 }

References $DIC.

Referenced by extractContainerToDataDirectory(), getContainerBaseUri(), getManifestFromContainer(), getResource(), moveDataDirectoryToContainer(), removeContainerResource(), and replaceContainerFromZipPath().

+ Here is the caller graph for this function:

◆ getLocalization()

ilObjSAHSLearningModule::getLocalization ( )

Definition at line 263 of file class.ilObjSAHSLearningModule.php.

263 : string
264 {
265 return $this->localization;
266 }

References $localization.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getManifestFromContainer()

ilObjSAHSLearningModule::getManifestFromContainer ( string  $manifest_file = 'imsmanifest.xml')

Read the imsmanifest.xml of the current container revision (migrated modules).

Returns null when the module is not migrated or the manifest is absent. Used to validate that a new package version matches the existing manifest structure (cp_* tables) before replacing the resource.

Definition at line 408 of file class.ilObjSAHSLearningModule.php.

408 : ?string
409 {
410 $resource = $this->getResource();
411 if ($resource === null) {
412 return null;
413 }
414 $zip = $this->getIrss()->consume()->containerZIP($resource->getIdentification())->getZIP();
415 $files = iterator_to_array($zip->getFiles(), false);
416 foreach ($zip->getFileStreams() as $i => $stream) {
417 if (isset($files[$i]) && basename((string) $files[$i]) === $manifest_file) {
418 try {
419 return $stream->getContents();
420 } catch (\Throwable) {
421 // Keep method non-throwing; caller handles missing/unreadable manifest.
422 return null;
423 }
424 }
425 }
426 return null;
427 }

References $files, getIrss(), and getResource().

+ Here is the call graph for this function:

◆ getMasteryScore()

ilObjSAHSLearningModule::getMasteryScore ( )

Definition at line 974 of file class.ilObjSAHSLearningModule.php.

974 : ?int
975 {
977 }

References $mastery_score.

Referenced by adoptSettingsFrom(), ilObjSCORMInitData\getIliasScormVars(), and update().

+ Here is the caller graph for this function:

◆ getMasteryScoreValues()

ilObjSAHSLearningModule::getMasteryScoreValues ( )

Definition at line 1019 of file class.ilObjSAHSLearningModule.php.

1019 : string
1020 {
1022 }

References $mastery_score_values.

◆ getMaxAttempt()

ilObjSAHSLearningModule::getMaxAttempt ( )

Definition at line 653 of file class.ilObjSAHSLearningModule.php.

653 : int
654 {
655 return $this->max_attempt;
656 }

References $max_attempt.

Referenced by update().

+ Here is the caller graph for this function:

◆ getMaxPoints()

ilObjSAHSLearningModule::getMaxPoints ( )

Returns score.max for the learning module, refered to the last sco where score.max is set.

This is called by the certificate generator if [SCORM_POINTS_MAX] is inserted.

Definition at line 1423 of file class.ilObjSAHSLearningModule.php.

1423 : ?float
1424 {
1425 global $DIC;
1426 $ilUser = $DIC->user();
1427
1428 if (strcmp($this->getSubType(), 'scorm2004') == 0) {
1429 $res = ilObjSCORM2004LearningModule::_getMaxScoreForUser($this->getId(), $ilUser->getId());
1430 return $res;
1431 }
1432
1433 return null;
1434 }
static _getMaxScoreForUser(int $a_id, int $a_user)
Returns score.max for the learning module, refered to the last sco where score.max is set.

References $DIC, $res, ilObjSCORM2004LearningModule\_getMaxScoreForUser(), ilObject\getId(), and getSubType().

+ Here is the call graph for this function:

◆ getModuleVersion()

ilObjSAHSLearningModule::getModuleVersion ( )

Definition at line 663 of file class.ilObjSAHSLearningModule.php.

663 : int
664 {
666 }

References $module_version.

Referenced by update().

+ Here is the caller graph for this function:

◆ getNameSetting()

ilObjSAHSLearningModule::getNameSetting ( )

Definition at line 1034 of file class.ilObjSAHSLearningModule.php.

1034 : int
1035 {
1036 return $this->name_setting;
1037 }

References $name_setting.

Referenced by adoptSettingsFrom(), getApiStudentName(), and update().

+ Here is the caller graph for this function:

◆ getNoMenu()

ilObjSAHSLearningModule::getNoMenu ( )

disable menu

Definition at line 696 of file class.ilObjSAHSLearningModule.php.

696 : bool
697 {
698 return $this->no_menu;
699 }

References $no_menu.

Referenced by adoptSettingsFrom(), and update().

+ Here is the caller graph for this function:

◆ getObjectives()

ilObjSAHSLearningModule::getObjectives ( )

Definition at line 804 of file class.ilObjSAHSLearningModule.php.

804 : bool
805 {
806 return $this->objectives;
807 }

References $objectives.

Referenced by adoptSettingsFrom(), ilObjSCORMInitData\getIliasScormVars(), and update().

+ Here is the caller graph for this function:

◆ getOpenMode()

ilObjSAHSLearningModule::getOpenMode ( )

open_mode 0: in Tab/new Window like in previous versions 1: in iFrame with width=100% and heigth=100% 2: in iFrame with specified width and height 3: 4: 5: in new Window without specified width and height 6: in new Window with specified width and height

Definition at line 944 of file class.ilObjSAHSLearningModule.php.

944 : int
945 {
946 return $this->open_mode;
947 }

References $open_mode.

Referenced by adoptSettingsFrom(), getViewButton(), and update().

+ Here is the caller graph for this function:

◆ getPointsInPercent()

ilObjSAHSLearningModule::getPointsInPercent ( )

Returns the points in percent for the learning module This is called by the certificate generator if [SCORM_POINTS] is inserted.

Definition at line 1402 of file class.ilObjSAHSLearningModule.php.

1402 : ?float
1403 {
1404 global $DIC;
1405 $ilUser = $DIC->user();
1406 if (strcmp($this->getSubType(), "scorm2004") == 0) {
1408 if (!is_null($res)) {
1409 return $res * 100.0;
1410 }
1411
1412 return $res;
1413 }
1414
1415 return null;
1416 }
static _getUniqueScaledScoreForUser(int $a_id, int $a_user)
Get the Unique Scaled Score of a course Conditions: Only one SCO may set cmi.score....

References $DIC, $res, ilObjSCORM2004LearningModule\_getUniqueScaledScoreForUser(), ilObject\getId(), and getSubType().

+ Here is the call graph for this function:

◆ getResource()

ilObjSAHSLearningModule::getResource ( )

Definition at line 343 of file class.ilObjSAHSLearningModule.php.

344 {
345 $rid = $this->getRID();
346 if ($rid === null || $rid === '' || $rid === '-') {
347 return null;
348 }
349 $identification = $this->getIrss()->manage()->find($rid);
350 if ($identification === null) {
351 return null;
352 }
353 $resource = $this->getIrss()->manage()->getResource($identification);
354 return $resource instanceof StorableContainerResource ? $resource : null;
355 }

References $rid, getIrss(), and getRID().

Referenced by extractContainerToDataDirectory(), getContainerBaseUri(), getManifestFromContainer(), hasContainerResource(), removeContainerResource(), and replaceContainerFromZipPath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRID()

ilObjSAHSLearningModule::getRID ( )

Definition at line 317 of file class.ilObjSAHSLearningModule.php.

317 : ?string
318 {
319 return $this->rid;
320 }

References $rid.

Referenced by getResource(), and update().

+ Here is the caller graph for this function:

◆ getScormModulesForGlossary()

static ilObjSAHSLearningModule::getScormModulesForGlossary ( int  $a_glo_id)
static

Get SCORM modules that assign a certain glossary.

Definition at line 1175 of file class.ilObjSAHSLearningModule.php.

1175 : array
1176 {
1177 global $DIC;
1178 $ilDB = $DIC->database();
1179
1180 $set = $ilDB->query("SELECT DISTINCT id FROM sahs_lm WHERE " .
1181 " glossary = " . $ilDB->quote($a_glo_id, "integer"));
1182 $sms = array();
1183 while ($rec = $ilDB->fetchAssoc($set)) {
1184 if (ilObject::_hasUntrashedReference((int) $rec["id"])) {
1185 $sms[] = $rec["id"];
1186 }
1187 }
1188 return $sms;
1189 }
static _hasUntrashedReference(int $obj_id)
checks whether an object has at least one reference that is not in trash

References $DIC, $ilDB, and ilObject\_hasUntrashedReference().

+ Here is the call graph for this function:

◆ getSequencing()

ilObjSAHSLearningModule::getSequencing ( )

Definition at line 784 of file class.ilObjSAHSLearningModule.php.

784 : bool
785 {
786 return $this->sequencing;
787 }

References $sequencing.

Referenced by adoptSettingsFrom(), and update().

+ Here is the caller graph for this function:

◆ getSession()

ilObjSAHSLearningModule::getSession ( )

Definition at line 683 of file class.ilObjSAHSLearningModule.php.

683 : bool
684 {
685 return $this->session;
686 }

References $session.

Referenced by adoptSettingsFrom(), ilObjSCORMInitData\getIliasScormVars(), and update().

+ Here is the caller graph for this function:

◆ getSessionDeactivated()

ilObjSAHSLearningModule::getSessionDeactivated ( )

sessionDisabled for SCORM 2004

Definition at line 739 of file class.ilObjSAHSLearningModule.php.

739 : bool
740 {
741 global $DIC;
742 $ilSetting = $DIC->settings();
743 $lm_set = new ilSetting("lm");
744 return $lm_set->get("scorm_without_session") == "1";
745 }

References $DIC, $ilSetting, and $lm_set.

Referenced by ilObjSCORMInitData\getIliasScormVars().

+ Here is the caller graph for this function:

◆ getStyleSheetId()

ilObjSAHSLearningModule::getStyleSheetId ( )

get ID of assigned style sheet object

Definition at line 604 of file class.ilObjSAHSLearningModule.php.

604 : int
605 {
606 return $this->style_id;
607 }

References $style_id.

Referenced by read(), and update().

+ Here is the caller graph for this function:

◆ getSubType()

ilObjSAHSLearningModule::getSubType ( )

Definition at line 1214 of file class.ilObjSAHSLearningModule.php.

1214 : string
1215 {
1216 return $this->sub_type;
1217 }

References $sub_type.

Referenced by adoptSettingsFrom(), create(), delete(), getMaxPoints(), getPointsInPercent(), and update().

+ Here is the caller graph for this function:

◆ getTime_from_lms()

ilObjSAHSLearningModule::getTime_from_lms ( )

Definition at line 824 of file class.ilObjSAHSLearningModule.php.

824 : bool
825 {
827 }

References $time_from_lms.

Referenced by adoptSettingsFrom(), ilObjSCORMInitData\getIliasScormVars(), and update().

+ Here is the caller graph for this function:

◆ getTries()

ilObjSAHSLearningModule::getTries ( )

Definition at line 253 of file class.ilObjSAHSLearningModule.php.

253 : int
254 {
255 return $this->tries;
256 }

References $tries.

Referenced by update().

+ Here is the caller graph for this function:

◆ getViewButton()

ilObjSAHSLearningModule::getViewButton ( )

get button for view

Definition at line 1650 of file class.ilObjSAHSLearningModule.php.

1651 {
1652 global $DIC;
1653
1654 $setUrl = "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->getRefID();
1655 // $setUrl = $this->getLinkTargetByClass("ilsahspresentationgui", "")."&amp;ref_id=".$this->getRefID();
1656
1657 $setTarget = "ilContObj" . $this->getId();
1658
1659 $om = $this->getOpenMode();
1660 $width = $this->getWidth();
1661 $height = $this->getHeight();
1662
1663 if (($om == 5 || $om == 1) && $width > 0 && $height > 0) {
1664 $om++;
1665 }
1666
1667 if ($om != 0) {
1668 $setUrl = "javascript:void(0); onclick=startSAHS('" . $setUrl . "','ilContObj" . $this->getId() . "'," . $om . "," . $width . "," . $height . ");";
1669 $setTarget = "";
1670 }
1671
1672 $button = $this->ui->factory()->link()->standard(
1673 $DIC->language()->txt("start_lm"),
1674 $setUrl
1675 );
1676
1677 $button = $button->withOnLoadCode(static fn($id): string => "
1678 document.getElementById('$id').setAttribute('target', '$setTarget');
1679 document.getElementById('$id').removeAttribute('rel');
1680 ");
1681
1682 return $button;
1683 }

References $DIC, $height, $id, $width, getHeight(), ilObject\getId(), getOpenMode(), getWidth(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ getWidth()

ilObjSAHSLearningModule::getWidth ( )

Definition at line 954 of file class.ilObjSAHSLearningModule.php.

954 : int
955 {
956 return $this->width;
957 }

References $width.

Referenced by adoptSettingsFrom(), getViewButton(), and update().

+ Here is the caller graph for this function:

◆ hasContainerResource()

ilObjSAHSLearningModule::hasContainerResource ( )

True when the module's content lives in a Resource Storage container.

The rid sentinel '-' marks a module whose migration failed, '' an un-migrated module; both fall back to the on-disk data directory.

Definition at line 338 of file class.ilObjSAHSLearningModule.php.

338 : bool
339 {
340 return $this->getResource() !== null;
341 }

References getResource().

Referenced by writeContentZip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupAssignedGlossary()

static ilObjSAHSLearningModule::lookupAssignedGlossary ( int  $a_slm_id)
static

Get SCORM modules that assign a certain glossary.

Definition at line 1194 of file class.ilObjSAHSLearningModule.php.

1194 : int
1195 {
1196 global $DIC;
1197 $ilDB = $DIC->database();
1198
1199 $set = $ilDB->query("SELECT DISTINCT glossary FROM sahs_lm WHERE " .
1200 " id = " . $ilDB->quote($a_slm_id, "integer"));
1201 $rec = $ilDB->fetchAssoc($set);
1202 $glo_id = $rec["glossary"];
1203 if (ilObject::_lookupType($glo_id) === "glo") {
1204 return $glo_id;
1205 }
1206 return 0;
1207 }
static _lookupType(int $id, bool $reference=false)

References $DIC, $ilDB, and ilObject\_lookupType().

+ Here is the call graph for this function:

◆ moveDataDirectoryToContainer()

ilObjSAHSLearningModule::moveDataDirectoryToContainer ( )

Move the on-disk data directory into a new container resource and remove the directory.

Call AFTER readObject() — manifest parsing reads the files from disk. The zip keeps the directory structure but strips the top lm_<id> folder, so files end up at the container root.

Definition at line 459 of file class.ilObjSAHSLearningModule.php.

459 : bool
460 {
461 $dir = $this->getDataDirectory();
462 if (!is_dir($dir)) {
463 return false;
464 }
465 $zip = new Zip(
466 (new ZipOptions())
467 ->withDirectoryHandling(ZipDirectoryHandling::KEEP_STRUCTURE)
468 );
469 $zip->addDirectory($dir);
470 try {
471 $zip_stream = $zip->get();
472 } catch (\Throwable) {
473 $zip->destroy();
474 return false;
475 }
476 $rid = $this->getIrss()->manageContainer()->containerFromStream(
477 $zip_stream,
478 new ilSAHSStakeholder(),
479 $this->getTitle()
480 );
481 $zip->destroy();
482
483 $this->setRID($rid->serialize());
484 $this->update();
485
487 return true;
488 }
Stakeholder for SCORM/AICC learning module content (table sahs_lm).

References $rid, ilFileUtils\delDir(), getDataDirectory(), getIrss(), ilObject\getTitle(), setRID(), and update().

+ Here is the call graph for this function:

◆ populateByDirectoy()

ilObjSAHSLearningModule::populateByDirectoy ( string  $a_dir,
string  $a_filename = "" 
)

Populate by directory.

Add a filename to do a special check for ILIAS SCORM export files. If the corresponding directory is found within the passed directory path (i.e. "htlm_<id>") this subdirectory is used instead.

Exceptions

ILIAS\Filesystem\Exception\DirectoryNotFoundException

Exceptions

ILIAS\Filesystem\Exception\FileNotFoundException

Exceptions

ILIAS\Filesystem\Exception\IOException

Definition at line 1445 of file class.ilObjSAHSLearningModule.php.

1445 : void
1446 {
1447 /*preg_match("/.*sahs_([0-9]*)\.zip/", $a_filename, $match);
1448 if (is_dir($a_dir."/sahs_".$match[1]))
1449 {
1450 $a_dir = $a_dir."/sahs_".$match[1];
1451 }*/
1452 ilFileUtils::rCopy($a_dir, $this->getDataDirectory());
1454 }
static renameExecutables(string $a_dir)
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.

References getDataDirectory(), ilFileUtils\rCopy(), and ilFileUtils\renameExecutables().

+ Here is the call graph for this function:

◆ read()

ilObjSAHSLearningModule::read ( )

read object

Exceptions
ilObjectNotFoundException
ilObjectTypeMismatchException

Reimplemented from ilObject.

Definition at line 129 of file class.ilObjSAHSLearningModule.php.

129 : void
130 {
131 global $DIC;
132 $ilDB = $DIC->database();
133
134 parent::read();
135
136 $lm_set = $ilDB->queryF(
137 'SELECT * FROM sahs_lm WHERE id = %s',
138 array('integer'),
139 array($this->getId())
140 );
141
142 while ($lm_rec = $ilDB->fetchAssoc($lm_set)) {
143 $this->setAutoReviewChar((string) $lm_rec["auto_review"]);
144 $this->setAPIAdapterName((string) $lm_rec["api_adapter"]);
145 $this->setDefaultLessonMode((string) $lm_rec["default_lesson_mode"]);
146 $this->setAPIFunctionsPrefix((string) $lm_rec["api_func_prefix"]);
147 $this->setSubType((string) $lm_rec["c_type"]);
148 // $this->setEditable(false);
149 $this->setStyleSheetId((int) $lm_rec["stylesheet"]);
150 $this->setMaxAttempt((int) $lm_rec["max_attempt"]);
151 $this->setModuleVersion((int) $lm_rec["module_version"]);
152 $this->setAssignedGlossary((int) $lm_rec["glossary"]);
153 $this->setTries((int) $lm_rec["question_tries"]);
154 $this->setLocalization((string) $lm_rec["localization"]);
155 $this->setSession(ilUtil::yn2tf($lm_rec["unlimited_session"]));
156 $this->setNoMenu(ilUtil::yn2tf($lm_rec["no_menu"] ?? "n"));
157 $this->setHideNavig(ilUtil::yn2tf($lm_rec["hide_navig"]));
158 $this->setFourth_edition(ilUtil::yn2tf($lm_rec["fourth_edition"]));
159 $this->setSequencing(ilUtil::yn2tf($lm_rec["sequencing"]));
160 $this->setInteractions(ilUtil::yn2tf($lm_rec["interactions"]));
161 $this->setObjectives(ilUtil::yn2tf($lm_rec["objectives"]));
162 $this->setComments(ilUtil::yn2tf($lm_rec["comments"]));
163 $this->setTime_from_lms(ilUtil::yn2tf($lm_rec["time_from_lms"]));
164 $this->setDebug(ilUtil::yn2tf($lm_rec["debug"]));
165 // $this->setDebugPw($lm_rec["debugpw"]);
166 // $this->setSequencingExpertMode(bool $lm_rec["seq_exp_mode"]);
167 $this->setOpenMode((int) $lm_rec["open_mode"]);
168 $this->setWidth((int) $lm_rec["width"]);
169 $this->setHeight((int) $lm_rec["height"]);
170 $this->setAutoContinue(ilUtil::yn2tf($lm_rec["auto_continue"]));
171 $this->setAuto_last_visited(ilUtil::yn2tf($lm_rec["auto_last_visited"]));
172 $this->setCheck_values(ilUtil::yn2tf($lm_rec["check_values"]));
173 // $this->setOfflineMode(ilUtil::yn2tf($lm_rec["offline_mode"]));
174 $this->setAutoSuspend(ilUtil::yn2tf($lm_rec["auto_suspend"]));
175 $this->setIe_force_render(ilUtil::yn2tf($lm_rec["ie_force_render"]));
176 if ($lm_rec["mastery_score"] != null) {
177 $this->setMasteryScore((int) $lm_rec["mastery_score"]);
178 }
179 $this->setIdSetting((int) $lm_rec["id_setting"]);
180 $this->setNameSetting((int) $lm_rec["name_setting"]);
181 $this->setRID((string) ($lm_rec["rid"] ?? ''));
182 if (ilObject::_lookupType($this->getStyleSheetId()) !== "sty") {
183 $this->setStyleSheetId(0);
184 }
185 }
186 }
setAssignedGlossary(int $a_assigned_glossary)
setTries(int $a_tries)
Set default tries for questions.
setStyleSheetId(int $a_style_id)
set ID of assigned style sheet object
setAPIAdapterName(string $a_api)
set api adapter name
setAPIFunctionsPrefix(string $a_prefix)
set api functions prefix
getStyleSheetId()
get ID of assigned style sheet object

References $DIC, $ilDB, $lm_set, ilObject\_lookupType(), ilObject\getId(), getStyleSheetId(), setAPIAdapterName(), setAPIFunctionsPrefix(), setAssignedGlossary(), setAuto_last_visited(), setAutoContinue(), setAutoReviewChar(), setAutoSuspend(), setCheck_values(), setComments(), setDebug(), setDefaultLessonMode(), setFourth_edition(), setHeight(), setHideNavig(), setIdSetting(), setIe_force_render(), setInteractions(), setLocalization(), setMasteryScore(), setMaxAttempt(), setModuleVersion(), setNameSetting(), setNoMenu(), setObjectives(), setOpenMode(), setRID(), setSequencing(), setSession(), setStyleSheetId(), setSubType(), setTime_from_lms(), setTries(), setWidth(), and ilUtil\yn2tf().

+ Here is the call graph for this function:

◆ removeContainerResource()

ilObjSAHSLearningModule::removeContainerResource ( )

Definition at line 389 of file class.ilObjSAHSLearningModule.php.

389 : void
390 {
391 $resource = $this->getResource();
392 if ($resource === null) {
393 return;
394 }
395 $this->getIrss()->manage()->remove(
396 $resource->getIdentification(),
398 );
399 $this->setRID('');
400 }

References getIrss(), getResource(), and setRID().

Referenced by delete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ replaceContainerFromZipPath()

ilObjSAHSLearningModule::replaceContainerFromZipPath ( string  $absolute_zip_path,
?string  $revision_title = null 
)

Replace the content of the module's container resource with a new ZIP as a new revision (migrated modules only).

Returns false when the module is not migrated.

Definition at line 434 of file class.ilObjSAHSLearningModule.php.

434 : bool
435 {
436 $resource = $this->getResource();
437 if ($resource === null) {
438 return false;
439 }
440 $handle = fopen($absolute_zip_path, 'rb');
441 if ($handle === false) {
442 return false;
443 }
444 $this->getIrss()->manage()->appendNewRevisionFromStream(
445 $resource->getIdentification(),
446 FilesystemStreams::ofResource($handle),
447 new ilSAHSStakeholder(),
448 $revision_title ?? basename($absolute_zip_path)
449 );
450 return true;
451 }

References getIrss(), and getResource().

+ Here is the call graph for this function:

◆ setAPIAdapterName()

ilObjSAHSLearningModule::setAPIAdapterName ( string  $a_api)

set api adapter name

Definition at line 545 of file class.ilObjSAHSLearningModule.php.

545 : void
546 {
547 $this->api_adapter = $a_api;
548 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setAPIFunctionsPrefix()

ilObjSAHSLearningModule::setAPIFunctionsPrefix ( string  $a_prefix)

set api functions prefix

Definition at line 562 of file class.ilObjSAHSLearningModule.php.

562 : void
563 {
564 $this->api_func_prefix = $a_prefix;
565 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setAssignedGlossary()

ilObjSAHSLearningModule::setAssignedGlossary ( int  $a_assigned_glossary)

Definition at line 673 of file class.ilObjSAHSLearningModule.php.

673 : void
674 {
675 $this->assigned_glossary = $a_assigned_glossary;
676 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setAuto_last_visited()

ilObjSAHSLearningModule::setAuto_last_visited ( bool  $a_auto_last_visited)

Definition at line 898 of file class.ilObjSAHSLearningModule.php.

898 : void
899 {
900 $this->auto_last_visited = $a_auto_last_visited;
901 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setAutoContinue()

ilObjSAHSLearningModule::setAutoContinue ( bool  $a_auto_continue)

Definition at line 883 of file class.ilObjSAHSLearningModule.php.

883 : void
884 {
885 $this->auto_continue = $a_auto_continue;
886 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setAutoReview()

ilObjSAHSLearningModule::setAutoReview ( bool  $a_auto_review)

set auto review as true/false for SCORM 1.2

Definition at line 620 of file class.ilObjSAHSLearningModule.php.

620 : void
621 {
622 $this->auto_review = ilUtil::tf2yn($a_auto_review);
623 }
static tf2yn(bool $a_tf)

References ilUtil\tf2yn().

+ Here is the call graph for this function:

◆ setAutoReviewChar()

ilObjSAHSLearningModule::setAutoReviewChar ( ?string  $a_auto_review)

set auto review as Char for SCORM 2004

Definition at line 636 of file class.ilObjSAHSLearningModule.php.

636 : void
637 {
638 if ($a_auto_review == null) {
639 $this->auto_review = 'n';
640 } else {
641 $this->auto_review = $a_auto_review;
642 }
643 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setAutoSuspend()

ilObjSAHSLearningModule::setAutoSuspend ( bool  $a_auto_suspend)

Definition at line 924 of file class.ilObjSAHSLearningModule.php.

924 : void
925 {
926 $this->auto_suspend = $a_auto_suspend;
927 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setCheck_values()

ilObjSAHSLearningModule::setCheck_values ( bool  $a_check_values)

Definition at line 839 of file class.ilObjSAHSLearningModule.php.

839 : void
840 {
841 $this->check_values = $a_check_values;
842 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setComments()

ilObjSAHSLearningModule::setComments ( bool  $a_comments)

Definition at line 819 of file class.ilObjSAHSLearningModule.php.

819 : void
820 {
821 $this->comments = $a_comments;
822 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setDebug()

ilObjSAHSLearningModule::setDebug ( bool  $a_debug)

Definition at line 862 of file class.ilObjSAHSLearningModule.php.

862 : void
863 {
864 $this->debug = $a_debug;
865 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setDefaultLessonMode()

ilObjSAHSLearningModule::setDefaultLessonMode ( string  $a_lesson_mode)

set default lesson mode

Definition at line 584 of file class.ilObjSAHSLearningModule.php.

584 : void
585 {
586 $this->lesson_mode = $a_lesson_mode;
587 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setFourth_edition()

ilObjSAHSLearningModule::setFourth_edition ( bool  $a_fourth_edition)

Definition at line 779 of file class.ilObjSAHSLearningModule.php.

779 : void
780 {
781 $this->fourth_edition = $a_fourth_edition;
782 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setHeight()

ilObjSAHSLearningModule::setHeight ( int  $a_height)

Definition at line 969 of file class.ilObjSAHSLearningModule.php.

969 : void
970 {
971 $this->height = $a_height;
972 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setHideNavig()

ilObjSAHSLearningModule::setHideNavig ( bool  $a_hide_navig)

disable menu

Definition at line 720 of file class.ilObjSAHSLearningModule.php.

720 : void
721 {
722 $this->hide_navig = $a_hide_navig;
723 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setIdSetting()

ilObjSAHSLearningModule::setIdSetting ( int  $a_id_setting)

Definition at line 1029 of file class.ilObjSAHSLearningModule.php.

1029 : void
1030 {
1031 $this->id_setting = $a_id_setting;
1032 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setIe_force_render()

ilObjSAHSLearningModule::setIe_force_render ( bool  $a_ie_force_render)

Definition at line 766 of file class.ilObjSAHSLearningModule.php.

766 : void
767 {
768 $this->ie_force_render = $a_ie_force_render;
769 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setInteractions()

ilObjSAHSLearningModule::setInteractions ( bool  $a_interactions)

Definition at line 799 of file class.ilObjSAHSLearningModule.php.

799 : void
800 {
801 $this->interactions = $a_interactions;
802 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setLocalization()

ilObjSAHSLearningModule::setLocalization ( string  $a_val)

Definition at line 258 of file class.ilObjSAHSLearningModule.php.

258 : void
259 {
260 $this->localization = $a_val;
261 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMasteryScore()

ilObjSAHSLearningModule::setMasteryScore ( ?int  $a_mastery_score)

Definition at line 979 of file class.ilObjSAHSLearningModule.php.

979 : void
980 {
981 $this->mastery_score = $a_mastery_score;
982 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setMaxAttempt()

ilObjSAHSLearningModule::setMaxAttempt ( int  $a_max_attempt)

Definition at line 658 of file class.ilObjSAHSLearningModule.php.

658 : void
659 {
660 $this->max_attempt = $a_max_attempt;
661 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setModuleVersion()

ilObjSAHSLearningModule::setModuleVersion ( int  $a_module_version)

Definition at line 678 of file class.ilObjSAHSLearningModule.php.

678 : void
679 {
680 $this->module_version = $a_module_version;
681 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setNameSetting()

ilObjSAHSLearningModule::setNameSetting ( int  $a_name_setting)

Definition at line 1039 of file class.ilObjSAHSLearningModule.php.

1039 : void
1040 {
1041 $this->name_setting = $a_name_setting;
1042 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setNoMenu()

ilObjSAHSLearningModule::setNoMenu ( bool  $a_no_menu)

disable menu

Definition at line 704 of file class.ilObjSAHSLearningModule.php.

704 : void
705 {
706 $this->no_menu = $a_no_menu;
707 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setObjectives()

ilObjSAHSLearningModule::setObjectives ( bool  $a_objectives)

Definition at line 809 of file class.ilObjSAHSLearningModule.php.

809 : void
810 {
811 $this->objectives = $a_objectives;
812 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setOpenMode()

ilObjSAHSLearningModule::setOpenMode ( int  $a_open_mode)

Definition at line 949 of file class.ilObjSAHSLearningModule.php.

949 : void
950 {
951 $this->open_mode = $a_open_mode;
952 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setRID()

ilObjSAHSLearningModule::setRID ( ?string  $rid)

Definition at line 322 of file class.ilObjSAHSLearningModule.php.

322 : void
323 {
324 $this->rid = $rid;
325 }

References $rid.

Referenced by moveDataDirectoryToContainer(), read(), and removeContainerResource().

+ Here is the caller graph for this function:

◆ setSequencing()

ilObjSAHSLearningModule::setSequencing ( bool  $a_sequencing)

Definition at line 789 of file class.ilObjSAHSLearningModule.php.

789 : void
790 {
791 $this->sequencing = $a_sequencing;
792 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setSession()

ilObjSAHSLearningModule::setSession ( bool  $a_session)

Definition at line 688 of file class.ilObjSAHSLearningModule.php.

688 : void
689 {
690 $this->session = $a_session;
691 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setStyleSheetId()

ilObjSAHSLearningModule::setStyleSheetId ( int  $a_style_id)

set ID of assigned style sheet object

Definition at line 612 of file class.ilObjSAHSLearningModule.php.

612 : void
613 {
614 $this->style_id = $a_style_id;
615 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setSubType()

ilObjSAHSLearningModule::setSubType ( string  $a_sub_type)

Definition at line 1209 of file class.ilObjSAHSLearningModule.php.

1209 : void
1210 {
1211 $this->sub_type = $a_sub_type;
1212 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTime_from_lms()

ilObjSAHSLearningModule::setTime_from_lms ( bool  $a_time_from_lms)

Definition at line 829 of file class.ilObjSAHSLearningModule.php.

829 : void
830 {
831 $this->time_from_lms = $a_time_from_lms;
832 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ setTries()

ilObjSAHSLearningModule::setTries ( int  $a_tries)

Set default tries for questions.

Definition at line 248 of file class.ilObjSAHSLearningModule.php.

248 : void
249 {
250 $this->tries = $a_tries;
251 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setWidth()

ilObjSAHSLearningModule::setWidth ( int  $a_width)

Definition at line 959 of file class.ilObjSAHSLearningModule.php.

959 : void
960 {
961 $this->width = $a_width;
962 }

Referenced by adoptSettingsFrom(), and read().

+ Here is the caller graph for this function:

◆ update()

ilObjSAHSLearningModule::update ( )

Reimplemented from ilObject.

Definition at line 1044 of file class.ilObjSAHSLearningModule.php.

1044 : bool
1045 {
1046 global $DIC;
1047 $ilDB = $DIC->database();
1048
1049 $this->updateMetaData();
1050 parent::update();
1051
1052 $statement = $ilDB->manipulateF(
1053 '
1054 UPDATE sahs_lm
1055 SET api_adapter = %s,
1056 api_func_prefix = %s,
1057 auto_review = %s,
1058 default_lesson_mode = %s,
1059 c_type = %s,
1060 stylesheet = %s,
1061 editable = %s,
1062 max_attempt = %s,
1063 module_version = %s,
1064 credit = %s,
1065 glossary = %s,
1066 question_tries = %s,
1067 unlimited_session = %s,
1068 no_menu = %s,
1069 hide_navig = %s,
1070 fourth_edition =%s,
1071 sequencing = %s,
1072 interactions = %s,
1073 objectives = %s,
1074 comments = %s,
1075 time_from_lms = %s,
1076 debug = %s,
1077 localization = %s,
1078 seq_exp_mode = %s,
1079 open_mode = %s,
1080 width = %s,
1081 height = %s,
1082 auto_continue = %s,
1083 auto_last_visited = %s,
1084 check_values = %s,
1085 auto_suspend = %s,
1086 ie_force_render = %s,
1087 mastery_score = %s,
1088 id_setting = %s,
1089 name_setting = %s,
1090 rid = %s
1091 WHERE id = %s',
1092 array( 'text',
1093 'text',
1094 'text',
1095 'text',
1096 'text',
1097 'integer',
1098 'integer',
1099 'integer',
1100 'integer',
1101 'text',
1102 'integer',
1103 'integer',
1104 'text',
1105 'text',
1106 'text',
1107 'text',
1108 'text',
1109 'text',
1110 'text',
1111 'text',
1112 'text',
1113 'text',
1114 'text',
1115 'integer',
1116 'integer',
1117 'integer',
1118 'integer',
1119 'text',
1120 'text',
1121 'text',
1122 'text',
1123 'text',
1124 'integer',
1125 'integer',
1126 'integer',
1127 'text',
1128 'integer'
1129 ),
1130 array( $this->getAPIAdapterName(),
1131 $this->getAPIFunctionsPrefix(),
1132 $this->getAutoReviewChar(),
1133 $this->getDefaultLessonMode(),
1134 $this->getSubType(),
1135 $this->getStyleSheetId(),
1136 $this->getEditable(),
1137 $this->getMaxAttempt(),
1138 $this->getModuleVersion(),
1139 $this->getCreditMode(),
1140 $this->getAssignedGlossary(),
1141 $this->getTries(),
1142 ilUtil::tf2yn($this->getSession()),
1143 ilUtil::tf2yn($this->getNoMenu()),
1144 ilUtil::tf2yn($this->getHideNavig()),
1145 ilUtil::tf2yn($this->getFourth_edition()),
1146 ilUtil::tf2yn($this->getSequencing()),
1148 ilUtil::tf2yn($this->getObjectives()),
1149 ilUtil::tf2yn($this->getComments()),
1151 ilUtil::tf2yn($this->getDebug()),
1152 $this->getLocalization(),
1153 0,//$this->getSequencingExpertMode(),
1154 $this->getOpenMode(),
1155 $this->getWidth(),
1156 $this->getHeight(),
1160 ilUtil::tf2yn($this->getAutoSuspend()),
1162 $this->getMasteryScore(),
1163 $this->getIdSetting(),
1164 $this->getNameSetting(),
1165 $this->getRID() ?? '',
1166 $this->getId())
1167 );
1168
1169 return true;
1170 }
getAPIFunctionsPrefix()
get api functions prefix

References $DIC, $ilDB, getAPIAdapterName(), getAPIFunctionsPrefix(), getAssignedGlossary(), getAuto_last_visited(), getAutoContinue(), getAutoReviewChar(), getAutoSuspend(), getCheck_values(), getComments(), getCreditMode(), getDebug(), getDefaultLessonMode(), getEditable(), getHeight(), getHideNavig(), ilObject\getId(), getIdSetting(), getIe_force_render(), getInteractions(), getLocalization(), getMasteryScore(), getMaxAttempt(), getModuleVersion(), getNameSetting(), getNoMenu(), getObjectives(), getOpenMode(), getRID(), getSequencing(), getSession(), getStyleSheetId(), getSubType(), getTime_from_lms(), getTries(), getWidth(), ilUtil\tf2yn(), and ilObject\updateMetaData().

Referenced by moveDataDirectoryToContainer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeContentZip()

ilObjSAHSLearningModule::writeContentZip ( string  $target_zip_path)

Write the module content to $target_zip_path as a zip without the lm_<id> top directory (export "content.zip").

Sources from the container for migrated modules, otherwise from the on-disk data directory.

Definition at line 518 of file class.ilObjSAHSLearningModule.php.

518 : void
519 {
520 global $DIC;
521 $cleanup = false;
522 if ($this->hasContainerResource()) {
524 $cleanup = true;
525 }
526
527 $DIC->legacyArchives()->zip($this->getDataDirectory(), $target_zip_path, false);
528
529 if ($cleanup) {
531 }
532 }
extractContainerToDataDirectory()
Extract the current container revision back onto disk at getDataDirectory().
hasContainerResource()
True when the module's content lives in a Resource Storage container.

References $DIC, ilFileUtils\delDir(), extractContainerToDataDirectory(), getDataDirectory(), and hasContainerResource().

+ Here is the call graph for this function:

Field Documentation

◆ $api_adapter

string ilObjSAHSLearningModule::$api_adapter = 'API'
protected

Definition at line 78 of file class.ilObjSAHSLearningModule.php.

Referenced by getAPIAdapterName().

◆ $api_func_prefix

string ilObjSAHSLearningModule::$api_func_prefix = 'LMS'
private

Definition at line 42 of file class.ilObjSAHSLearningModule.php.

Referenced by getAPIFunctionsPrefix().

◆ $assigned_glossary

int ilObjSAHSLearningModule::$assigned_glossary = 0
private

Definition at line 48 of file class.ilObjSAHSLearningModule.php.

Referenced by getAssignedGlossary().

◆ $auto_continue

bool ilObjSAHSLearningModule::$auto_continue = false
private

Definition at line 60 of file class.ilObjSAHSLearningModule.php.

Referenced by getAutoContinue().

◆ $auto_last_visited

bool ilObjSAHSLearningModule::$auto_last_visited = true
private

Definition at line 61 of file class.ilObjSAHSLearningModule.php.

Referenced by getAuto_last_visited().

◆ $auto_review

string ilObjSAHSLearningModule::$auto_review = 'n'
private

Definition at line 45 of file class.ilObjSAHSLearningModule.php.

Referenced by getAutoReviewChar().

◆ $auto_suspend

bool ilObjSAHSLearningModule::$auto_suspend = false
private

Definition at line 62 of file class.ilObjSAHSLearningModule.php.

Referenced by getAutoSuspend().

◆ $check_values

bool ilObjSAHSLearningModule::$check_values = true
private

Definition at line 58 of file class.ilObjSAHSLearningModule.php.

Referenced by getCheck_values().

◆ $comments

bool ilObjSAHSLearningModule::$comments = true
private

Definition at line 56 of file class.ilObjSAHSLearningModule.php.

Referenced by getComments().

◆ $debug

bool ilObjSAHSLearningModule::$debug = false
private

Definition at line 59 of file class.ilObjSAHSLearningModule.php.

Referenced by getDebug().

◆ $fourth_edition

bool ilObjSAHSLearningModule::$fourth_edition = false
private

Definition at line 53 of file class.ilObjSAHSLearningModule.php.

Referenced by getFourth_Edition().

◆ $height

int ilObjSAHSLearningModule::$height = 650
private

Definition at line 65 of file class.ilObjSAHSLearningModule.php.

Referenced by getHeight(), and getViewButton().

◆ $hide_navig

bool ilObjSAHSLearningModule::$hide_navig = false
private

Definition at line 51 of file class.ilObjSAHSLearningModule.php.

Referenced by getHideNavig().

◆ $id_setting

int ilObjSAHSLearningModule::$id_setting = 0
private

Definition at line 67 of file class.ilObjSAHSLearningModule.php.

Referenced by getIdSetting().

◆ $ie_force_render

bool ilObjSAHSLearningModule::$ie_force_render = false
private

Definition at line 52 of file class.ilObjSAHSLearningModule.php.

Referenced by getIe_force_render().

◆ $interactions

bool ilObjSAHSLearningModule::$interactions = true
private

Definition at line 54 of file class.ilObjSAHSLearningModule.php.

Referenced by getInteractions().

◆ $lesson_mode

string ilObjSAHSLearningModule::$lesson_mode = 'normal'
private

Definition at line 43 of file class.ilObjSAHSLearningModule.php.

Referenced by getDefaultLessonMode().

◆ $localization

string ilObjSAHSLearningModule::$localization = ""
protected

Definition at line 72 of file class.ilObjSAHSLearningModule.php.

Referenced by getLocalization().

◆ $mastery_score

int ilObjSAHSLearningModule::$mastery_score = null
private

Definition at line 66 of file class.ilObjSAHSLearningModule.php.

Referenced by getMasteryScore().

◆ $mastery_score_values

string ilObjSAHSLearningModule::$mastery_score_values = ""
protected

Definition at line 74 of file class.ilObjSAHSLearningModule.php.

Referenced by getMasteryScoreValues().

◆ $max_attempt

int ilObjSAHSLearningModule::$max_attempt = 0
private

Definition at line 46 of file class.ilObjSAHSLearningModule.php.

Referenced by getMaxAttempt().

◆ $module_version

int ilObjSAHSLearningModule::$module_version = 1
private

Definition at line 47 of file class.ilObjSAHSLearningModule.php.

Referenced by getModuleVersion().

◆ $name_setting

int ilObjSAHSLearningModule::$name_setting = 0
private

Definition at line 68 of file class.ilObjSAHSLearningModule.php.

Referenced by getNameSetting().

◆ $no_menu

bool ilObjSAHSLearningModule::$no_menu = false
private

Definition at line 50 of file class.ilObjSAHSLearningModule.php.

Referenced by getNoMenu().

◆ $objectives

bool ilObjSAHSLearningModule::$objectives = true
private

Definition at line 55 of file class.ilObjSAHSLearningModule.php.

Referenced by getObjectives().

◆ $open_mode

int ilObjSAHSLearningModule::$open_mode = 0
private

Definition at line 63 of file class.ilObjSAHSLearningModule.php.

Referenced by getOpenMode().

◆ $rid

string ilObjSAHSLearningModule::$rid = null
protected

◆ $sequencing

bool ilObjSAHSLearningModule::$sequencing = false
protected

Definition at line 70 of file class.ilObjSAHSLearningModule.php.

Referenced by getSequencing().

◆ $session

bool ilObjSAHSLearningModule::$session = false
private

Definition at line 49 of file class.ilObjSAHSLearningModule.php.

Referenced by getSession().

◆ $style_id

int ilObjSAHSLearningModule::$style_id = 0
private

Definition at line 44 of file class.ilObjSAHSLearningModule.php.

Referenced by getStyleSheetId().

◆ $sub_type

string ilObjSAHSLearningModule::$sub_type = 'scorm'
private

Definition at line 69 of file class.ilObjSAHSLearningModule.php.

Referenced by adoptSettingsFrom(), and getSubType().

◆ $time_from_lms

bool ilObjSAHSLearningModule::$time_from_lms = false
private

Definition at line 57 of file class.ilObjSAHSLearningModule.php.

Referenced by getTime_from_lms().

◆ $tries

int ilObjSAHSLearningModule::$tries = 0
protected

Definition at line 76 of file class.ilObjSAHSLearningModule.php.

Referenced by getTries().

◆ $ui

ILIAS DI UIServices ilObjSAHSLearningModule::$ui
protected

Definition at line 80 of file class.ilObjSAHSLearningModule.php.

◆ $width

int ilObjSAHSLearningModule::$width = 950
private

Definition at line 64 of file class.ilObjSAHSLearningModule.php.

Referenced by getViewButton(), and getWidth().


The documentation for this class was generated from the following file: