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

Class ilObjSCORMLearningModule. More...

+ Inheritance diagram for ilObjSCORMLearningModule:
+ Collaboration diagram for ilObjSCORMLearningModule:

Public Member Functions

 __construct (int $a_id=0, bool $a_call_by_reference=true)
 Constructor. More...
 
 getTrackingItems ()
 
 readObject ()
 read manifest file More...
 
 setLearningProgressSettingsAtUpload ()
 set settings for learning progress determination per default at upload More...
 
 getTrackedItems ()
 get all tracked items of current user More...
 
 getTrackedUsers (array $filters=[])
 
 getAttemptsForUsers ()
 Get attempts for all users. More...
 
 getAttemptsForUser (int $a_user_id)
 get number of attempts for a certain user and package More...
 
 getModuleVersionForUsers ()
 Get module version for users. More...
 
 getModuleVersionForUser (int $a_user_id)
 get module version that tracking data for a user was recorded on More...
 
 getTrackingDataPerUser (int $a_sco_id, int $a_user_id)
 Get tracking data per user. More...
 
 getTrackingDataAgg (int $a_user_id)
 
 getTrackingDataAggSco (int $a_sco_id)
 
 exportSelected (bool $a_all, array $a_users=array())
 Export selected user tracking data @global ilObjUser $ilUser. More...
 
 importTrackingData (string $a_file)
 
 importSuccess (string $a_file)
 
 importSuccessForSahsUser (int $user_id, ?DateTimeImmutable $last_access, int $status, ?int $attempts=null, ?int $percentage_completed=null, ?int $sco_total_time_sec=null)
 
 get_user_id (string $a_login)
 
 getUserIdEmail (string $a_mail)
 assumes that only one account exists for a mailadress More...
 
 sendExportFile (string $a_header, string $a_content)
 send export file to browser More...
 
 getAllScoIds ()
 
 getStatusForUser (int $a_user, array $a_allScoIds, bool $a_numerical=false)
 
 getCourseCompletionForUser (int $a_user)
 
 getLastVisited (int $user_id)
 
 deleteTrackingDataOfUsers (array $a_users)
 
- Public Member Functions inherited from ilObjSAHSLearningModule
 __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 _getTrackingItems (int $a_obj_id)
 get all tracking items of scorm object More...
 
static _getAllScoIds (int $a_id)
 Get an array of id's for all Sco's in the module. More...
 
static _getStatusForUser (int $a_id, int $a_user, array $a_allScoIds, bool $a_numerical=false)
 Get the status of a SCORM module for a given user. More...
 
static _getCourseCompletionForUser (int $a_id, int $a_user)
 Get the completion of a SCORM module for a given user. More...
 
static _removeTrackingDataForUser (int $user_id)
 to be called from IlObjUser More...
 
static _getScoresForUser (int $a_item_id, int $a_user_id)
 
- Static Public Member Functions inherited from ilObjSAHSLearningModule
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

 kindlyToDateTime (string $format, string $maybe_datetime, ?DateTimeImmutable $default=null)
 
- Protected Member Functions inherited from ilObjSAHSLearningModule
 getIrss ()
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Private Member Functions

 parseUserId (string $il_id)
 Parse il_usr_123_6 id. More...
 
 importRaw (string $a_file)
 Import raw data. More...
 
 lookupSCOId (string $a_referrer)
 resolves manifest SCOID to internal ILIAS SCO ID More...
 

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
 
- Protected Attributes inherited from ilObjSAHSLearningModule
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
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjSCORMLearningModule::__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 from ilObjSAHSLearningModule.

Reimplemented in ilObjSCORM2004LearningModule.

Definition at line 36 of file class.ilObjSCORMLearningModule.php.

37 {
38 $this->type = "sahs";
39 parent::__construct($a_id, $a_call_by_reference);
40 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getAllScoIds()

static ilObjSCORMLearningModule::_getAllScoIds ( int  $a_id)
static

Get an array of id's for all Sco's in the module.

Parameters
int$a_idObject id
Returns
array Sco id's

Definition at line 1070 of file class.ilObjSCORMLearningModule.php.

1070 : array
1071 {
1072 global $DIC;
1073 $ilDB = $DIC->database();
1074
1075 $scos = array();
1076
1077 $val_set = $ilDB->queryF(
1078 '
1079 SELECT scorm_object.obj_id,
1080 scorm_object.title,
1081 scorm_object.c_type,
1082 scorm_object.slm_id,
1083 scorm_object.obj_id scoid
1084 FROM scorm_object,sc_item,sc_resource
1085 WHERE(scorm_object.slm_id = %s
1086 AND scorm_object.obj_id = sc_item.obj_id
1087 AND sc_item.identifierref = sc_resource.import_id
1088 AND sc_resource.scormtype = %s)
1089 GROUP BY scorm_object.obj_id,
1090 scorm_object.title,
1091 scorm_object.c_type,
1092 scorm_object.slm_id,
1093 scorm_object.obj_id ',
1094 array('integer', 'text'),
1095 array($a_id,'sco')
1096 );
1097
1098 while ($val_rec = $ilDB->fetchAssoc($val_set)) {
1099 $scos[] = $val_rec['scoid'];
1100 }
1101 return $scos;
1102 }
global $DIC
Definition: shib_login.php:26

References $DIC, and $ilDB.

Referenced by _getCourseCompletionForUser().

+ Here is the caller graph for this function:

◆ _getCourseCompletionForUser()

static ilObjSCORMLearningModule::_getCourseCompletionForUser ( int  $a_id,
int  $a_user 
)
static

Get the completion of a SCORM module for a given user.

Parameters
int$a_idObject id
int$a_userUser id
Returns
string Completion status

Reimplemented in ilObjSCORM2004LearningModule.

Definition at line 1154 of file class.ilObjSCORMLearningModule.php.

1154 : bool
1155 {
1157 }
static _getStatusForUser(int $a_id, int $a_user, array $a_allScoIds, bool $a_numerical=false)
Get the status of a SCORM module for a given user.
static _getAllScoIds(int $a_id)
Get an array of id's for all Sco's in the module.

References _getAllScoIds(), and _getStatusForUser().

+ Here is the call graph for this function:

◆ _getScoresForUser()

static ilObjSCORMLearningModule::_getScoresForUser ( int  $a_item_id,
int  $a_user_id 
)
static

Definition at line 1254 of file class.ilObjSCORMLearningModule.php.

1254 : array
1255 {
1256 global $DIC;
1257 $ilDB = $DIC->database();
1258
1259 $retAr = array("raw" => null, "max" => null, "scaled" => null);
1260 $val_set = $ilDB->queryF(
1261 "
1262 SELECT lvalue, rvalue FROM scorm_tracking
1263 WHERE sco_id = %s
1264 AND user_id = %s
1265 AND (lvalue = 'cmi.core.score.raw' OR lvalue = 'cmi.core.score.max')",
1266 array('integer', 'integer'),
1267 array($a_item_id, $a_user_id)
1268 );
1269 while ($val_rec = $ilDB->fetchAssoc($val_set)) {
1270 if ($val_rec['lvalue'] === "cmi.core.score.raw") {
1271 $retAr["raw"] = $val_rec["rvalue"];
1272 }
1273 if ($val_rec['lvalue'] === "cmi.core.score.max") {
1274 $retAr["max"] = $val_rec["rvalue"];
1275 }
1276 }
1277 if ($retAr["raw"] != null && $retAr["max"] != null) {
1278 $retAr["scaled"] = ($retAr["raw"] / $retAr["max"]);
1279 }
1280
1281 return $retAr;
1282 }

References $DIC, and $ilDB.

Referenced by ilLPCollectionOfSCOs\getScoresForUserAndCP_Node_Id().

+ Here is the caller graph for this function:

◆ _getStatusForUser()

static ilObjSCORMLearningModule::_getStatusForUser ( int  $a_id,
int  $a_user,
array  $a_allScoIds,
bool  $a_numerical = false 
)
static

Get the status of a SCORM module for a given user.

Parameters
int$a_idObject id
int$a_userUser id
array$a_allScoIdsArray of Sco id's in this module
boolean$a_numericalText (false) or boolean result (true)
Returns
bool Status result

Definition at line 1112 of file class.ilObjSCORMLearningModule.php.

1112 : bool
1113 {
1114 global $DIC;
1115 $ilDB = $DIC->database();
1116 $lng = $DIC->language();
1117
1118 $scos = $a_allScoIds;
1119 //check if all SCO's are completed
1120 $scos_c = implode(',', $scos);
1121
1122 $val_set = $ilDB->queryF(
1123 '
1124 SELECT * FROM scorm_tracking
1125 WHERE (user_id = %s
1126 AND obj_id = %s
1127 AND ' . $ilDB->in('sco_id', $scos, false, 'integer') . '
1128 AND ((lvalue = %s AND ' . $ilDB->like('rvalue', 'clob', 'completed') . ')
1129 OR (lvalue = %s AND ' . $ilDB->like('rvalue', 'clob', 'passed') . ')))',
1130 array('integer','integer','text','text'),
1131 array($a_user,$a_id,'cmi.core.lesson_status', 'cmi.core.lesson_status')
1132 );
1133 while ($val_rec = $ilDB->fetchAssoc($val_set)) {
1134 $key = array_search($val_rec['sco_id'], $scos);
1135 unset($scos[$key]);
1136 }
1137 $completion = false;
1138 //check for completion
1139 if (count($scos) == 0) {
1140 $completion = ($a_numerical === true) ? true : $lng->txt("cont_complete");
1141 }
1142 if (count($scos) > 0) {
1143 $completion = ($a_numerical === true) ? false : $lng->txt("cont_incomplete");
1144 }
1145 return $completion;
1146 }
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...
ilLanguage $lng

References $DIC, $ilDB, and $lng.

Referenced by _getCourseCompletionForUser().

+ Here is the caller graph for this function:

◆ _getTrackingItems()

static ilObjSCORMLearningModule::_getTrackingItems ( int  $a_obj_id)
static

get all tracking items of scorm object

Reimplemented in ilObjSCORM2004LearningModule.

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

50 : array
51 {
52 $tree = new ilSCORMTree($a_obj_id);
53 $root_id = $tree->readRootId();
54
55 $items = array();
56 $childs = $tree->getSubTree($tree->getNodeData($root_id));
57
58 foreach ($childs as $child) {
59 if ($child["c_type"] === "sit") {
60 $sc_item = new ilSCORMItem((int) $child["obj_id"]);
61 if ($sc_item->getIdentifierRef() != "") {
62 $items[] = $sc_item;
63 }
64 }
65 }
66
67 return $items;
68 }
ilTree $tree
SCORM Object Tree.
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node

References ilObject\$tree, ilTree\getNodeData(), ilTree\getSubTree(), and ilTree\readRootId().

Referenced by ilLPCollectionOfSCOs\getPossibleItems(), and getTrackingItems().

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

◆ _removeTrackingDataForUser()

static ilObjSCORMLearningModule::_removeTrackingDataForUser ( int  $user_id)
static

to be called from IlObjUser

Definition at line 1237 of file class.ilObjSCORMLearningModule.php.

1237 : void
1238 {
1239 global $DIC;
1240 $ilDB = $DIC->database();
1241 //gobjective
1242 $ilDB->manipulateF(
1243 'DELETE FROM scorm_tracking WHERE user_id = %s',
1244 array('integer'),
1245 array($user_id)
1246 );
1247 $ilDB->manipulateF(
1248 'DELETE FROM sahs_user WHERE user_id = %s',
1249 array('integer'),
1250 array($user_id)
1251 );
1252 }

References $DIC, $ilDB, and $user_id.

◆ deleteTrackingDataOfUsers()

ilObjSCORMLearningModule::deleteTrackingDataOfUsers ( array  $a_users)

Reimplemented in ilObjSCORM2004LearningModule.

Definition at line 1301 of file class.ilObjSCORMLearningModule.php.

1301 : void
1302 {
1303 global $DIC;
1304 $ilDB = $DIC->database();
1305
1307
1308 foreach ($a_users as $usr) {
1309 $user = (int) $usr;
1310 $ilDB->manipulateF(
1311 '
1312 DELETE FROM scorm_tracking
1313 WHERE user_id = %s
1314 AND obj_id = %s',
1315 array('integer', 'integer'),
1316 array($user, $this->getID())
1317 );
1318
1319 $ilDB->manipulateF(
1320 '
1321 DELETE FROM sahs_user
1322 WHERE user_id = %s
1323 AND obj_id = %s',
1324 array('integer', 'integer'),
1325 array($user, $this->getID())
1326 );
1327
1329 }
1330 }
static _deleteReadEventsForUsers(int $a_obj_id, array $a_user_ids)
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
ilObjUser $user

References $DIC, $ilDB, ilChangeEvent\_deleteReadEventsForUsers(), ilLPStatusWrapper\_updateStatus(), ILIAS\Survey\Mode\getId(), and ILIAS\Repository\int().

Referenced by importSuccess().

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

◆ exportSelected()

ilObjSCORMLearningModule::exportSelected ( bool  $a_all,
array  $a_users = array() 
)

Export selected user tracking data @global ilObjUser $ilUser.

Definition at line 530 of file class.ilObjSCORMLearningModule.php.

530 : void
531 {
532 global $DIC;
533 $ilDB = $DIC->database();
534 $ilUser = $DIC->user();
536 $allowExportPrivacy = $privacy->enabledExportSCORM();
537
538 $csv = "";
539 $query = 'SELECT * FROM sahs_user WHERE obj_id = %s';
540 if (count($a_users) > 0) {
541 $query .= ' AND ' . $ilDB->in('user_id', $a_users, false, 'integer');
542 }
543 $res = $ilDB->queryF(
544 $query,
545 array('integer'),
546 array($this->getId())
547 );
548 while ($data = $ilDB->fetchAssoc($res)) {
549 $csv = $csv . $data["obj_id"]
550 . ";\"" . $this->getTitle() . "\""
551 . ";" . $data["module_version"]
552 . ";\"" . implode("\";\"", ilSCORMTrackingItems::userDataArrayForExport((int) $data["user_id"], $allowExportPrivacy)) . "\""
553 . ";\"" . $data["last_access"] . "\""
554 . ";\"" . ilLearningProgressBaseGUI::__readStatus((int) $data["obj_id"], (int) $data["user_id"]) . "\"" //not $data["status"] because modifications to learning progress could have made before export
555 . ";" . $data["package_attempts"]
556 . ";" . $data["percentage_completed"]
557 . ";" . $data["sco_total_time_sec"]
558// . ";\"" . $certificateDate ."\""
559 . "\n";
560 }
562 $header = "LearningModuleId;LearningModuleTitle;LearningModuleVersion;" . str_replace(',', ';', $udh["cols"]) . ";"
563 . "LastAccess;Status;Attempts;percentageCompletedSCOs;SumTotal_timeSeconds\n";
564
565 $this->sendExportFile($header, $csv);
566 }
static __readStatus(int $a_obj_id, int $user_id)
@noinspection PhpInconsistentReturnPointsInspection
sendExportFile(string $a_header, string $a_content)
send export file to browser
static userDataArrayForExport(int $user, bool $b_allowExportPrivacy=false)
foreach($_POST as $key=> $value) $res
$data
Definition: storeScorm.php:45

References $data, $DIC, $ilDB, $res, ilLearningProgressBaseGUI\__readStatus(), ilObject\getId(), ilPrivacySettings\getInstance(), ilObject\getTitle(), sendExportFile(), ilSCORMTrackingItems\userDataArrayForExport(), and ilSCORMTrackingItems\userDataHeaderForExport().

+ Here is the call graph for this function:

◆ get_user_id()

ilObjSCORMLearningModule::get_user_id ( string  $a_login)

Definition at line 984 of file class.ilObjSCORMLearningModule.php.

984 : ?int
985 {
986 global $DIC;
987 $ilDB = $DIC->database();
988 $ilUser = $DIC->user();
989
990 $val_set = $ilDB->queryF(
991 'SELECT * FROM usr_data WHERE(login=%s)',
992 array('text'),
993 array($a_login)
994 );
995 $val_rec = $ilDB->fetchAssoc($val_set);
996
997 if (count($val_rec) > 0) {
998 return (int) $val_rec['usr_id'];
999 }
1000
1001 return null;
1002 }

References $DIC, and $ilDB.

Referenced by ilObjSCORM2004LearningModule\importSuccess(), and importSuccess().

+ Here is the caller graph for this function:

◆ getAllScoIds()

ilObjSCORMLearningModule::getAllScoIds ( )
Returns
array

Definition at line 1162 of file class.ilObjSCORMLearningModule.php.

1162 : array
1163 {
1164 global $DIC;
1165 $ilDB = $DIC->database();
1166
1167 $scos = array();
1168 //get all SCO's of this object
1169 $val_set = $ilDB->queryF(
1170 '
1171 SELECT scorm_object.obj_id,
1172 scorm_object.title,
1173 scorm_object.c_type,
1174 scorm_object.slm_id,
1175 scorm_object.obj_id scoid
1176 FROM scorm_object, sc_item,sc_resource
1177 WHERE(scorm_object.slm_id = %s
1178 AND scorm_object.obj_id = sc_item.obj_id
1179 AND sc_item.identifierref = sc_resource.import_id
1180 AND sc_resource.scormtype = %s )
1181 GROUP BY scorm_object.obj_id,
1182 scorm_object.title,
1183 scorm_object.c_type,
1184 scorm_object.slm_id,
1185 scorm_object.obj_id',
1186 array('integer','text'),
1187 array($this->getId(),'sco')
1188 );
1189
1190 while ($val_rec = $ilDB->fetchAssoc($val_set)) {
1191 $scos[] = $val_rec['scoid'];
1192 }
1193 return $scos;
1194 }

References $DIC, $ilDB, and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ getAttemptsForUser()

ilObjSCORMLearningModule::getAttemptsForUser ( int  $a_user_id)

get number of attempts for a certain user and package

Reimplemented in ilObjSCORM2004LearningModule.

Definition at line 321 of file class.ilObjSCORMLearningModule.php.

321 : int
322 {
323 global $DIC;
324 $ilDB = $DIC->database();
325 $val_set = $ilDB->queryF(
326 'SELECT package_attempts FROM sahs_user WHERE obj_id = %s AND user_id = %s',
327 array('integer','integer'),
328 array($this->getId(),$a_user_id)
329 );
330
331 $val_rec = $ilDB->fetchAssoc($val_set);
332
333 if ($val_rec["package_attempts"] == null) {
334 $val_rec["package_attempts"] = 0;
335 }
336 return (int) $val_rec["package_attempts"];
337 }

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

+ Here is the call graph for this function:

◆ getAttemptsForUsers()

ilObjSCORMLearningModule::getAttemptsForUsers ( )

Get attempts for all users.

Returns
int[]

Definition at line 302 of file class.ilObjSCORMLearningModule.php.

302 : array
303 {
304 global $DIC;
305 $ilDB = $DIC->database();
306 $query = 'SELECT user_id, package_attempts FROM sahs_user WHERE obj_id = ' . $ilDB->quote($this->getId(), 'integer') . ' ';
307 $res = $ilDB->query($query);
308
309 $attempts = array();
310 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
311 $attempts[$row['user_id']] = (int) $row['package_attempts'];
312 }
313 return $attempts;
314 }
const FETCHMODE_ASSOC

References $DIC, $ilDB, $res, ilDBConstants\FETCHMODE_ASSOC, ilObject\getId(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ getCourseCompletionForUser()

ilObjSCORMLearningModule::getCourseCompletionForUser ( int  $a_user)

Definition at line 1229 of file class.ilObjSCORMLearningModule.php.

1229 : bool
1230 {
1231 return $this->getStatusForUser($a_user, $this->getAllScoIds(), true);
1232 }
getStatusForUser(int $a_user, array $a_allScoIds, bool $a_numerical=false)

◆ getLastVisited()

ilObjSCORMLearningModule::getLastVisited ( int  $user_id)

Definition at line 1284 of file class.ilObjSCORMLearningModule.php.

1284 : string
1285 {
1286 global $DIC;
1287 $ilDB = $DIC->database();
1288 $val_set = $ilDB->queryF(
1289 'SELECT last_visited FROM sahs_user WHERE obj_id = %s AND user_id = %s',
1290 array('integer','integer'),
1291 array($this->getID(),$user_id)
1292 );
1293 while ($val_rec = $ilDB->fetchAssoc($val_set)) {
1294 if ($val_rec["last_visited"] != null) {
1295 return "" . $val_rec["last_visited"];
1296 }
1297 }
1298 return '0';
1299 }

References $DIC, $ilDB, and $user_id.

Referenced by ilObjSCORMInitData\getIliasScormVars().

+ Here is the caller graph for this function:

◆ getModuleVersionForUser()

ilObjSCORMLearningModule::getModuleVersionForUser ( int  $a_user_id)

get module version that tracking data for a user was recorded on

Reimplemented in ilObjSCORM2004LearningModule.

Definition at line 359 of file class.ilObjSCORMLearningModule.php.

359 : string
360 {
361 global $DIC;
362 $ilDB = $DIC->database();
363 $val_set = $ilDB->queryF(
364 'SELECT module_version FROM sahs_user WHERE obj_id = %s AND user_id = %s',
365 array('integer','integer'),
366 array($this->getId(),$a_user_id,0)
367 );
368
369 $val_rec = $ilDB->fetchAssoc($val_set);
370
371 if ($val_rec["module_version"] == null) {
372 $val_rec["module_version"] = "";
373 }
374 return $val_rec["module_version"];
375 }

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

+ Here is the call graph for this function:

◆ getModuleVersionForUsers()

ilObjSCORMLearningModule::getModuleVersionForUsers ( )

Get module version for users.

Definition at line 342 of file class.ilObjSCORMLearningModule.php.

342 : array
343 {
344 global $DIC;
345 $ilDB = $DIC->database();
346 $query = 'SELECT user_id, module_version FROM sahs_user WHERE obj_id = ' . $ilDB->quote($this->getId(), 'integer') . ' ';
347 $res = $ilDB->query($query);
348
349 $versions = array();
350 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
351 $versions[$row['user_id']] = (int) $row['module_version'];
352 }
353 return $versions;
354 }

References $DIC, $ilDB, $res, ilDBConstants\FETCHMODE_ASSOC, ilObject\getId(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ getStatusForUser()

ilObjSCORMLearningModule::getStatusForUser ( int  $a_user,
array  $a_allScoIds,
bool  $a_numerical = false 
)

Definition at line 1196 of file class.ilObjSCORMLearningModule.php.

1196 : bool
1197 {
1198 global $DIC;
1199 $ilDB = $DIC->database();
1200 $scos = $a_allScoIds;
1201 //loook up status
1202 //check if all SCO's are completed
1203 $scos_c = implode(',', $scos);
1204
1205 $val_set = $ilDB->queryF(
1206 '
1207 SELECT sco_id FROM scorm_tracking
1208 WHERE (user_id = %s
1209 AND obj_id = %s
1210 AND ' . $ilDB->in('sco_id', $scos, false, 'integer') . '
1211 AND ((lvalue = %s AND ' . $ilDB->like('rvalue', 'clob', 'completed') . ') OR (lvalue = %s AND ' . $ilDB->like('rvalue', 'clob', 'passed') . ') ) )',
1212 array('integer','integer','text','text',),
1213 array($a_user,$this->getID(),'cmi.core.lesson_status','cmi.core.lesson_status')
1214 );
1215 while ($val_rec = $ilDB->fetchAssoc($val_set)) {
1216 $key = array_search($val_rec['sco_id'], $scos);
1217 unset($scos[$key]);
1218 }
1219 //check for completion
1220 if (count($scos) == 0) {
1221 $completion = ($a_numerical === true) ? true : $this->lng->txt("cont_complete");
1222 }
1223 if (count($scos) > 0) {
1224 $completion = ($a_numerical === true) ? false : $this->lng->txt("cont_incomplete");
1225 }
1226 return $completion;
1227 }

References $DIC, $ilDB, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getTrackedItems()

ilObjSCORMLearningModule::getTrackedItems ( )

get all tracked items of current user

Reimplemented in ilObjSCORM2004LearningModule.

Definition at line 206 of file class.ilObjSCORMLearningModule.php.

206 : array
207 {
208 global $DIC;
209 $ilDB = $DIC->database();
210 $ilUser = $DIC->user();
211
212 $sco_set = $ilDB->queryF(
213 '
214 SELECT DISTINCT sco_id FROM scorm_tracking WHERE obj_id = %s',
215 array('integer'),
216 array($this->getId())
217 );
218
219 $items = array();
220 while ($sco_rec = $ilDB->fetchAssoc($sco_set)) {
221 $sc_item = new ilSCORMItem((int) $sco_rec["sco_id"]);
222 if ($sc_item->getIdentifierRef() != "") {
223 $items[] = $sc_item;
224 }
225 }
226
227 return $items;
228 }

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

+ Here is the call graph for this function:

◆ getTrackedUsers()

ilObjSCORMLearningModule::getTrackedUsers ( array  $filters = [])

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

258 : array
259 {
260 global $DIC;
261 $ilDB = $DIC->database();
262 // NOTE: `sahs_user.last_access` is only refreshed on attempt init / commit / unload;
263 // if a SCO skips commit/unload, this value may be older than the user's actual last interaction.
264 $where = [
265 'su.obj_id = ' . $ilDB->quote($this->getId(), ilDBConstants::T_INTEGER)
266 ];
267
268 $text_filter_columns = [
269 'lastname_filter' => 'ud.lastname',
270 'firstname_filter' => 'ud.firstname',
271 'login_filter' => 'ud.login',
272 'email_filter' => 'ud.email',
273 ];
274
275 foreach ($text_filter_columns as $filter_key => $column) {
276 $value = trim((string) ($filters[$filter_key] ?? ''));
277 if ($value === '') {
278 continue;
279 }
280 $where[] = $ilDB->like($column, ilDBConstants::T_TEXT, '%' . $value . '%');
281 }
282
283 $query = 'SELECT su.user_id, su.last_access, ud.lastname, ud.firstname, ud.login, ud.email FROM sahs_user su '
284 . 'JOIN usr_data ud ON su.user_id = ud.usr_id '
285 . 'WHERE ' . implode(' AND ', $where)
286 . ' GROUP BY su.user_id, su.last_access, ud.lastname, ud.firstname, ud.login, ud.email';
287 $sco_set = $ilDB->query($query);
288
289 $items = [];
290 while ($sco_rec = $ilDB->fetchAssoc($sco_set)) {
291 $items[] = $sco_rec;
292 }
293 return $items;
294 }

References $DIC, $ilDB, ilObject\getId(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

+ Here is the call graph for this function:

◆ getTrackingDataAgg()

ilObjSCORMLearningModule::getTrackingDataAgg ( int  $a_user_id)

Definition at line 404 of file class.ilObjSCORMLearningModule.php.

404 : array
405 {
406 global $DIC;
407 $ilDB = $DIC->database();
408
409 // get all users with any tracking data
410 $sco_set = $ilDB->queryF(
411 '
412 SELECT DISTINCT sco_id FROM scorm_tracking
413 WHERE obj_id = %s
414 AND user_id = %s
415 AND sco_id <> %s',
416 array('integer','integer','integer'),
417 array($this->getId(),$a_user_id,0)
418 );
419
420 $data = array();
421 while ($sco_rec = $ilDB->fetchAssoc($sco_set)) {
422 $data_set = $ilDB->queryF(
423 '
424 SELECT * FROM scorm_tracking
425 WHERE obj_id = %s
426 AND sco_id = %s
427 AND user_id = %s
428 AND lvalue <> %s
429 AND (lvalue = %s
430 OR lvalue = %s
431 OR lvalue = %s)',
432 array('integer','integer','integer','text','text','text','text'),
433 array($this->getId(),
434 $sco_rec["sco_id"],
435 $a_user_id,
436 "package_attempts",
437 "cmi.core.lesson_status",
438 "cmi.core.total_time",
439 "cmi.core.score.raw")
440 );
441
442 $score = $time = $status = "";
443
444 while ($data_rec = $ilDB->fetchAssoc($data_set)) {
445 switch ($data_rec["lvalue"]) {
446 case "cmi.core.lesson_status":
447 $status = $data_rec["rvalue"];
448 break;
449
450 case "cmi.core.total_time":
451 $time = $data_rec["rvalue"];
452 break;
453
454 case "cmi.core.score.raw":
455 $score = $data_rec["rvalue"];
456 break;
457 }
458 }
459 $sc_item = new ilSCORMItem((int) $sco_rec["sco_id"]);
460 $data[] = array("sco_id" => (int) $sco_rec["sco_id"], "title" => $sc_item->getTitle(),
461 "score" => $score, "time" => $time, "status" => $status);
462 }
463 return (array) $data;
464 }

References $data, $DIC, $ilDB, and ilObject\getId().

+ Here is the call graph for this function:

◆ getTrackingDataAggSco()

ilObjSCORMLearningModule::getTrackingDataAggSco ( int  $a_sco_id)

Definition at line 466 of file class.ilObjSCORMLearningModule.php.

466 : array
467 {
468 global $DIC;
469 $ilDB = $DIC->database();
470
471 // get all users with any tracking data
472 $user_set = $ilDB->queryF(
473 '
474 SELECT DISTINCT user_id FROM scorm_tracking
475 WHERE obj_id = %s
476 AND sco_id = %s',
477 array('integer','integer'),
478 array($this->getId(),$a_sco_id)
479 );
480
481 $data = array();
482 while ($user_rec = $ilDB->fetchAssoc($user_set)) {
483 $data_set = $ilDB->queryF(
484 '
485 SELECT * FROM scorm_tracking
486 WHERE obj_id = %s
487 AND sco_id = %s
488 AND user_id = %s
489 AND (lvalue = %s
490 OR lvalue = %s
491 OR lvalue = %s)',
492 array('integer','integer','integer','text','text','text'),
493 array($this->getId(),
494 $a_sco_id,
495 $user_rec["user_id"],
496 "cmi.core.lesson_status",
497 "cmi.core.total_time",
498 "cmi.core.score.raw")
499 );
500
501 $score = $time = $status = "";
502
503 while ($data_rec = $ilDB->fetchAssoc($data_set)) {
504 switch ($data_rec["lvalue"]) {
505 case "cmi.core.lesson_status":
506 $status = $data_rec["rvalue"];
507 break;
508
509 case "cmi.core.total_time":
510 $time = $data_rec["rvalue"];
511 break;
512
513 case "cmi.core.score.raw":
514 $score = $data_rec["rvalue"];
515 break;
516 }
517 }
518
519 $data[] = array("user_id" => $user_rec["user_id"],
520 "score" => $score, "time" => $time, "status" => $status);
521 }
522
523 return $data;
524 }

References $data, $DIC, $ilDB, and ilObject\getId().

+ Here is the call graph for this function:

◆ getTrackingDataPerUser()

ilObjSCORMLearningModule::getTrackingDataPerUser ( int  $a_sco_id,
int  $a_user_id 
)

Get tracking data per user.

Definition at line 380 of file class.ilObjSCORMLearningModule.php.

380 : array
381 {
382 global $DIC;
383 $ilDB = $DIC->database();
384
385 $data_set = $ilDB->queryF(
386 '
387 SELECT * FROM scorm_tracking
388 WHERE user_id = %s
389 AND sco_id = %s
390 AND obj_id = %s
391 ORDER BY lvalue',
392 array('integer','integer','integer'),
393 array($a_user_id,$a_sco_id,$this->getId())
394 );
395
396 $data = array();
397 while ($data_rec = $ilDB->fetchAssoc($data_set)) {
398 $data[] = $data_rec;
399 }
400
401 return $data;
402 }

References $data, $DIC, $ilDB, and ilObject\getId().

+ Here is the call graph for this function:

◆ getTrackingItems()

ilObjSCORMLearningModule::getTrackingItems ( )

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

42 : array
43 {
45 }
static _getTrackingItems(int $a_obj_id)
get all tracking items of scorm object

References _getTrackingItems(), and ilObject\getId().

+ Here is the call graph for this function:

◆ getUserIdEmail()

ilObjSCORMLearningModule::getUserIdEmail ( string  $a_mail)

assumes that only one account exists for a mailadress

Definition at line 1035 of file class.ilObjSCORMLearningModule.php.

1035 : int
1036 {
1037 global $DIC;
1038 $ilDB = $DIC->database();
1039 $ilUser = $DIC->user();
1040
1041 $val_set = $ilDB->queryF(
1042 'SELECT usr_id FROM usr_data WHERE(email=%s)',
1043 array('text'),
1044 array($a_mail)
1045 );
1046 $val_rec = $ilDB->fetchAssoc($val_set);
1047
1048
1049 return (int) $val_rec["usr_id"];
1050 }

References $DIC, and $ilDB.

◆ importRaw()

ilObjSCORMLearningModule::importRaw ( string  $a_file)
private

Import raw data.

Definition at line 832 of file class.ilObjSCORMLearningModule.php.

832 : bool
833 {
834 global $DIC;
835 $ilDB = $DIC->database();
836 $ilUser = $DIC->user();
837 $lng = $DIC->language();
838 $lng->loadLanguageModule("scormtrac");
839
840 $fhandle = fopen($a_file, "r");
841
842 $fields = fgetcsv($fhandle, 2 ** 16, ';', '"', '\\');
843 $users = array();
844 $a_last_access = array();
845 $a_time = array();
846 $a_package_attempts = array();
847 $a_module_version = array();
848 while (($csv_rows = fgetcsv($fhandle, 2 ** 16, ";", '"', '\\')) !== false) {
849 $data = array_combine($fields, $csv_rows);
850 if ($data['Userid']) {
851 $user_id = $this->parseUserId($data['Userid']);
852 } elseif ($data[$lng->txt("user")]) {
853 if (is_int($data[$lng->txt("user")])) {
854 $user_id = $data[$lng->txt("user")];
855 }
856 }
857 if ($data[$lng->txt("login")]) {
858 $user_id = $this->get_user_id($data[$lng->txt("login")]);
859 }
860 if (!$user_id) {
861 continue;
862 }
863
864 if ($data['Scoid']) {
865 $il_sco_id = $this->lookupSCOId($data['Scoid']);
866 }
867 if ($data[$lng->txt("identifierref")]) {
868 $il_sco_id = $this->lookupSCOId($data[$lng->txt("identifierref")]);
869 }
870 if (!$il_sco_id) {
871 continue;
872 }
873
874 $c_timestamp = null;
875 foreach ([$lng->txt("c_timestamp"), 'Timestamp'] as $key) {
876 if (!empty($data[$key])) {
877 $c_timestamp = $this->kindlyToDateTime('Y-m-d H:i:s', $data[$key]);
878 break;
879 }
880 }
881
882 $c_timestamp ??= new DateTimeImmutable('now');
883 if (!isset($a_last_access[$user_id]) || $a_last_access[$user_id] < $c_timestamp) {
884 $a_last_access[$user_id] = $c_timestamp;
885 }
886
887 if (!$data['Key']) {
888 continue;
889 }
890 if (!$data['Value']) {
891 $data['Value'] = "";
892 }
893
894 if ($data['Key'] === "cmi.core.total_time" && $data['Value'] != "") {
895 $tarr = explode(":", $data['Value']);
896 $sec = (int) $tarr[2] + (int) $tarr[1] * 60 +
897 (int) substr($tarr[0], strlen($tarr[0]) - 3) * 60 * 60;
898 if ($a_time[$user_id]) {
899 $a_time[$user_id] += $sec;
900 } else {
901 $a_time[$user_id] = $sec;
902 }
903 }
904 //do the actual import
905 if ($il_sco_id > 0) {
906 $statement = $ilDB->queryF(
907 '
908 SELECT * FROM scorm_tracking
909 WHERE user_id = %s
910 AND sco_id = %s
911 AND lvalue = %s
912 AND obj_id = %s',
913 array('integer', 'integer', 'text', 'integer'),
914 array($user_id, $il_sco_id, $data['Key'], $this->getID())
915 );
916 if ($ilDB->numRows($statement) > 0) {
917 $ilDB->update(
918 'scorm_tracking',
919 array(
920 'rvalue' => array('clob', $data['Value']),
921 'c_timestamp' => array('timestamp', $c_timestamp->format('Y-m-d H:i:s'))
922 ),
923 array(
924 'user_id' => array('integer', $user_id),
925 'sco_id' => array('integer', $il_sco_id),
926 'lvalue' => array('text', $data['Key']),
927 'obj_id' => array('integer', $this->getId())
928 )
929 );
930 } else {
931 $ilDB->insert('scorm_tracking', array(
932 'obj_id' => array('integer', $this->getId()),
933 'user_id' => array('integer', $user_id),
934 'sco_id' => array('integer', $il_sco_id),
935 'lvalue' => array('text', $data['Key']),
936 'rvalue' => array('clob', $data['Value']),
937 'c_timestamp' => array('timestamp', $data['Timestamp'])
938 ));
939 }
940 }
941 // $package_attempts = 1;
942 if ($il_sco_id == 0) {
943 if ($data['Key'] === "package_attempts") {
944 $a_package_attempts[$user_id] = $data['Value'];
945 }
946 // if ($data['Key'] == "module_version") $a_module_version[$user_id] = $data['Value'];
947 }
948 if (!in_array($user_id, $users)) {
949 $users[] = $user_id;
950 }
951 }
952 fclose($fhandle);
954 foreach ($users as $user_id) {
955 $attempts = 1;
956 if ($a_package_attempts[$user_id]) {
957 $attempts = $a_package_attempts[$user_id];
958 }
959 // $module_version = 1;
960 // if ($a_module_version[$user_id]) $module_version = $a_module_version[$user_id];
961 $sco_total_time_sec = null;
962 if ($a_time[$user_id]) {
963 $sco_total_time_sec = $a_time[$user_id];
964 }
965 $last_access = null;
966 if (isset($a_last_access[$user_id])) {
967 $last_access = $a_last_access[$user_id];
968 }
969 // $status = ilLPStatusWrapper::_determineStatus($this->getId(),$user_id);
970 $status = (int) ilLPStatus::_lookupStatus($this->getId(), $user_id);
971 // $percentage_completed = ilLPStatusSCORM::determinePercentage($this->getId(),$user_id);
972 $percentage_completed = ilLPStatus::_lookupPercentage($this->getId(), $user_id);
973
974 $this->importSuccessForSahsUser($user_id, $last_access, $status, $attempts, $percentage_completed, $sco_total_time_sec);
975 }
976
977 return true;
978 }
static _refreshStatus(int $a_obj_id, ?array $a_users=null)
static _lookupPercentage(int $a_obj_id, int $a_user_id)
Lookup percentage.
static _lookupStatus(int $a_obj_id, int $a_user_id, bool $a_create=true)
Lookup status.
loadLanguageModule(string $a_module)
Load language module.
kindlyToDateTime(string $format, string $maybe_datetime, ?DateTimeImmutable $default=null)
lookupSCOId(string $a_referrer)
resolves manifest SCOID to internal ILIAS SCO ID
parseUserId(string $il_id)
Parse il_usr_123_6 id.
importSuccessForSahsUser(int $user_id, ?DateTimeImmutable $last_access, int $status, ?int $attempts=null, ?int $percentage_completed=null, ?int $sco_total_time_sec=null)

References $data, $DIC, $ilDB, $lng, $user_id, ilLPStatus\_lookupPercentage(), ilLPStatus\_lookupStatus(), ilLPStatusWrapper\_refreshStatus(), ILIAS\Survey\Mode\getId(), and ILIAS\Repository\int().

Referenced by importTrackingData().

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

◆ importSuccess()

ilObjSCORMLearningModule::importSuccess ( string  $a_file)

Reimplemented in ilObjSCORM2004LearningModule.

Definition at line 601 of file class.ilObjSCORMLearningModule.php.

601 : bool
602 {
603 global $DIC;
604 $ilDB = $DIC->database();
605 $ilUser = $DIC->user();
606 $scos = array();
607 $olp = ilObjectLP::getInstance($this->getId());
608 $collection = $olp->getCollectionInstance();
609 if ($collection) {
610 $scos = $collection->getItems();
611 }
612
613 $fhandle = fopen($a_file, "r");
614
615 $obj_id = $this->getID();
616 $fields = fgetcsv($fhandle, 2 ** 16, ';', '"', '\\');
617 $users = array();
618 $usersToDelete = array();
619 while (($csv_rows = fgetcsv($fhandle, 2 ** 16, ";", '"', '\\')) !== false) {
620 $user_id = 0;
621 $data = array_combine($fields, $csv_rows);
622 //no check the format - sufficient to import users
623 if (isset($data["Login"])) {
624 $user_id = $this->get_user_id($data["Login"]);
625 }
626 if (isset($data["login"])) {
627 $user_id = $this->get_user_id($data["login"]);
628 }
629 //add mail in future
630 if (isset($data["user"]) && is_numeric($data["user"])) {
631 $user_id = (int) $data["user"];
632 }
633
634 if ($user_id > 0) {
635 $last_access = new DateTimeImmutable('now');
636 if (isset($data['LastAccess']) && $data['LastAccess']) {
637 $last_access = $this->kindlyToDateTime('Y-m-d H:i:s', $data['LastAccess']);
638 } elseif (isset($data['Date']) && $data['Date']) {
639 $last_access = $this->kindlyToDateTime('d.m.Y', $data['Date']);
640 }
641
643
644 if (isset($data["Status"])) {
645 if (is_int($data["Status"])) {
646 $status = $data["Status"];
647 } elseif ($data["Status"] == "0" || $data["Status"] == "1" || $data["Status"] == "2" || $data["Status"] == "3") {
648 $status = (int) $data["Status"];
649 } elseif ($data["Status"] == ilLPStatus::LP_STATUS_NOT_ATTEMPTED) {
651 } elseif ($data["Status"] == ilLPStatus::LP_STATUS_IN_PROGRESS) {
653 } elseif ($data["Status"] == ilLPStatus::LP_STATUS_FAILED) {
655 }
656 }
657
658 $attempts = null;
659 if (isset($data["Attempts"])) {
660 $attempts = (int) $data["Attempts"];
661 }
662
663 $percentage_completed = 0;
665 $percentage_completed = 100;
666 }
667 if (isset($data['percentageCompletedSCOs'])) {
668 $percentage_completed = (int) $data['percentageCompletedSCOs'];
669 }
670
671 $sco_total_time_sec = null;
672 if (isset($data['SumTotal_timeSeconds'])) {
673 $sco_total_time_sec = (int) $data['SumTotal_timeSeconds'];
674 }
675
677 $usersToDelete[] = $user_id;
678 } else {
679 $this->importSuccessForSahsUser($user_id, $last_access, $status, $attempts, $percentage_completed, $sco_total_time_sec);
680 $users[] = $user_id;
681 }
682
684 foreach ($scos as $sco_id) {
685 $statement = $ilDB->queryF(
686 '
687 SELECT * FROM scorm_tracking
688 WHERE user_id = %s
689 AND sco_id = %s
690 AND lvalue = %s
691 AND obj_id = %s',
692 array('integer','integer','text','integer'),
693 array($user_id, $sco_id, 'cmi.core.lesson_status',$obj_id)
694 );
695 if ($ilDB->numRows($statement) > 0) {
696 $ilDB->update(
697 'scorm_tracking',
698 array(
699 'rvalue' => array('clob', 'completed'),
700 'c_timestamp' => array('timestamp', $last_access?->format('Y-m-d H:i:s'))
701 ),
702 array(
703 'user_id' => array('integer', $user_id),
704 'sco_id' => array('integer', $sco_id),
705 'lvalue' => array('text', 'cmi.core.lesson_status'),
706 'obj_id' => array('integer', $obj_id)
707 )
708 );
709 } else {
710 $ilDB->insert('scorm_tracking', array(
711 'obj_id' => array('integer', $obj_id),
712 'user_id' => array('integer', $user_id),
713 'sco_id' => array('integer', $sco_id),
714 'lvalue' => array('text', 'cmi.core.lesson_status'),
715 'rvalue' => array('clob', 'completed'),
716 'c_timestamp' => array('timestamp', $last_access?->format('Y-m-d H:i:s'))
717 ));
718 }
719 }
720 }
721 } else {
722 //echo "Warning! User $csv_rows[0] does not exist in ILIAS. Data for this user was skipped.\n";
723 }
724 }
725
726 if (count($usersToDelete) > 0) {
727 // include_once("../components/ILIAS/Tracking/classes/class.ilLPMarks.php");
728 // ilLPMarks::_deleteForUsers($this->getId(), $usersToDelete);
729 $this->deleteTrackingDataOfUsers($usersToDelete);
730 }
732 return true;
733 }
const int LP_STATUS_FAILED_NUM
const string LP_STATUS_IN_PROGRESS
const string LP_STATUS_NOT_ATTEMPTED
const string LP_STATUS_FAILED
const int LP_STATUS_COMPLETED_NUM
const int LP_STATUS_IN_PROGRESS_NUM
const int LP_STATUS_NOT_ATTEMPTED_NUM
static getInstance(int $obj_id)

References $data, $DIC, $ilDB, $user_id, ilLPStatusWrapper\_refreshStatus(), deleteTrackingDataOfUsers(), get_user_id(), ilObject\getId(), ilObjectLP\getInstance(), importSuccessForSahsUser(), ILIAS\Repository\int(), kindlyToDateTime(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, ilLPStatus\LP_STATUS_NOT_ATTEMPTED, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

Referenced by importTrackingData().

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

◆ importSuccessForSahsUser()

ilObjSCORMLearningModule::importSuccessForSahsUser ( int  $user_id,
?DateTimeImmutable  $last_access,
int  $status,
?int  $attempts = null,
?int  $percentage_completed = null,
?int  $sco_total_time_sec = null 
)

Definition at line 758 of file class.ilObjSCORMLearningModule.php.

765 : void {
766 global $DIC;
767 $ilDB = $DIC->database();
768 $statement = $ilDB->queryF(
769 'SELECT * FROM sahs_user WHERE obj_id = %s AND user_id = %s',
770 array('integer','integer'),
771 array($this->getID(),$user_id)
772 );
773 if ($ilDB->numRows($statement) > 0) {
774 $ilDB->update(
775 'sahs_user',
776 array(
777 'last_access' => array('timestamp', $last_access?->format('Y-m-d H:i:s')),
778 'status' => array('integer', $status),
779 'package_attempts' => array('integer', $attempts),
780 'percentage_completed' => array('integer', $percentage_completed),
781 'sco_total_time_sec' => array('integer', $sco_total_time_sec)
782 ),
783 array(
784 'obj_id' => array('integer', $this->getID()),
785 'user_id' => array('integer', $user_id)
786 )
787 );
788 } else {
789 $ilDB->insert('sahs_user', array(
790 'obj_id' => array('integer', $this->getID()),
791 'user_id' => array('integer', $user_id),
792 'last_access' => array('timestamp', $last_access?->format('Y-m-d H:i:s')),
793 'status' => array('integer', $status),
794 'package_attempts' => array('integer', $attempts),
795 'percentage_completed' => array('integer', $percentage_completed),
796 'sco_total_time_sec' => array('integer', $sco_total_time_sec)
797 ));
798 }
799 // since 8 necessary because attempts can be null
800 if (ilChangeEvent::_lookupReadEvents($this->getID(), $user_id) == []) {
801 ilChangeEvent::_recordReadEvent("sahs", $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int()), $this->getID(), $user_id);
802 }
803
804 ilChangeEvent::_recordReadEvent("sahs", $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int()), $this->getID(), $user_id, $attempts, $sco_total_time_sec);
805 }
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, $a_ext_rc=null, $a_ext_time=null)
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object.

References $ilDB, and $user_id.

Referenced by ilObjSCORM2004LearningModule\importSuccess(), and importSuccess().

+ Here is the caller graph for this function:

◆ importTrackingData()

ilObjSCORMLearningModule::importTrackingData ( string  $a_file)

Definition at line 568 of file class.ilObjSCORMLearningModule.php.

568 : bool
569 {
570 global $DIC;
571 $ilDB = $DIC->database();
572 $ilUser = $DIC->user();
573
574 $success = false;
575 //echo file_get_contents($a_file);
576 $method = null;
577
578 //lets import
579 $fhandle = fopen($a_file, "r");
580
581 //the top line is the field names
582 $fields = fgetcsv($fhandle, 2 ** 16, ';', '"', '\\');
583 //lets check the import method
584 fclose($fhandle);
585
586 switch ($fields[0]) {
587 case "Scoid":
588 case "SCO-Identifier":
589 $success = $this->importRaw($a_file);
590 break;
591 case "Department":
592 case "LearningModuleId":
593 $success = $this->importSuccess($a_file);
594 break;
595 default:
596 return false;
597 }
598 return $success;
599 }
importRaw(string $a_file)
Import raw data.

References $DIC, $ilDB, importRaw(), and importSuccess().

+ Here is the call graph for this function:

