ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilLPStatusCollectionMobs Class Reference
+ Inheritance diagram for ilLPStatusCollectionMobs:
+ Collaboration diagram for ilLPStatusCollectionMobs:

Public Member Functions

 _getInProgress ($a_obj_id)
 
 _getCompleted ($a_obj_id)
 
 _getStatusInfo ($a_parent_obj_id)
 
 determineStatus ($a_obj_id, $a_user_id, $a_obj=null)
 Determine status. More...
 
- Public Member Functions inherited from ilLPStatus
 ilLPStatus ($a_obj_id)
 
 _getCountNotAttempted ($a_obj_id)
 
 _getNotAttempted ($a_obj_id)
 
 _getCountInProgress ($a_obj_id)
 
 _getInProgress ($a_obj_id)
 
 _getCountCompleted ($a_obj_id)
 
 _getCompleted ($a_obj_id)
 
 _getFailed ($a_obj_id)
 
 _getCountFailed ()
 
 _getStatusInfo ($a_obj_id)
 
 _getTypicalLearningTime ($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...
 
 _lookupStatusChanged ($a_obj_id, $a_user_id)
 Lookup status changed. More...
 

Static Protected Member Functions

static getCollectionItems ($a_obj_id, $a_include_titles=false)
 
- Static Protected Member Functions inherited from ilLPStatus
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilLPStatus
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 _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)
 
- 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
 
- Protected Member Functions inherited from ilLPStatus
 raiseEvent ($a_obj_id, $a_usr_id, $a_status, $a_percentage)
 

Detailed Description

Definition at line 11 of file class.ilLPStatusCollectionMobs.php.

Member Function Documentation

◆ _getCompleted()

ilLPStatusCollectionMobs::_getCompleted (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 26 of file class.ilLPStatusCollectionMobs.php.

27 {
28 $users = array();
29
30 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
31 if(is_array($status_info["user_status"]["completed"]))
32 {
33 $users = $status_info["user_status"]["completed"];
34 }
35
36 return $users;
37 }
_getStatusInfo($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:

◆ _getInProgress()

ilLPStatusCollectionMobs::_getInProgress (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 13 of file class.ilLPStatusCollectionMobs.php.

14 {
15 $users = array();
16
17 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
18 if(is_array($status_info["user_status"]["in_progress"]))
19 {
20 $users = $status_info["user_status"]["in_progress"];
21 }
22
23 return $users;
24 }

References ilLPStatusWrapper\_getStatusInfo().

+ Here is the call graph for this function:

◆ _getStatusInfo()

ilLPStatusCollectionMobs::_getStatusInfo (   $a_parent_obj_id)

Reimplemented from ilLPStatus.

Definition at line 39 of file class.ilLPStatusCollectionMobs.php.

40 {
41 global $ilDB;
42
43 $res = array();
44
45 $coll_items = self::getCollectionItems($a_parent_obj_id, true);
46
47 $res["items"] = array_keys($coll_items);
48 if(sizeof($res["items"]))
49 {
50 // titles
51 foreach($coll_items as $mob_id => $item)
52 {
53 $res["item_titles"][$mob_id] = $item["title"];
54 }
55
56 // status per item
57 foreach($res["items"] as $mob_id)
58 {
59 $res["completed"][$mob_id] = array();
60 $res["in_progress"][$mob_id] = array();
61 }
62
63 $set = $ilDB->query("SELECT obj_id, usr_id FROM read_event".
64 " WHERE ".$ilDB->in("obj_id", $res["items"], "", "integer"));
65 while($row = $ilDB->fetchAssoc($set))
66 {
67 $res["completed"][$row["obj_id"]][] = $row["usr_id"];
68 }
69
70 // status per user
71 $tmp = array();
72 foreach($res["items"] as $mob_id)
73 {
74 foreach($res["completed"][$mob_id] as $user_id)
75 {
76 $tmp[$user_id][] = $mob_id;
77 }
78 }
79 foreach($tmp as $user_id => $completed_items)
80 {
81 if(sizeof($completed_items) == sizeof($res["items"]))
82 {
83 $res["user_status"]["completed"][] = $user_id;
84 }
85 else
86 {
87 $res["user_status"]["in_progress"][] = $user_id;
88 }
89 }
90 }
91
92 return $res;
93 }
static getCollectionItems($a_obj_id, $a_include_titles=false)
global $ilDB

References $ilDB, $res, $row, and getCollectionItems().

+ Here is the call graph for this function:

◆ determineStatus()

ilLPStatusCollectionMobs::determineStatus (   $a_obj_id,
  $a_usr_id,
  $a_obj = null 
)

Determine status.

Parameters

return

Reimplemented from ilLPStatus.

Definition at line 126 of file class.ilLPStatusCollectionMobs.php.

127 {
128 global $ilDB;
129
131
132 // an empty collection is always not attempted
133 $items = self::getCollectionItems($a_obj_id);
134 if(sizeof($items))
135 {
136 // process mob status for user
137
138 $found = array();
139
140 $set = $ilDB->query("SELECT obj_id FROM read_event".
141 " WHERE usr_id = ".$ilDB->quote($a_user_id, "integer").
142 " AND ".$ilDB->in("obj_id", $items, "", "integer"));
143 while($row = $ilDB->fetchAssoc($set))
144 {
145 $found[] = $row["obj_id"];
146 }
147
148 if(sizeof($found))
149 {
151
152 if(sizeof($found) == sizeof($items))
153 {
155 }
156 }
157 }
158
159 return $status;
160 }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM

References $ilDB, $row, getCollectionItems(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

+ Here is the call graph for this function:

◆ getCollectionItems()

static ilLPStatusCollectionMobs::getCollectionItems (   $a_obj_id,
  $a_include_titles = false 
)
staticprotected

Definition at line 95 of file class.ilLPStatusCollectionMobs.php.

96 {
97 $res = array();
98
99 include_once './Services/Object/classes/class.ilObjectLP.php';
100 $olp = ilObjectLP::getInstance($a_obj_id);
101 $collection = $olp->getCollectionInstance();
102 if($collection)
103 {
104 $possible = $collection->getPossibleItems();
105
106 // there could be invalid items in the selection
107 $valid = array_intersect($collection->getItems(),
108 array_keys($possible));
109
110 if($a_include_titles)
111 {
112 foreach($valid as $item_id)
113 {
114 $res[$item_id] = $possible[$item_id];
115 }
116 }
117 else
118 {
119 $res = $valid;
120 }
121 }
122
123 return $res;
124 }
static getInstance($a_obj_id)
$valid

References $res, $valid, and ilObjectLP\getInstance().

Referenced by _getStatusInfo(), and determineStatus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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