ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 (string $a_search)
 Return the last access timestamp for a given user. More...
 
 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 ilObjUser $ilUser. More...
 
 importTrackingData (string $a_file)
 
 importSuccess (string $a_file)
 
 importSuccessForSahsUser (int $user_id, string $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 ()
 Set Editable. More...
 
 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...
 
 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 ()
 offlineMode More...
 
 setDebug (bool $a_debug)
 
 setAutoContinue (bool $a_auto_continue)
 debug pw More...
 
 getAutoContinue ()
 
 getAuto_last_visited ()
 
 setAuto_last_visited (bool $a_auto_last_visited)
 
 setAutoSuspend (bool $a_auto_suspend)
 Set sequencing expert mode. More...
 
 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 ()
 
 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)
 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)
 

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 Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 
- 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
 
- 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)

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

References ILIAS\GlobalScreen\Provider\__construct().

37  {
38  $this->type = "sahs";
39  parent::__construct($a_id, $a_call_by_reference);
40  }
__construct(Container $dic, ilPlugin $plugin)
+ 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 1042 of file class.ilObjSCORMLearningModule.php.

References $DIC, and $ilDB.

Referenced by _getCourseCompletionForUser().

1042  : array
1043  {
1044  global $DIC;
1045  $ilDB = $DIC->database();
1046 
1047  $scos = array();
1048 
1049  $val_set = $ilDB->queryF(
1050  '
1051  SELECT scorm_object.obj_id,
1052  scorm_object.title,
1053  scorm_object.c_type,
1054  scorm_object.slm_id,
1055  scorm_object.obj_id scoid
1056  FROM scorm_object,sc_item,sc_resource
1057  WHERE(scorm_object.slm_id = %s
1058  AND scorm_object.obj_id = sc_item.obj_id
1059  AND sc_item.identifierref = sc_resource.import_id
1060  AND sc_resource.scormtype = %s)
1061  GROUP BY scorm_object.obj_id,
1062  scorm_object.title,
1063  scorm_object.c_type,
1064  scorm_object.slm_id,
1065  scorm_object.obj_id ',
1066  array('integer', 'text'),
1067  array($a_id,'sco')
1068  );
1069 
1070  while ($val_rec = $ilDB->fetchAssoc($val_set)) {
1071  $scos[] = $val_rec['scoid'];
1072  }
1073  return $scos;
1074  }
global $DIC
Definition: shib_login.php:22
+ 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

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

References _getAllScoIds(), and _getStatusForUser().

1126  : bool
1127  {
1129  }
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&#39;s for all Sco&#39;s in the module.
+ Here is the call graph for this function:

◆ _getScoresForUser()

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

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

References $DIC, $ilDB, and null.

Referenced by ilLPCollectionOfSCOs\getScoresForUserAndCP_Node_Id().

