5 include_once
'Services/Tracking/classes/class.ilLPStatusFactory.php';
40 if (isset(self::$not_attempted_cache[$a_obj_id])) {
41 return self::$not_attempted_cache[$a_obj_id];
45 self::$not_attempted_cache[$a_obj_id] = $class::_getNotAttempted($a_obj_id);
47 return self::$not_attempted_cache[$a_obj_id];
63 if (isset(self::$in_progress_cache[$a_obj_id])) {
64 return self::$in_progress_cache[$a_obj_id];
70 self::$in_progress_cache[$a_obj_id] = $class::_getInProgress($a_obj_id);
72 return self::$in_progress_cache[$a_obj_id];
88 if (isset(self::$completed_cache[$a_obj_id])) {
89 return self::$completed_cache[$a_obj_id];
92 self::$completed_cache[$a_obj_id] = $class::_getCompleted($a_obj_id);
94 return self::$completed_cache[$a_obj_id];
110 if (isset(self::$failed_cache[$a_obj_id])) {
111 return self::$failed_cache[$a_obj_id];
116 self::$failed_cache[$a_obj_id] = $class::_getFailed($a_obj_id);
118 return self::$failed_cache[$a_obj_id];
126 if (isset(self::$info_cache[$a_obj_id])) {
127 return self::$info_cache[$a_obj_id];
131 self::$info_cache[$a_obj_id] = $class::_getStatusInfo($a_obj_id);
132 return self::$info_cache[$a_obj_id];
137 unset(self::$info_cache[$a_obj_id]);
138 unset(self::$failed_cache[$a_obj_id]);
139 unset(self::$completed_cache[$a_obj_id]);
140 unset(self::$in_progress_cache[$a_obj_id]);
141 unset(self::$not_attempted_cache[$a_obj_id]);
149 static $cache =
array();
151 if (isset($cache[$a_obj_id])) {
152 return $cache[$a_obj_id];
156 $cache[$a_obj_id] = $class::_getTypicalLearningTime($a_obj_id);
158 return $cache[$a_obj_id];
176 static $cache =
array();
178 if (isset($cache[$a_obj_id .
'_' .
$a_type])) {
179 return $cache[$a_obj_id .
'_' .
$a_type];
183 $cache[$a_obj_id .
'_' .
$a_type] = $class::_getNotAttempted($a_obj_id);
185 return $cache[$a_obj_id .
'_' .
$a_type];
195 static $cache =
array();
197 if (isset($cache[$a_obj_id .
'_' .
$a_type])) {
198 return $cache[$a_obj_id .
'_' .
$a_type];
202 $cache[$a_obj_id .
'_' .
$a_type] = $class::_getInProgress($a_obj_id);
204 return $cache[$a_obj_id .
'_' .
$a_type];
214 static $cache =
array();
216 if (isset($cache[$a_obj_id .
'_' .
$a_type])) {
217 return $cache[$a_obj_id .
'_' .
$a_type];
221 $cache[$a_obj_id .
'_' .
$a_type] = $class::_getCompleted($a_obj_id);
223 return $cache[$a_obj_id .
'_' .
$a_type];
233 static $cache =
array();
235 if (isset($cache[$a_obj_id .
'_' .
$a_type])) {
236 return $cache[$a_obj_id .
'_' .
$a_type];
240 $cache[$a_obj_id .
'_' .
$a_type] = $class::_getFailed($a_obj_id);
242 return $cache[$a_obj_id .
'_' .
$a_type];
247 static $cache =
array();
249 if (isset($cache[$a_obj_id .
'_' .
$a_type])) {
250 return $cache[$a_obj_id .
'_' .
$a_type];
254 $cache[$a_obj_id .
'_' .
$a_type] = $class::_getStatusInfo($a_obj_id);
256 return $cache[$a_obj_id .
'_' .
$a_type];
265 public static function _updateStatus($a_obj_id, $a_usr_id, $a_obj = null, $a_percentage =
false, $a_force_raise =
false)
268 if (strtolower(get_class($trac_obj)) !=
"illpstatus") {
269 $trac_obj->_updateStatus($a_obj_id, $a_usr_id, $a_obj, $a_percentage, $a_force_raise);
281 $trac_obj->_setDirty($a_obj_id);
293 $trac_obj->refreshStatus($a_obj_id, $a_users);
304 if (isset(self::$status_cache[$a_obj_id][$a_usr_id])) {
305 return self::$status_cache[$a_obj_id][$a_usr_id];
309 $st = $trac_obj->determineStatus($a_obj_id, $a_usr_id);
311 self::$status_cache[$a_obj_id][$a_usr_id] = $st;
318 unset(self::$status_cache[$a_obj_id][$a_usr_id]);
331 return $class::_lookupCompletedForObject($a_obj_id, $a_user_ids);
344 return $class::_lookupFailedForObject($a_obj_id, $a_user_ids);
357 return $class::_lookupInProgressForObject($a_obj_id, $a_user_ids);
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 _getCountCompleted($a_obj_id)
Static function to read the number of user who have the status 'completed'.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
static _lookupFailedForObject($a_obj_id, $a_user_ids=null)
Get failed users for object.
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static _getInstance($a_obj_id, $a_mode=null)
static _getInProgressByType($a_obj_id, $a_type)
static _getCountFailedByType($a_obj_id, $a_type)
static _resetInfoCaches($a_obj_id)
static _getClassById($a_obj_id, $a_mode=null)
static _getNotAttempted($a_obj_id)
Static function to read the number of user who have the status 'not_attempted'.
static _getFailed($a_obj_id)
Static function to read the users who have the status 'completed'.
static $in_progress_cache
static _getFailedByType($a_obj_id, $a_type)
static _getNotAttemptedByType($a_obj_id, $a_type)
static _getCountNotAttempted($a_obj_id)
Static function to read the number of user who have the status 'not_attempted'.
static _getClassByIdAndType($a_obj_id, $a_type)
static _setDirty($a_obj_id)
Set dirty.
Create styles array
The data for the language used.
static _getStatusInfo($a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
static _getCountInProgress($a_obj_id)
Static function to read the number of user who have the status 'in_progress'.
static _getCompletedByType($a_obj_id, $a_type)
static _removeStatusCache($a_obj_id, $a_usr_id)
static _lookupInProgressForObject($a_obj_id, $a_user_ids=null)
Get in progress users for object.
static _getCountCompletedByType($a_obj_id, $a_type)
static $not_attempted_cache
static _getCountFailed($a_obj_id)
Static function to read the number of user who have the status 'failed'.
static _getCountNotAttemptedByType($a_obj_id, $a_type)
Static function to read the number of user who have the status 'not_attempted'.
static _lookupCompletedForObject($a_obj_id, $a_user_ids=null)
Get completed users for object.
Class ilLPStatusWrapper This class is wrapper for all ilLPStatus classes.
static _getStatusInfoByType($a_obj_id, $a_type)
static _getTypicalLearningTime($a_obj_id)
Reads Typical learning time.
static _getCountInProgressByType($a_obj_id, $a_type)
static _determineStatus($a_obj_id, $a_usr_id)
Determine status.