ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilLPStatusSCORMPackage Class Reference
+ Inheritance diagram for ilLPStatusSCORMPackage:
+ Collaboration diagram for ilLPStatusSCORMPackage:

Public Member Functions

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

Static Public Member Functions

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

Additional Inherited Members

- Data Fields inherited from ilLPStatus
 $obj_id = null
 
 $db = null
 
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 ($a_obj_id, $a_usr_id, $a_status, $a_percentage)
 
static _lookupStatusForObject ($a_obj_id, $a_status, $a_user_ids=null)
 Get users with given status for object. More...
 
static validateLPForObjects ($a_user_id, $a_obj_ids, $a_parent_ref_id)
 Process given objects for lp-relevance. More...
 
static checkLPModesForObjects ($a_obj_ids, array &$a_coll_obj_ids)
 Process lp modes for given objects. More...
 
static getLPStatusForObjects ($a_user_id, $a_obj_ids)
 Get LP status for given objects (and user) More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLPStatusSCORMPackage::__construct (   $a_obj_id)

Reimplemented from ilLPStatus.

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

37 {
38 global $ilDB;
39
40 parent::__construct($a_obj_id);
41 $this->db = $ilDB;
42 }
global $ilDB

References $ilDB.

Member Function Documentation

◆ _getCompleted()

static ilLPStatusSCORMPackage::_getCompleted (   $a_obj_id)
static

Reimplemented from ilLPStatus.

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

52 {
53 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
54 $users = $status_info['completed'];
55 return array_unique($users);
56 }
$users
Definition: authpage.php:44
static _getStatusInfo($a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.

References $users, and ilLPStatusWrapper\_getStatusInfo().

+ Here is the call graph for this function:

◆ _getFailed()

static ilLPStatusSCORMPackage::_getFailed (   $a_obj_id)
static

Reimplemented from ilLPStatus.

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

59 {
60 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
61 $users = $status_info['failed'];
62 return array_unique($users);
63 }

References $users, and ilLPStatusWrapper\_getStatusInfo().

+ Here is the call graph for this function:

◆ _getInProgress()

static ilLPStatusSCORMPackage::_getInProgress (   $a_obj_id)
static

Reimplemented from ilLPStatus.

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

45 {
46 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
47 $users = $status_info['in_progress'];
48 return array_unique($users);
49 }

References $users, and ilLPStatusWrapper\_getStatusInfo().

+ Here is the call graph for this function:

◆ _getStatusInfo()

static ilLPStatusSCORMPackage::_getStatusInfo (   $a_obj_id)
static

Reimplemented from ilLPStatus.

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

67 {
68 include_once './Modules/Scorm2004/classes/class.ilSCORM2004Tracking.php';
69 $status_info['subtype'] = "scorm2004";
71
72 $status_info['completed'] = $info['completed'];
73 $status_info['failed'] = $info['failed'];
74 $status_info['in_progress'] = $info['in_progress'];
75
76 return $status_info;
77 }
static _getProgressInfo($a_obj_id)
Get overall scorm status.
$info
Definition: index.php:5

References $info, and ilSCORM2004Tracking\_getProgressInfo().

+ Here is the call graph for this function:

◆ determinePercentage()

ilLPStatusSCORMPackage::determinePercentage (   $a_obj_id,
  $a_user_id,
  $a_obj = null 
)

Determine percentage.

Parameters
integerobject id
integeruser id
objectobject (optional depends on object type)
Returns
integer percentage

Reimplemented from ilLPStatus.

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

144 {
145 return null;//todo!
146 }

◆ determineStatus()

ilLPStatusSCORMPackage::determineStatus (   $a_obj_id,
  $a_user_id,
  $a_obj = null 
)

Determine status.

Parameters
integerobject id
integeruser id
objectobject (optional depends on object type)
Returns
integer status

Reimplemented from ilLPStatus.

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

88 {
89 global $ilObjDataCache, $ilDB, $ilLog;
90
91 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Tracking.php");
92 $scorm_status = ilSCORM2004Tracking::_getProgressInfoOfUser($a_obj_id, $a_user_id);
94 switch ($scorm_status) {
95 case "in_progress":
97 break;
98 case "completed":
100 break;
101 case "failed":
103 break;
104 }
105
106 return $status;
107 }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM
static _getProgressInfoOfUser($a_obj_id, $a_user_id)
Get overall scorm status.

References $ilDB, $ilLog, ilSCORM2004Tracking\_getProgressInfoOfUser(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

+ Here is the call graph for this function:

◆ refreshStatus()

ilLPStatusSCORMPackage::refreshStatus (   $a_obj_id,
  $a_users = null 
)

Refresh status.

Parameters

return

Reimplemented from ilLPStatus.

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

110 {
111 parent::refreshStatus($a_obj_id, $a_users);
112
113 include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
114 $in_progress = ilLPStatusWrapper::_getInProgress($a_obj_id);
115 $completed = ilLPStatusWrapper::_getCompleted($a_obj_id);
117 $all_active_users = array_unique(array_merge($in_progress, $completed, $failed));
118
119 // get all tracked users regardless of SCOs
120 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Tracking.php");
121 $all_tracked_users = ilSCORM2004Tracking::_getTrackedUsers($a_obj_id);
122
123 $not_attempted_users = array_diff($all_tracked_users, $all_active_users);
124 unset($all_tracked_users);
125 unset($all_active_users);
126
127 // reset all users which have no data for the current SCOs
128 if ($not_attempted_users) {
129 foreach ($not_attempted_users as $usr_id) {
130 // this will update any (parent) collections if necessary
131 ilLPStatus::writeStatus($a_obj_id, $usr_id, self::LP_STATUS_NOT_ATTEMPTED_NUM, 0);
132 }
133 }
134 }
$failed
Definition: Utf8Test.php:85
static _getCompleted($a_obj_id)
Static function to read the users who have the status 'completed'.
static _getInProgress($a_obj_id)
Static function to read users who have the status 'in_progress'.
static _getFailed($a_obj_id)
Static function to read the users who have the status 'completed'.
static writeStatus($a_obj_id, $a_user_id, $a_status, $a_percentage=false, $a_force_per=false)
Write status for user and object.
static _getTrackedUsers($a_obj_id)
Get all tracked users.

References $failed, 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: