ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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)
 
 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=true)
 

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)

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

References $DIC, and $ilDB.

37  {
38  global $DIC;
39 
40  $ilDB = $DIC['ilDB'];
41 
42  parent::__construct($a_obj_id);
43  $this->db = $ilDB;
44  }
global $DIC
Definition: saml.php:7
global $ilDB

Member Function Documentation

◆ _getCompleted()

static ilLPStatusSCORMPackage::_getCompleted (   $a_obj_id)
static

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

References $users, and ilLPStatusWrapper\_getStatusInfo().

54  {
55  $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
56  $users = $status_info['completed'];
57  return array_unique($users);
58  }
static _getStatusInfo($a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
$users
Definition: authpage.php:44
+ Here is the call graph for this function:

◆ _getFailed()

static ilLPStatusSCORMPackage::_getFailed (   $a_obj_id)
static

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

References $users, and ilLPStatusWrapper\_getStatusInfo().

61  {
62  $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
63  $users = $status_info['failed'];
64  return array_unique($users);
65  }
static _getStatusInfo($a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
$users
Definition: authpage.php:44
+ Here is the call graph for this function:

◆ _getInProgress()

static ilLPStatusSCORMPackage::_getInProgress (   $a_obj_id)
static

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

References $users, and ilLPStatusWrapper\_getStatusInfo().

47  {
48  $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
49  $users = $status_info['in_progress'];
50  return array_unique($users);
51  }
static _getStatusInfo($a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
$users
Definition: authpage.php:44
+ Here is the call graph for this function:

◆ _getStatusInfo()

static ilLPStatusSCORMPackage::_getStatusInfo (   $a_obj_id)
static

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

References $info, and ilSCORM2004Tracking\_getProgressInfo().

69  {
70  include_once './Modules/Scorm2004/classes/class.ilSCORM2004Tracking.php';
71  $status_info['subtype'] = "scorm2004";
73 
74  $status_info['completed'] = $info['completed'];
75  $status_info['failed'] = $info['failed'];
76  $status_info['in_progress'] = $info['in_progress'];
77 
78  return $status_info;
79  }
static _getProgressInfo($a_obj_id)
Get overall scorm status.
$info
Definition: index.php:5
+ 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

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

150  {
151  return null;//todo!
152  }

◆ 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

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

References $DIC, $ilDB, $ilLog, and ilSCORM2004Tracking\_getProgressInfoOfUser().

90  {
91  global $DIC;
92 
93  $ilObjDataCache = $DIC['ilObjDataCache'];
94  $ilDB = $DIC['ilDB'];
95  $ilLog = $DIC['ilLog'];
96 
97  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Tracking.php");
98  $scorm_status = ilSCORM2004Tracking::_getProgressInfoOfUser($a_obj_id, $a_user_id);
99  $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
100  switch ($scorm_status) {
101  case "in_progress":
102  $status = self::LP_STATUS_IN_PROGRESS_NUM;
103  break;
104  case "completed":
105  $status = self::LP_STATUS_COMPLETED_NUM;
106  break;
107  case "failed":
108  $status = self::LP_STATUS_FAILED_NUM;
109  break;
110  }
111 
112  return $status;
113  }
global $DIC
Definition: saml.php:7
static _getProgressInfoOfUser($a_obj_id, $a_user_id)
Get overall scorm status.
global $ilDB
+ Here is the call graph for this function:

◆ refreshStatus()

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

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

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

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

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