◆ kindlyToDateTime()

ilObjSCORMLearningModule::kindlyToDateTime ( string  $format,
string  $maybe_datetime,
?DateTimeImmutable  $default = null 
)
protected

Definition at line 735 of file class.ilObjSCORMLearningModule.php.

739 : ?DateTimeImmutable {
740 $datetime = $default;
741
742 if ($maybe_datetime === '0000-00-00 00:00:00' || $maybe_datetime === '0000-00-00') {
743 return null;
744 }
745
746 try {
747 $parsed_date = DateTimeImmutable::createFromFormat($format, $maybe_datetime);
748 if ($parsed_date !== false) {
749 $datetime = $parsed_date;
750 }
751 } catch (Throwable) {
752 // Ignore
753 }
754
755 return $datetime;
756 }
$datetime

Referenced by ilObjSCORM2004LearningModule\importSuccess(), and importSuccess().

+ Here is the caller graph for this function:

◆ lookupSCOId()

ilObjSCORMLearningModule::lookupSCOId ( string  $a_referrer)
private

resolves manifest SCOID to internal ILIAS SCO ID

Definition at line 1007 of file class.ilObjSCORMLearningModule.php.

1007 : int
1008 {
1009 global $DIC;
1010 $ilDB = $DIC->database();
1011 $ilUser = $DIC->user();
1012
1013 //non specific SCO entries
1014 if ($a_referrer == "0") {
1015 return 0;
1016 }
1017
1018 $val_set = $ilDB->queryF(
1019 '
1020 SELECT obj_id FROM sc_item,scorm_tree
1021 WHERE (obj_id = child
1022 AND identifierref = %s
1023 AND slm_id = %s)',
1024 array('text','integer'),
1025 array($a_referrer,$this->getID())
1026 );
1027 $val_rec = $ilDB->fetchAssoc($val_set);
1028
1029 return (int) $val_rec["obj_id"];
1030 }

