ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilLPStatusTestFinished Class Reference
+ Inheritance diagram for ilLPStatusTestFinished:
+ Collaboration diagram for ilLPStatusTestFinished:

Public Member Functions

 __construct ($a_obj_id)
 
 determineStatus ($a_obj_id, $a_user_id, $a_obj=null)
 Determine status. 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 _getNotAttempted ($a_obj_id)
 
static getParticipants ($a_obj_id)
 Get participants. More...
 
- 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)
 

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

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 15 of file class.ilLPStatusTestFinished.php.

Constructor & Destructor Documentation

◆ __construct()

ilLPStatusTestFinished::__construct (   $a_obj_id)

Definition at line 18 of file class.ilLPStatusTestFinished.php.

References $ilDB.

19  {
20  global $ilDB;
21 
22  parent::__construct($a_obj_id);
23  $this->db = $ilDB;
24  }
global $ilDB

Member Function Documentation

◆ _getCompleted()

static ilLPStatusTestFinished::_getCompleted (   $a_obj_id)
static

Definition at line 56 of file class.ilLPStatusTestFinished.php.

References $ilDB, $query, $res, $row, array, and ilDBConstants\FETCHMODE_OBJECT.

57  {
58  global $ilDB;
59 
60  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
61 
62  $query = "
63  SELECT active_id, user_fi, COUNT(tst_sequence.active_fi) sequences
64  FROM tst_active
65  LEFT JOIN tst_sequence
66  ON tst_sequence.active_fi = tst_active.active_id
67  WHERE tries > {$ilDB->quote(0, "integer")}
68  AND test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id))}
69  GROUP BY active_id, user_fi
70  HAVING COUNT(tst_sequence.active_fi) > {$ilDB->quote(0, "integer")}
71  ";
72 
73  $res = $ilDB->query($query);
74 
75  $user_ids = array();
76 
77  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
78  {
79  $user_ids[$row->user_fi] = $row->user_fi;
80  }
81 
82  return array_values($user_ids);
83  }
Create styles array
The data for the language used.
global $ilDB

◆ _getInProgress()

static ilLPStatusTestFinished::_getInProgress (   $a_obj_id)
static

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

References $ilDB, $query, $res, $row, array, and ilDBConstants\FETCHMODE_OBJECT.

27  {
28  global $ilDB;
29 
30  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
31 
32  $query = "
33  SELECT active_id, user_fi, COUNT(tst_sequence.active_fi) sequences
34  FROM tst_active
35  LEFT JOIN tst_sequence
36  ON tst_sequence.active_fi = tst_active.active_id
37  WHERE tries = {$ilDB->quote(0, "integer")}
38  AND test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id), "integer")}
39  GROUP BY active_id, user_fi
40  HAVING COUNT(tst_sequence.active_fi) > {$ilDB->quote(0, "integer")}
41  ";
42 
43  $res = $ilDB->query($query);
44 
45  $user_ids = array();
46 
47  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
48  {
49  $user_ids[$row->user_fi] = $row->user_fi;
50  }
51 
52  return array_values($user_ids);
53  }
Create styles array
The data for the language used.
global $ilDB

◆ _getNotAttempted()

static ilLPStatusTestFinished::_getNotAttempted (   $a_obj_id)
static

Definition at line 85 of file class.ilLPStatusTestFinished.php.

References $ilDB, $query, $res, $row, array, and ilDBConstants\FETCHMODE_OBJECT.

86  {
87  global $ilDB;
88 
89  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
90 
91  $query = "
92  SELECT active_id, user_fi, COUNT(tst_sequence.active_fi) sequences
93  FROM tst_active
94  LEFT JOIN tst_sequence
95  ON tst_sequence.active_fi = tst_active.active_id
96  WHERE test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id))}
97  GROUP BY active_id, user_fi
98  HAVING COUNT(tst_sequence.active_fi) = {$ilDB->quote(0, "integer")}
99  ";
100 
101  $res = $ilDB->query($query);
102 
103  $user_ids = array();
104 
105  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
106  {
107  $user_ids[$row->user_fi] = $row->user_fi;
108  }
109 
110  return array_values($user_ids);
111  }
Create styles array
The data for the language used.
global $ilDB

◆ determineStatus()

ilLPStatusTestFinished::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 145 of file class.ilLPStatusTestFinished.php.

References $ilDB, and $res.

146  {
147  global $ilDB;
148 
149  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
150 
151  $res = $ilDB->query("
152  SELECT active_id, user_fi, tries, COUNT(tst_sequence.active_fi) sequences
153  FROM tst_active
154  LEFT JOIN tst_sequence
155  ON tst_sequence.active_fi = tst_active.active_id
156  WHERE user_fi = {$ilDB->quote($a_user_id, "integer")}
157  AND test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id))}
158  GROUP BY active_id, user_fi, tries
159  ");
160 
161  $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
162 
163  if ($rec = $ilDB->fetchAssoc($res))
164  {
165  if ($rec['sequences'] > 0)
166  {
167  $status = self::LP_STATUS_IN_PROGRESS_NUM;
168 
169  if ($rec['tries'] > 0)
170  {
171  $status = self::LP_STATUS_COMPLETED_NUM;
172  }
173  }
174  }
175 
176  return $status;
177  }
global $ilDB

◆ getParticipants()

static ilLPStatusTestFinished::getParticipants (   $a_obj_id)
static

Get participants.

Parameters

Definition at line 119 of file class.ilLPStatusTestFinished.php.

References $ilDB, $res, ilObjTestAccess\_getTestIDFromObjectID(), and array.

120  {
121  global $ilDB;
122 
123  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
124 
125  $res = $ilDB->query("SELECT DISTINCT user_fi FROM tst_active".
126  " WHERE test_fi = ".$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id)));
127  $user_ids = array();
128 
129  while($rec = $ilDB->fetchAssoc($res))
130  {
131  $user_ids[] = $rec["user_fi"];
132  }
133  return $user_ids;
134  }
static _getTestIDFromObjectID($object_id)
Returns the ILIAS test id for a given object id.
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

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