ILIAS  release_8 Revision v8.24
ilLPStatusSCORMPackage Class Reference
+ Inheritance diagram for ilLPStatusSCORMPackage:
+ Collaboration diagram for ilLPStatusSCORMPackage:

Public Member Functions

 determineStatus (int $a_obj_id, int $a_usr_id, object $a_obj=null)
 Determine status. More...
 
 refreshStatus (int $a_obj_id, ?array $a_users=null)
 Refresh status. More...
 
 determinePercentage (int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
 
- Public Member Functions inherited from ilLPStatus
 __construct (int $a_obj_id)
 
 _updateStatus (int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
 New status handling (st: status, nr: accesses, p: percentage, t: time spent, m: mark) Learning progress: More...
 
 determinePercentage (int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
 
 determineStatus (int $a_obj_id, int $a_usr_id, object $a_obj=null)
 
 refreshStatus (int $a_obj_id, ?array $a_users=null)
 Refresh status. More...
 

Static Public Member Functions

static _getInProgress (int $a_obj_id)
 
static _getCompleted (int $a_obj_id)
 
static _getFailed (int $a_obj_id)
 
static _getStatusInfo (int $a_obj_id)
 
- Static Public Member Functions inherited from ilLPStatus
static _getCountNotAttempted (int $a_obj_id)
 
static _getNotAttempted (int $a_obj_id)
 
static _getCountInProgress (int $a_obj_id)
 
static _getInProgress (int $a_obj_id)
 
static _getCountCompleted (int $a_obj_id)
 
static _getCompleted (int $a_obj_id)
 
static _getFailed (int $a_obj_id)
 
static _getCountFailed (int $a_obj_id)
 
static _getStatusInfo (int $a_obj_id)
 
static _getTypicalLearningTime (int $a_obj_id)
 
static checkStatusForObject (int $a_obj_id, ?array $a_users=null)
 This function checks whether the status for a given number of users is dirty and must be recalculated. More...
 
static writeStatus (int $a_obj_id, int $a_user_id, int $a_status, int $a_percentage=0, bool $a_force_per=false, ?int &$a_old_status=self::LP_STATUS_NOT_ATTEMPTED_NUM)
 Write status for user and object. More...
 
static setInProgressIfNotAttempted (int $a_obj_id, int $a_user_id)
 This function shoudl be clalled for normal "read events". More...
 
static setAllDirty ()
 Sets all status to dirty. More...
 
static setDirty (int $a_obj_id)
 Sets status of an object to dirty. More...
 
static _lookupStatus (int $a_obj_id, int $a_user_id, bool $a_create=true)
 Lookup status. More...
 
static _lookupPercentage (int $a_obj_id, int $a_user_id)
 Lookup percentage. More...
 
static _hasUserCompleted (int $a_obj_id, int $a_user_id)
 Lookup user object completion. More...
 
static _lookupStatusChanged (int $a_obj_id, int $a_user_id)
 Lookup status changed. More...
 
static _lookupCompletedForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get completed users for object. More...
 
static _lookupFailedForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get failed users for object. More...
 
static _lookupInProgressForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get in progress users for object. More...
 
static preloadListGUIData (array $a_obj_ids)
 
static getListGUIStatus (int $a_obj_id, bool $a_image_only=true)
 
static hasListGUIStatus (int $a_obj_id)
 

Additional Inherited Members

- Data Fields inherited from ilLPStatus
const LP_STATUS_NOT_ATTEMPTED = 'trac_no_attempted'
 
const LP_STATUS_IN_PROGRESS = 'trac_in_progress'
 
const LP_STATUS_COMPLETED = 'trac_completed'
 
const LP_STATUS_FAILED = 'trac_failed'
 
const LP_STATUS_NOT_ATTEMPTED_NUM = 0
 
const LP_STATUS_IN_PROGRESS_NUM = 1
 
const LP_STATUS_COMPLETED_NUM = 2
 
const LP_STATUS_FAILED_NUM = 3
 
const LP_STATUS_REGISTERED = 'trac_registered'
 
const LP_STATUS_NOT_REGISTERED = 'trac_not_registered'
 
const LP_STATUS_PARTICIPATED = 'trac_participated'
 
const LP_STATUS_NOT_PARTICIPATED = 'trac_not_participated'
 
- Static Public Attributes inherited from ilLPStatus
static $list_gui_cache
 
- Static Protected Member Functions inherited from ilLPStatus
static raiseEvent (int $a_obj_id, int $a_usr_id, int $a_status, int $a_old_status, int $a_percentage)
 
static _lookupStatusForObject (int $a_obj_id, int $a_status, ?array $a_user_ids=null)
 Get users with given status for object. More...
 
static validateLPForObjects (int $a_user_id, array $a_obj_ids, int $a_parent_ref_id)
 Process given objects for lp-relevance. More...
 
static checkLPModesForObjects (array $a_obj_ids, array &$a_coll_obj_ids)
 Process lp modes for given objects. More...
 
static getLPStatusForObjects (int $a_user_id, array $a_obj_ids)
 Get LP status for given objects (and user) More...
 
- Protected Attributes inherited from ilLPStatus
int $obj_id
 
ilDBInterface $db
 
ilObjectDataCache $ilObjDataCache
 

Detailed Description

Definition at line 27 of file class.ilLPStatusSCORMPackage.php.

Member Function Documentation

◆ _getCompleted()

static ilLPStatusSCORMPackage::_getCompleted ( int  $a_obj_id)
static
Parameters
int$a_obj_id
Returns
int[]

Reimplemented from ilLPStatus.

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

36 : array
37 {
38 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
39 $users = $status_info['completed'];
40 return array_unique($users);
41 }
static _getStatusInfo(int $a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.

References ilLPStatusWrapper\_getStatusInfo().

+ Here is the call graph for this function:

◆ _getFailed()

static ilLPStatusSCORMPackage::_getFailed ( int  $a_obj_id)
static
Parameters
int$a_obj_id
Returns
int[]

Reimplemented from ilLPStatus.

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

43 : array
44 {
45 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
46 $users = $status_info['failed'];
47 return array_unique($users);
48 }

References ilLPStatusWrapper\_getStatusInfo().

+ Here is the call graph for this function:

◆ _getInProgress()

static ilLPStatusSCORMPackage::_getInProgress ( int  $a_obj_id)
static

Reimplemented from ilLPStatus.

Definition at line 29 of file class.ilLPStatusSCORMPackage.php.

29 : array
30 {
31 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
32 $users = $status_info['in_progress'];
33 return array_unique($users);
34 }

References ilLPStatusWrapper\_getStatusInfo().

+ Here is the call graph for this function:

◆ _getStatusInfo()

static ilLPStatusSCORMPackage::_getStatusInfo ( int  $a_obj_id)
static

Reimplemented from ilLPStatus.

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

50 : array
51 {
52 $status_info['subtype'] = "scorm2004";
54
55 $status_info['completed'] = $info['completed'];
56 $status_info['failed'] = $info['failed'];
57 $status_info['in_progress'] = $info['in_progress'];
58
59 return $status_info;
60 }
static _getProgressInfo(int $a_obj_id)
Get overall scorm status.

References ilSCORM2004Tracking\_getProgressInfo().

+ Here is the call graph for this function:

◆ determinePercentage()

ilLPStatusSCORMPackage::determinePercentage ( int  $a_obj_id,
int  $a_usr_id,
?object  $a_obj = null 
)

Reimplemented from ilLPStatus.

Definition at line 135 of file class.ilLPStatusSCORMPackage.php.

139 : int {
140 return 0;//todo!
141 }

◆ determineStatus()

ilLPStatusSCORMPackage::determineStatus ( int  $a_obj_id,
int  $a_usr_id,
object  $a_obj = null 
)

Determine status.

Parameters
intobject id
intuser id
objectobject (optional depends on object type)
Returns
int status

Reimplemented from ilLPStatus.

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

73 : int {
74 global $DIC;
75
76 $ilObjDataCache = $DIC['ilObjDataCache'];
77 $ilDB = $DIC['ilDB'];
78 $ilLog = $DIC['ilLog'];
79
81 $a_obj_id,
82 $a_usr_id
83 );
85 switch ($scorm_status) {
86 case "in_progress":
88 break;
89 case "completed":
91 break;
92 case "failed":
94 break;
95 }
96
97 return $status;
98 }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
ilObjectDataCache $ilObjDataCache
const LP_STATUS_FAILED_NUM
static _getProgressInfoOfUser(int $a_obj_id, int $a_user_id)
Get overall scorm status.
global $DIC
Definition: feed.php:28

◆ refreshStatus()

ilLPStatusSCORMPackage::refreshStatus ( int  $a_obj_id,
?array  $a_users = null 
)

Refresh status.

Reimplemented from ilLPStatus.

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

100 : void
101 {
102 parent::refreshStatus($a_obj_id, $a_users);
103
104 $in_progress = ilLPStatusWrapper::_getInProgress($a_obj_id);
105 $completed = ilLPStatusWrapper::_getCompleted($a_obj_id);
106 $failed = ilLPStatusWrapper::_getFailed($a_obj_id);
107 $all_active_users = array_unique(
108 array_merge($in_progress, $completed, $failed)
109 );
110
111 // get all tracked users regardless of SCOs
112 $all_tracked_users = ilSCORM2004Tracking::_getTrackedUsers($a_obj_id);
113
114 $not_attempted_users = array_diff(
115 $all_tracked_users,
116 $all_active_users
117 );
118 unset($all_tracked_users);
119 unset($all_active_users);
120
121 // reset all users which have no data for the current SCOs
122 if ($not_attempted_users) {
123 foreach ($not_attempted_users as $usr_id) {
124 // this will update any (parent) collections if necessary
126 $a_obj_id,
127 $usr_id,
128 self::LP_STATUS_NOT_ATTEMPTED_NUM,
129 0
130 );
131 }
132 }
133 }
static _getInProgress(int $a_obj_id)
Static function to read users who have the status 'in_progress'.
static _getFailed(int $a_obj_id)
Static function to read the users who have the status 'completed'.
static _getCompleted(int $a_obj_id)
Static function to read the users who have the status 'completed'.
static writeStatus(int $a_obj_id, int $a_user_id, int $a_status, int $a_percentage=0, bool $a_force_per=false, ?int &$a_old_status=self::LP_STATUS_NOT_ATTEMPTED_NUM)
Write status for user and object.
static _getTrackedUsers(int $a_obj_id)
Get all tracked users.

References ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getFailed(), ilLPStatusWrapper\_getInProgress(), ilSCORM2004Tracking\_getTrackedUsers(), and ilLPStatus\writeStatus().

+ Here is the call graph for this function:

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