References $DIC, and $ilDB.

◆ parseUserId()

ilObjSCORMLearningModule::parseUserId ( string  $il_id)
private

Parse il_usr_123_6 id.

Definition at line 810 of file class.ilObjSCORMLearningModule.php.

810 : int
811 {
812 global $DIC;
813 $ilSetting = $DIC->settings();
814
815 $parts = explode('_', $il_id);
816
817 if (!count((array) $parts)) {
818 return 0;
819 }
820 if (!isset($parts[2]) or !isset($parts[3])) {
821 return 0;
822 }
823 if ($parts[2] != $ilSetting->get('inst_id', $parts[2])) {
824 return 0;
825 }
826 return (int) $parts[3];
827 }
global $ilSetting
Definition: privfeed.php:26

References $DIC, and $ilSetting.

◆ readObject()

ilObjSCORMLearningModule::readObject ( )

read manifest file

Exceptions
ilSaxParserException

Reimplemented in ilObjSCORM2004LearningModule.

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

74 : string
75 {
76 global $DIC;
77 $ilErr = $DIC['ilErr'];
78
79 $needs_convert = false;
80
81 // convert imsmanifest.xml file in iso to utf8 if needed
82
83 $manifest_file = $this->getDataDirectory() . "/imsmanifest.xml";
84
85 // check if manifestfile exists and space left on device...
86 $check_for_manifest_file = is_file($manifest_file);
87
88 // if no manifestfile
89 if (!$check_for_manifest_file) {
90 $ilErr->raiseError($this->lng->txt("Manifestfile $manifest_file not found!"), $ilErr->MESSAGE);
91 return "";
92 }
93
94 if ($check_for_manifest_file) {
95 $manifest_file_array = file($manifest_file);
96 foreach ($manifest_file_array as $mfa) {
97 // if (seems_not_utf8($mfa))
98 if (@iconv('UTF-8', 'UTF-8', $mfa) != $mfa) {
99 $needs_convert = true;
100 break;
101 }
102 }
103
104 // to copy the file we need some extraspace, counted in bytes *2 ... we need 2 copies....
105 $estimated_manifest_filesize = filesize($manifest_file) * 2;
106
107 // i deactivated this, because it seems to fail on some windows systems (see bug #1795)
108 //$check_disc_free = disk_free_space($this->getDataDirectory()) - $estimated_manifest_filesize;
109 $check_disc_free = 2;
110 }
111
112 // if $manifest_file needs to be converted to UTF8
113 if ($needs_convert) {
114 // if file exists and enough space left on device
115 if ($check_for_manifest_file && ($check_disc_free > 1)) {
116 // create backup from original
117 if (!copy($manifest_file, $manifest_file . ".old")) {
118 echo "Failed to copy $manifest_file...<br>\n";
119 }
120
121 // read backupfile, convert each line to utf8, write line to new file
122 // php < 4.3 style
123 $f_write_handler = fopen($manifest_file . ".new", "w");
124 $f_read_handler = fopen($manifest_file . ".old", "r");
125 while (!feof($f_read_handler)) {
126 $zeile = fgets($f_read_handler);
127 //echo mb_detect_encoding($zeile);
128 fwrite($f_write_handler, utf8_encode($zeile));
129 }
130 fclose($f_read_handler);
131 fclose($f_write_handler);
132
133 // copy new utf8-file to imsmanifest.xml
134 if (!copy($manifest_file . ".new", $manifest_file)) {
135 echo "Failed to copy $manifest_file...<br>\n";
136 }
137
138 if (!@is_file($manifest_file)) {
139 $ilErr->raiseError($this->lng->txt("cont_no_manifest"), $ilErr->WARNING);
140 }
141 } else {
142 // gives out the specific error
143
144 if (!($check_disc_free > 1)) {
145 $ilErr->raiseError($this->lng->txt("Not enough space left on device!"), $ilErr->MESSAGE);
146 }
147 return "";
148 }
149 } else {
150 // check whether file starts with BOM (that confuses some sax parsers, see bug #1795)
151 $hmani = fopen($manifest_file, "r");
152 $start = fread($hmani, 3);
153 if (strtolower(bin2hex($start)) === "efbbbf") {
154 $f_write_handler = fopen($manifest_file . ".new", "w");
155 while (!feof($hmani)) {
156 $n = fread($hmani, 900);
157 fwrite($f_write_handler, $n);
158 }
159 fclose($f_write_handler);
160 fclose($hmani);
161
162 // copy new utf8-file to imsmanifest.xml
163 if (!copy($manifest_file . ".new", $manifest_file)) {
164 echo "Failed to copy $manifest_file...<br>\n";
165 }
166 } else {
167 fclose($hmani);
168 }
169 }
170
171 // todo determine imsmanifest.xml path here...
172 $slmParser = new ilSCORMPackageParser($this, $manifest_file);
173 $slmParser->startParsing();
174 return (string) $slmParser->getPackageTitle();
175 }
getDataDirectory(?string $mode="filesystem")
get data directory of lm

References $DIC, ILIAS\UI\examples\Symbol\Glyph\Copy\copy(), ilObjSAHSLearningModule\getDataDirectory(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ sendExportFile()

ilObjSCORMLearningModule::sendExportFile ( string  $a_header,
string  $a_content 
)

send export file to browser

Definition at line 1056 of file class.ilObjSCORMLearningModule.php.

1056 : void
1057 {
1058 $timestamp = time();
1059 $refid = $this->getRefId();
1060 $filename = "scorm_tracking_" . $refid . "_" . $timestamp . ".csv";
1061 ilUtil::deliverData($a_header . $a_content, $filename);
1062 exit;
1063 }
$filename
Definition: buildRTE.php:78
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $filename, $timestamp, ilUtil\deliverData(), and exit.

Referenced by exportSelected().

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

◆ setLearningProgressSettingsAtUpload()

ilObjSCORMLearningModule::setLearningProgressSettingsAtUpload ( )

set settings for learning progress determination per default at upload

Definition at line 180 of file class.ilObjSCORMLearningModule.php.

180 : void
181 {
182 global $DIC;
183 $ilSetting = $DIC->settings();
184 //condition 1
185 $lm_set = new ilSetting("lm");
186 if ($lm_set->get('scorm_lp_auto_activate') != 1) {
187 return;
188 }
190 return;
191 }
192 $lm_set = new ilLPObjSettings($this->getId());
194 $lm_set->insert();
195 $collection = new ilLPCollectionOfSCOs($this->getId(), ilLPObjSettings::LP_MODE_SCORM);
196 $scos = array();
197 foreach ($collection->getPossibleItems() as $sco_id => $item) {
198 $scos[] = $sco_id;
199 }
200 $collection->activateEntries($scos);
201 }
ILIAS Setting Class.
$lm_set

References $DIC, $ilSetting, $lm_set, ilObjUserTracking\_enabledLearningProgress(), ilObject\getId(), and ilLPObjSettings\LP_MODE_SCORM.

+ Here is the call graph for this function:

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