1226  : array
1227  {
1228  global $DIC;
1229  $ilDB = $DIC->database();
1230 
1231  $retAr = array("raw" => null, "max" => null, "scaled" => null);
1232  $val_set = $ilDB->queryF(
1233  "
1234  SELECT lvalue, rvalue FROM scorm_tracking
1235  WHERE sco_id = %s
1236  AND user_id = %s
1237  AND (lvalue = 'cmi.core.score.raw' OR lvalue = 'cmi.core.score.max')",
1238  array('integer', 'integer'),
1239  array($a_item_id, $a_user_id)
1240  );
1241  while ($val_rec = $ilDB->fetchAssoc($val_set)) {
1242  if ($val_rec['lvalue'] === "cmi.core.score.raw") {
1243  $retAr["raw"] = $val_rec["rvalue"];
1244  }
1245  if ($val_rec['lvalue'] === "cmi.core.score.max") {
1246  $retAr["max"] = $val_rec["rvalue"];
1247  }
1248  }
1249  if ($retAr["raw"] != null && $retAr["max"] != null) {
1250  $retAr["scaled"] = ($retAr["raw"] / $retAr["max"]);
1251  }
1252 
1253  return $retAr;
1254  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ 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 1084 of file class.ilObjSCORMLearningModule.php.

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

Referenced by _getCourseCompletionForUser().

1084  : bool
1085  {
1086  global $DIC;
1087  $ilDB = $DIC->database();
1088  $lng = $DIC->language();
1089 
1090  $scos = $a_allScoIds;
1091  //check if all SCO's are completed
1092  $scos_c = implode(',', $scos);
1093 
1094  $val_set = $ilDB->queryF(
1095  '
1096  SELECT * FROM scorm_tracking
1097  WHERE (user_id = %s
1098  AND obj_id = %s
1099  AND ' . $ilDB->in('sco_id', $scos, false, 'integer') . '
1100  AND ((lvalue = %s AND ' . $ilDB->like('rvalue', 'clob', 'completed') . ')
1101  OR (lvalue = %s AND ' . $ilDB->like('rvalue', 'clob', 'passed') . ')))',
1102  array('integer','integer','text','text'),
1103  array($a_user,$a_id,'cmi.core.lesson_status', 'cmi.core.lesson_status')
1104  );
1105  while ($val_rec = $ilDB->fetchAssoc($val_set)) {
1106  $key = array_search($val_rec['sco_id'], $scos);
1107  unset($scos[$key]);
1108  }
1109  $completion = false;
1110  //check for completion
1111  if (count($scos) == 0) {
1112  $completion = ($a_numerical === true) ? true : $lng->txt("cont_complete");
1113  }
1114  if (count($scos) > 0) {
1115  $completion = ($a_numerical === true) ? false : $lng->txt("cont_incomplete");
1116  }
1117  return $completion;
1118  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getTrackingItems()

static ilObjSCORMLearningModule::_getTrackingItems ( int  $a_obj_id)
static

get all tracking items of scorm object

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

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

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

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  }
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
ilTree $tree
SCORM Item.
SCORM Object Tree.
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
+ 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 1209 of file class.ilObjSCORMLearningModule.php.

References $DIC, and $ilDB.

Referenced by ilObjUser\delete().

1209  : void
1210  {
1211  global $DIC;
1212  $ilDB = $DIC->database();
1213  //gobjective
1214  $ilDB->manipulateF(
1215  'DELETE FROM scorm_tracking WHERE user_id = %s',
1216  array('integer'),
1217  array($user_id)
1218  );
1219  $ilDB->manipulateF(
1220  'DELETE FROM sahs_user WHERE user_id = %s',
1221  array('integer'),
1222  array($user_id)
1223  );
1224  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ deleteTrackingDataOfUsers()

ilObjSCORMLearningModule::deleteTrackingDataOfUsers ( array  $a_users)

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

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

Referenced by importSuccess().

1273  : void
1274  {
1275  global $DIC;
1276  $ilDB = $DIC->database();
1277 
1278  ilChangeEvent::_deleteReadEventsForUsers($this->getId(), $a_users);
1279 
1280  foreach ($a_users as $usr) {
1281  $user = (int) $usr;
1282  $ilDB->manipulateF(
1283  '
1284  DELETE FROM scorm_tracking
1285  WHERE user_id = %s
1286  AND obj_id = %s',
1287  array('integer', 'integer'),
1288  array($user, $this->getID())
1289  );
1290 
1291  $ilDB->manipulateF(
1292  '
1293  DELETE FROM sahs_user
1294  WHERE user_id = %s
1295  AND obj_id = %s',
1296  array('integer', 'integer'),
1297  array($user, $this->getID())
1298  );
1299 
1301  }
1302  }
global $DIC
Definition: shib_login.php:22
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
+ 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 ilObjUser $ilUser.

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

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

516  : void
517  {
518  global $DIC;
519  $ilDB = $DIC->database();
520  $ilUser = $DIC->user();
521  $privacy = ilPrivacySettings::getInstance();
522  $allowExportPrivacy = $privacy->enabledExportSCORM();
523 
524  $csv = "";
525  $query = 'SELECT * FROM sahs_user WHERE obj_id = %s';
526  if (count($a_users) > 0) {
527  $query .= ' AND ' . $ilDB->in('user_id', $a_users, false, 'integer');
528  }
529  $res = $ilDB->queryF(
530  $query,
531  array('integer'),
532  array($this->getId())
533  );
534  while ($data = $ilDB->fetchAssoc($res)) {
535  $csv = $csv . $data["obj_id"]
536  . ";\"" . $this->getTitle() . "\""
537  . ";" . $data["module_version"]
538  . ";\"" . implode("\";\"", ilSCORMTrackingItems::userDataArrayForExport((int) $data["user_id"], $allowExportPrivacy)) . "\""
539  . ";\"" . $data["last_access"] . "\""
540  . ";\"" . ilLearningProgressBaseGUI::__readStatus((int) $data["obj_id"], (int) $data["user_id"]) . "\"" //not $data["status"] because modifications to learning progress could have made before export
541  . ";" . $data["package_attempts"]
542  . ";" . $data["percentage_completed"]
543  . ";" . $data["sco_total_time_sec"]
544 // . ";\"" . $certificateDate ."\""
545  . "\n";
546  }
548  $header = "LearningModuleId;LearningModuleTitle;LearningModuleVersion;" . str_replace(',', ';', $udh["cols"]) . ";"
549  . "LastAccess;Status;Attempts;percentageCompletedSCOs;SumTotal_timeSeconds\n";
550 
551  $this->sendExportFile($header, $csv);
552  }
$res
Definition: ltiservices.php:66
static userDataArrayForExport(int $user, bool $b_allowExportPrivacy=false)
global $DIC
Definition: shib_login.php:22
sendExportFile(string $a_header, string $a_content)
send export file to browser
static __readStatus(int $a_obj_id, int $user_id)
PhpInconsistentReturnPointsInspection
+ Here is the call graph for this function:

◆ get_user_id()

ilObjSCORMLearningModule::get_user_id ( string  $a_login)

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

References $DIC, $ilDB, and null.

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

956  : ?int
957  {
958  global $DIC;
959  $ilDB = $DIC->database();
960  $ilUser = $DIC->user();
961 
962  $val_set = $ilDB->queryF(
963  'SELECT * FROM usr_data WHERE(login=%s)',
964  array('text'),
965  array($a_login)
966  );
967  $val_rec = $ilDB->fetchAssoc($val_set);
968 
969  if (count($val_rec) > 0) {
970  return (int) $val_rec['usr_id'];
971  }
972 
973  return null;
974  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ getAllScoIds()

ilObjSCORMLearningModule::getAllScoIds ( )
Returns
array

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

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

Referenced by getCourseCompletionForUser().

1134  : array
1135  {
1136  global $DIC;
1137  $ilDB = $DIC->database();
1138 
1139  $scos = array();
1140  //get all SCO's of this object
1141  $val_set = $ilDB->queryF(
1142  '
1143  SELECT scorm_object.obj_id,
1144  scorm_object.title,
1145  scorm_object.c_type,
1146  scorm_object.slm_id,
1147  scorm_object.obj_id scoid
1148  FROM scorm_object, sc_item,sc_resource
1149  WHERE(scorm_object.slm_id = %s
1150  AND scorm_object.obj_id = sc_item.obj_id
1151  AND sc_item.identifierref = sc_resource.import_id
1152  AND sc_resource.scormtype = %s )
1153  GROUP BY scorm_object.obj_id,
1154  scorm_object.title,
1155  scorm_object.c_type,
1156  scorm_object.slm_id,
1157  scorm_object.obj_id',
1158  array('integer','text'),
1159  array($this->getId(),'sco')
1160  );
1161 
1162  while ($val_rec = $ilDB->fetchAssoc($val_set)) {
1163  $scos[] = $val_rec['scoid'];
1164  }
1165  return $scos;
1166  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAttemptsForUser()

ilObjSCORMLearningModule::getAttemptsForUser ( int  $a_user_id)

get number of attempts for a certain user and package

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

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

307  : int
308  {
309  global $DIC;
310  $ilDB = $DIC->database();
311  $val_set = $ilDB->queryF(
312  'SELECT package_attempts FROM sahs_user WHERE obj_id = %s AND user_id = %s',
313  array('integer','integer'),
314  array($this->getId(),$a_user_id)
315  );
316 
317  $val_rec = $ilDB->fetchAssoc($val_set);
318 
319  if ($val_rec["package_attempts"] == null) {
320  $val_rec["package_attempts"] = 0;
321  }
322  return (int) $val_rec["package_attempts"];
323  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ getAttemptsForUsers()

ilObjSCORMLearningModule::getAttemptsForUsers ( )

Get attempts for all users.

Returns
int[]

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

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

288  : array
289  {
290  global $DIC;
291  $ilDB = $DIC->database();
292  $query = 'SELECT user_id, package_attempts FROM sahs_user WHERE obj_id = ' . $ilDB->quote($this->getId(), 'integer') . ' ';
293  $res = $ilDB->query($query);
294 
295  $attempts = array();
296  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
297  $attempts[$row['user_id']] = (int) $row['package_attempts'];
298  }
299  return $attempts;
300  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ getCourseCompletionForUser()

ilObjSCORMLearningModule::getCourseCompletionForUser ( int  $a_user)

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

References getAllScoIds(), and getStatusForUser().

1201  : bool
1202  {
1203  return $this->getStatusForUser($a_user, $this->getAllScoIds(), true);
1204  }
getStatusForUser(int $a_user, array $a_allScoIds, bool $a_numerical=false)
+ Here is the call graph for this function:

◆ getLastVisited()

ilObjSCORMLearningModule::getLastVisited ( int  $user_id)

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

References $DIC, $ilDB, and null.

Referenced by ilObjSCORMInitData\getIliasScormVars().

1256  : string
1257  {
1258  global $DIC;
1259  $ilDB = $DIC->database();
1260  $val_set = $ilDB->queryF(
1261  'SELECT last_visited FROM sahs_user WHERE obj_id = %s AND user_id = %s',
1262  array('integer','integer'),
1263  array($this->getID(),$user_id)
1264  );
1265  while ($val_rec = $ilDB->fetchAssoc($val_set)) {
1266  if ($val_rec["last_visited"] != null) {
1267  return "" . $val_rec["last_visited"];
1268  }
1269  }
1270  return '0';
1271  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ 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

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

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

345  : string
346  {
347  global $DIC;
348  $ilDB = $DIC->database();
349  $val_set = $ilDB->queryF(
350  'SELECT module_version FROM sahs_user WHERE obj_id = %s AND user_id = %s',
351  array('integer','integer'),
352  array($this->getId(),$a_user_id,0)
353  );
354 
355  $val_rec = $ilDB->fetchAssoc($val_set);
356 
357  if ($val_rec["module_version"] == null) {
358  $val_rec["module_version"] = "";
359  }
360  return $val_rec["module_version"];
361  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ getModuleVersionForUsers()

ilObjSCORMLearningModule::getModuleVersionForUsers ( )

Get module version for users.

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

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

328  : array
329  {
330  global $DIC;
331  $ilDB = $DIC->database();
332  $query = 'SELECT user_id, module_version FROM sahs_user WHERE obj_id = ' . $ilDB->quote($this->getId(), 'integer') . ' ';
333  $res = $ilDB->query($query);
334 
335  $versions = array();
336  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
337  $versions[$row['user_id']] = (int) $row['module_version'];
338  }
339  return $versions;
340  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ getStatusForUser()

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

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

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

Referenced by getCourseCompletionForUser().

1168  : bool
1169  {
1170  global $DIC;
1171  $ilDB = $DIC->database();
1172  $scos = $a_allScoIds;
1173  //loook up status
1174  //check if all SCO's are completed
1175  $scos_c = implode(',', $scos);
1176 
1177  $val_set = $ilDB->queryF(
1178  '
1179  SELECT sco_id FROM scorm_tracking
1180  WHERE (user_id = %s
1181  AND obj_id = %s
1182  AND ' . $ilDB->in('sco_id', $scos, false, 'integer') . '
1183  AND ((lvalue = %s AND ' . $ilDB->like('rvalue', 'clob', 'completed') . ') OR (lvalue = %s AND ' . $ilDB->like('rvalue', 'clob', 'passed') . ') ) )',
1184  array('integer','integer','text','text',),
1185  array($a_user,$this->getID(),'cmi.core.lesson_status','cmi.core.lesson_status')
1186  );
1187  while ($val_rec = $ilDB->fetchAssoc($val_set)) {
1188  $key = array_search($val_rec['sco_id'], $scos);
1189  unset($scos[$key]);
1190  }
1191  //check for completion
1192  if (count($scos) == 0) {
1193  $completion = ($a_numerical === true) ? true : $this->lng->txt("cont_complete");
1194  }
1195  if (count($scos) > 0) {
1196  $completion = ($a_numerical === true) ? false : $this->lng->txt("cont_incomplete");
1197  }
1198  return $completion;
1199  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTrackedItems()

ilObjSCORMLearningModule::getTrackedItems ( )

get all tracked items of current user

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

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

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  }
global $DIC
Definition: shib_login.php:22
SCORM Item.
+ Here is the call graph for this function:

◆ getTrackedUsers()

ilObjSCORMLearningModule::getTrackedUsers ( string  $a_search)

Return the last access timestamp for a given user.

Parameters
int$a_obj_idobject id
int$user_iduser id
Returns
timestamp

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

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

258  : array
259  {
260  global $DIC;
261  $ilDB = $DIC->database();
262  $ilUser = $DIC->user();
263  //TODO: UK last_access is not correct if no Commit or last_visited_sco
264  // $query = 'SELECT user_id,MAX(c_timestamp) last_access, lastname, firstname FROM scorm_tracking st ' .
265  $query = 'SELECT user_id, last_access, lastname, firstname FROM sahs_user st ' .
266  'JOIN usr_data ud ON st.user_id = ud.usr_id ' .
267  'WHERE obj_id = ' . $ilDB->quote($this->getId(), 'integer');
268  if ($a_search) {
269  // $query .= ' AND (' . $ilDB->like('lastname', 'text', '%' . $a_search . '%') . ' OR ' . $ilDB->like('firstname', 'text', '%' . $a_search . '%') .')';
270  $query .= ' AND ' . $ilDB->like('lastname', 'text', '%' . $a_search . '%');
271  }
272  $query .= ' GROUP BY user_id, lastname, firstname, last_access';
273  $sco_set = $ilDB->query($query);
274 
275  $items = array();
276  while ($sco_rec = $ilDB->fetchAssoc($sco_set)) {
277  $items[] = $sco_rec;
278  }
279  return $items;
280  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ getTrackingDataAgg()

ilObjSCORMLearningModule::getTrackingDataAgg ( int  $a_user_id)

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

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

390  : array
391  {
392  global $DIC;
393  $ilDB = $DIC->database();
394 
395  // get all users with any tracking data
396  $sco_set = $ilDB->queryF(
397  '
398  SELECT DISTINCT sco_id FROM scorm_tracking
399  WHERE obj_id = %s
400  AND user_id = %s
401  AND sco_id <> %s',
402  array('integer','integer','integer'),
403  array($this->getId(),$a_user_id,0)
404  );
405 
406  $data = array();
407  while ($sco_rec = $ilDB->fetchAssoc($sco_set)) {
408  $data_set = $ilDB->queryF(
409  '
410  SELECT * FROM scorm_tracking
411  WHERE obj_id = %s
412  AND sco_id = %s
413  AND user_id = %s
414  AND lvalue <> %s
415  AND (lvalue = %s
416  OR lvalue = %s
417  OR lvalue = %s)',
418  array('integer','integer','integer','text','text','text','text'),
419  array($this->getId(),
420  $sco_rec["sco_id"],
421  $a_user_id,
422  "package_attempts",
423  "cmi.core.lesson_status",
424  "cmi.core.total_time",
425  "cmi.core.score.raw")
426  );
427 
428  $score = $time = $status = "";
429 
430  while ($data_rec = $ilDB->fetchAssoc($data_set)) {
431  switch ($data_rec["lvalue"]) {
432  case "cmi.core.lesson_status":
433  $status = $data_rec["rvalue"];
434  break;
435 
436  case "cmi.core.total_time":
437  $time = $data_rec["rvalue"];
438  break;
439 
440  case "cmi.core.score.raw":
441  $score = $data_rec["rvalue"];
442  break;
443  }
444  }
445  $sc_item = new ilSCORMItem((int) $sco_rec["sco_id"]);
446  $data[] = array("sco_id" => (int) $sco_rec["sco_id"], "title" => $sc_item->getTitle(),
447  "score" => $score, "time" => $time, "status" => $status);
448  }
449  return (array) $data;
450  }
global $DIC
Definition: shib_login.php:22
SCORM Item.
+ Here is the call graph for this function:

◆ getTrackingDataAggSco()

ilObjSCORMLearningModule::getTrackingDataAggSco ( int  $a_sco_id)

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

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

452  : array
453  {
454  global $DIC;
455  $ilDB = $DIC->database();
456 
457  // get all users with any tracking data
458  $user_set = $ilDB->queryF(
459  '
460  SELECT DISTINCT user_id FROM scorm_tracking
461  WHERE obj_id = %s
462  AND sco_id = %s',
463  array('integer','integer'),
464  array($this->getId(),$a_sco_id)
465  );
466 
467  $data = array();
468  while ($user_rec = $ilDB->fetchAssoc($user_set)) {
469  $data_set = $ilDB->queryF(
470  '
471  SELECT * FROM scorm_tracking
472  WHERE obj_id = %s
473  AND sco_id = %s
474  AND user_id = %s
475  AND (lvalue = %s
476  OR lvalue = %s
477  OR lvalue = %s)',
478  array('integer','integer','integer','text','text','text'),
479  array($this->getId(),
480  $a_sco_id,
481  $user_rec["user_id"],
482  "cmi.core.lesson_status",
483  "cmi.core.total_time",
484  "cmi.core.score.raw")
485  );
486 
487  $score = $time = $status = "";
488 
489  while ($data_rec = $ilDB->fetchAssoc($data_set)) {
490  switch ($data_rec["lvalue"]) {
491  case "cmi.core.lesson_status":
492  $status = $data_rec["rvalue"];
493  break;
494 
495  case "cmi.core.total_time":
496  $time = $data_rec["rvalue"];
497  break;
498 
499  case "cmi.core.score.raw":
500  $score = $data_rec["rvalue"];
501  break;
502  }
503  }
504 
505  $data[] = array("user_id" => $user_rec["user_id"],
506  "score" => $score, "time" => $time, "status" => $status);
507  }
508 
509  return $data;
510  }
global $DIC
Definition: shib_login.php:22
+ 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 366 of file class.ilObjSCORMLearningModule.php.

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

366  : array
367  {
368  global $DIC;
369  $ilDB = $DIC->database();
370 
371  $data_set = $ilDB->queryF(
372  '
373  SELECT * FROM scorm_tracking
374  WHERE user_id = %s
375  AND sco_id = %s
376  AND obj_id = %s
377  ORDER BY lvalue',
378  array('integer','integer','integer'),
379  array($a_user_id,$a_sco_id,$this->getId())
380  );
381 
382  $data = array();
383  while ($data_rec = $ilDB->fetchAssoc($data_set)) {
384  $data[] = $data_rec;
385  }
386 
387  return $data;
388  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ getTrackingItems()

ilObjSCORMLearningModule::getTrackingItems ( )

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

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

42  : array
43  {
45  }
static _getTrackingItems(int $a_obj_id)
get all tracking items of scorm object
+ 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 1007 of file class.ilObjSCORMLearningModule.php.

References $DIC, and $ilDB.

1007  : int
1008  {
1009  global $DIC;
1010  $ilDB = $DIC->database();
1011  $ilUser = $DIC->user();
1012 
1013  $val_set = $ilDB->queryF(
1014  'SELECT usr_id FROM usr_data WHERE(email=%s)',
1015  array('text'),
1016  array($a_mail)
1017  );
1018  $val_rec = $ilDB->fetchAssoc($val_set);
1019 
1020 
1021  return (int) $val_rec["usr_id"];
1022  }
global $DIC
Definition: shib_login.php:22

◆ importRaw()

ilObjSCORMLearningModule::importRaw ( string  $a_file)
private

Import raw data.

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

References $data, $DIC, $ilDB, ilObject\$lng, $user_id, ilLPStatus\_lookupPercentage(), ilLPStatus\_lookupStatus(), ilLPStatusWrapper\_refreshStatus(), get_user_id(), ilObject\getId(), importSuccessForSahsUser(), ILIAS\Repository\int(), ilLanguage\loadLanguageModule(), lookupSCOId(), null, parseUserId(), and ilLanguage\txt().

Referenced by importTrackingData().

797  : bool
798  {
799  global $DIC;
800  $ilDB = $DIC->database();
801  $ilUser = $DIC->user();
802  $lng = $DIC->language();
803  $lng->loadLanguageModule("scormtrac");
804 
805  $fhandle = fopen($a_file, "r");
806 
807  $fields = fgetcsv($fhandle, 2 ** 16, ';', '"', '\\');
808  $users = array();
809  $a_last_access = array();
810  $a_time = array();
811  $a_package_attempts = array();
812  $a_module_version = array();
813  while (($csv_rows = fgetcsv($fhandle, 2 ** 16, ";", '"', '\\')) !== false) {
814  $data = array_combine($fields, $csv_rows);
815  if ($data['Userid']) {
816  $user_id = $this->parseUserId($data['Userid']);
817  } elseif ($data[$lng->txt("user")]) {
818  if (is_int($data[$lng->txt("user")])) {
819  $user_id = $data[$lng->txt("user")];
820  }
821  }
822  if ($data[$lng->txt("login")]) {
823  $user_id = $this->get_user_id($data[$lng->txt("login")]);
824  }
825  if (!$user_id) {
826  continue;
827  }
828 
829  if ($data['Scoid']) {
830  $il_sco_id = $this->lookupSCOId($data['Scoid']);
831  }
832  if ($data[$lng->txt("identifierref")]) {
833  $il_sco_id = $this->lookupSCOId($data[$lng->txt("identifierref")]);
834  }
835  if (!$il_sco_id) {
836  continue;
837  }
838 
839  $c_timestamp = "";
840  if ($data['Timestamp']) {
841  $c_timestamp = $data['Timestamp'];
842  }
843  if ($data[$lng->txt("c_timestamp")]) {
844  $c_timestamp = $data[$lng->txt("c_timestamp")];
845  }
846  if ($c_timestamp == "") {
847  $date = new DateTime();
848  $c_timestamp = $date->getTimestamp();
849  } else {
850  if ($a_last_access[$user_id]) {
851  if ($a_last_access[$user_id] < $c_timestamp) {
852  $a_last_access[$user_id] = $c_timestamp;
853  }
854  } else {
855  $a_last_access[$user_id] = $c_timestamp;
856  }
857  }
858 
859  if (!$data['Key']) {
860  continue;
861  }
862  if (!$data['Value']) {
863  $data['Value'] = "";
864  }
865 
866  if ($data['Key'] === "cmi.core.total_time" && $data['Value'] != "") {
867  $tarr = explode(":", $data['Value']);
868  $sec = (int) $tarr[2] + (int) $tarr[1] * 60 +
869  (int) substr($tarr[0], strlen($tarr[0]) - 3) * 60 * 60;
870  if ($a_time[$user_id]) {
871  $a_time[$user_id] += $sec;
872  } else {
873  $a_time[$user_id] = $sec;
874  }
875  }
876  //do the actual import
877  if ($il_sco_id > 0) {
878  $statement = $ilDB->queryF(
879  '
880  SELECT * FROM scorm_tracking
881  WHERE user_id = %s
882  AND sco_id = %s
883  AND lvalue = %s
884  AND obj_id = %s',
885  array('integer', 'integer', 'text', 'integer'),
886  array($user_id, $il_sco_id, $data['Key'], $this->getID())
887  );
888  if ($ilDB->numRows($statement) > 0) {
889  $ilDB->update(
890  'scorm_tracking',
891  array(
892  'rvalue' => array('clob', $data['Value']),
893  'c_timestamp' => array('timestamp', $c_timestamp)
894  ),
895  array(
896  'user_id' => array('integer', $user_id),
897  'sco_id' => array('integer', $il_sco_id),
898  'lvalue' => array('text', $data['Key']),
899  'obj_id' => array('integer', $this->getId())
900  )
901  );
902  } else {
903  $ilDB->insert('scorm_tracking', array(
904  'obj_id' => array('integer', $this->getId()),
905  'user_id' => array('integer', $user_id),
906  'sco_id' => array('integer', $il_sco_id),
907  'lvalue' => array('text', $data['Key']),
908  'rvalue' => array('clob', $data['Value']),
909  'c_timestamp' => array('timestamp', $data['Timestamp'])
910  ));
911  }
912  }
913  // $package_attempts = 1;
914  if ($il_sco_id == 0) {
915  if ($data['Key'] === "package_attempts") {
916  $a_package_attempts[$user_id] = $data['Value'];
917  }
918  // if ($data['Key'] == "module_version") $a_module_version[$user_id] = $data['Value'];
919  }
920  if (!in_array($user_id, $users)) {
921  $users[] = $user_id;
922  }
923  }
924  fclose($fhandle);
925  ilLPStatusWrapper::_refreshStatus($this->getId(), $users);
926  foreach ($users as $user_id) {
927  $attempts = 1;
928  if ($a_package_attempts[$user_id]) {
929  $attempts = $a_package_attempts[$user_id];
930  }
931  // $module_version = 1;
932  // if ($a_module_version[$user_id]) $module_version = $a_module_version[$user_id];
933  $sco_total_time_sec = null;
934  if ($a_time[$user_id]) {
935  $sco_total_time_sec = $a_time[$user_id];
936  }
937  $last_access = null;
938  if ($a_last_access[$user_id]) {
939  $last_access = $a_last_access[$user_id];
940  }
941  // $status = ilLPStatusWrapper::_determineStatus($this->getId(),$user_id);
942  $status = (int) ilLPStatus::_lookupStatus($this->getId(), $user_id);
943  // $percentage_completed = ilLPStatusSCORM::determinePercentage($this->getId(),$user_id);
944  $percentage_completed = ilLPStatus::_lookupPercentage($this->getId(), $user_id);
945 
946  $this->importSuccessForSahsUser($user_id, $last_access, $status, $attempts, $percentage_completed, $sco_total_time_sec);
947  }
948 
949  return true;
950  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
importSuccessForSahsUser(int $user_id, string $last_access, int $status, ?int $attempts=null, ?int $percentage_completed=null, ?int $sco_total_time_sec=null)
static _lookupPercentage(int $a_obj_id, int $a_user_id)
Lookup percentage.
loadLanguageModule(string $a_module)
Load language module.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
lookupSCOId(string $a_referrer)
resolves manifest SCOID to internal ILIAS SCO ID
ilLanguage $lng
global $DIC
Definition: shib_login.php:22
static _refreshStatus(int $a_obj_id, ?array $a_users=null)
static _lookupStatus(int $a_obj_id, int $a_user_id, bool $a_create=true)
Lookup status.
parseUserId(string $il_id)
Parse il_usr_123_6 id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importSuccess()

ilObjSCORMLearningModule::importSuccess ( string  $a_file)

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

References $data, $DIC, $ilDB, $user_id, ilLPStatusWrapper\_refreshStatus(), deleteTrackingDataOfUsers(), get_user_id(), ilObject\getId(), ilObjectLP\getInstance(), importSuccessForSahsUser(), ILIAS\Repository\int(), 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, ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM, ilUtil\now(), and null.

Referenced by importTrackingData().

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

◆ importSuccessForSahsUser()

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

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

References $DIC, $ilDB, $user_id, ilChangeEvent\_lookupReadEvents(), and ilChangeEvent\_recordReadEvent().

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

730  : void {
731  global $DIC;
732  $ilDB = $DIC->database();
733  $statement = $ilDB->queryF(
734  'SELECT * FROM sahs_user WHERE obj_id = %s AND user_id = %s',
735  array('integer','integer'),
736  array($this->getID(),$user_id)
737  );
738  if ($ilDB->numRows($statement) > 0) {
739  $ilDB->update(
740  'sahs_user',
741  array(
742  'last_access' => array('timestamp', $last_access),
743  'status' => array('integer', $status),
744  'package_attempts' => array('integer', $attempts),
745  'percentage_completed' => array('integer', $percentage_completed),
746  'sco_total_time_sec' => array('integer', $sco_total_time_sec)
747  ),
748  array(
749  'obj_id' => array('integer', $this->getID()),
750  'user_id' => array('integer', $user_id)
751  )
752  );
753  } else {
754  $ilDB->insert('sahs_user', array(
755  'obj_id' => array('integer', $this->getID()),
756  'user_id' => array('integer', $user_id),
757  'last_access' => array('timestamp', $last_access),
758  'status' => array('integer', $status),
759  'package_attempts' => array('integer', $attempts),
760  'percentage_completed' => array('integer', $percentage_completed),
761  'sco_total_time_sec' => array('integer', $sco_total_time_sec)
762  ));
763  }
764  // since 8 necessary because attempts can be null
765  if (ilChangeEvent::_lookupReadEvents($this->getID(), $user_id) == []) {
766  ilChangeEvent::_recordReadEvent("sahs", $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int()), $this->getID(), $user_id, false);
767  }
768 
769  ilChangeEvent::_recordReadEvent("sahs", $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int()), $this->getID(), $user_id, false, $attempts, $sco_total_time_sec);
770  }
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
global $DIC
Definition: shib_login.php:22
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importTrackingData()

ilObjSCORMLearningModule::importTrackingData ( string  $a_file)

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

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

554  : bool
555  {
556  global $DIC;
557  $ilDB = $DIC->database();
558  $ilUser = $DIC->user();
559 
560  $success = false;
561  //echo file_get_contents($a_file);
562  $method = null;
563 
564  //lets import
565  $fhandle = fopen($a_file, "r");
566 
567  //the top line is the field names
568  $fields = fgetcsv($fhandle, 2 ** 16, ';', '"', '\\');
569  //lets check the import method
570  fclose($fhandle);
571 
572  switch ($fields[0]) {
573  case "Scoid":
574  case "SCO-Identifier":
575  $success = $this->importRaw($a_file);
576  break;
577  case "Department":
578  case "LearningModuleId":
579  $success = $this->importSuccess($a_file);
580  break;
581  default:
582  return false;
583  }
584  return $success;
585  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
importRaw(string $a_file)
Import raw data.
+ Here is the call graph for this function:

◆ lookupSCOId()

ilObjSCORMLearningModule::lookupSCOId ( string  $a_referrer)
private

resolves manifest SCOID to internal ILIAS SCO ID

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

References $DIC, and $ilDB.

Referenced by importRaw().

979  : int
980  {
981  global $DIC;
982  $ilDB = $DIC->database();
983  $ilUser = $DIC->user();
984 
985  //non specific SCO entries
986  if ($a_referrer == "0") {
987  return 0;
988  }
989 
990  $val_set = $ilDB->queryF(
991  '
992  SELECT obj_id FROM sc_item,scorm_tree
993  WHERE (obj_id = child
994  AND identifierref = %s
995  AND slm_id = %s)',
996  array('text','integer'),
997  array($a_referrer,$this->getID())
998  );
999  $val_rec = $ilDB->fetchAssoc($val_set);
1000 
1001  return (int) $val_rec["obj_id"];
1002  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ parseUserId()

ilObjSCORMLearningModule::parseUserId ( string  $il_id)
private

Parse il_usr_123_6 id.

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

References $DIC, $ilSetting, and $parts.

Referenced by importRaw().

775  : int
776  {
777  global $DIC;
778  $ilSetting = $DIC->settings();
779 
780  $parts = explode('_', $il_id);
781 
782  if (!count((array) $parts)) {
783  return 0;
784  }
785  if (!isset($parts[2]) or !isset($parts[3])) {
786  return 0;
787  }
788  if ($parts[2] != $ilSetting->get('inst_id', $parts[2])) {
789  return 0;
790  }
791  return (int) $parts[3];
792  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
global $DIC
Definition: shib_login.php:22
global $ilSetting
Definition: privfeed.php:31
+ Here is the caller graph for this function:

◆ readObject()

ilObjSCORMLearningModule::readObject ( )

read manifest file

Exceptions
ilSaxParserException

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

References $DIC, $ilErr, ilObjSAHSLearningModule\getDataDirectory(), and ILIAS\Repository\lng().

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  }
$ilErr
Definition: raiseError.php:33
global $DIC
Definition: shib_login.php:22
getDataDirectory(?string $mode="filesystem")
get data directory of lm
+ 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 1028 of file class.ilObjSCORMLearningModule.php.

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

Referenced by exportSelected().

1028  : void
1029  {
1030  $timestamp = time();
1031  $refid = $this->getRefId();
1032  $filename = "scorm_tracking_" . $refid . "_" . $timestamp . ".csv";
1033  ilUtil::deliverData($a_header . $a_content, $filename);
1034  exit;
1035  }
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
$filename
Definition: buildRTE.php:78
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ 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.

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

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  }
global $DIC
Definition: shib_login.php:22
$lm_set
global $ilSetting
Definition: privfeed.php:31
+ Here is the call graph for this function:

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