ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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, $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

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

References $DIC, and $ilDB.

18  {
19  global $DIC;
20 
21  $ilDB = $DIC['ilDB'];
22 
23  parent::__construct($a_obj_id);
24  $this->db = $ilDB;
25  }
global $DIC
Definition: saml.php:7
global $ilDB

Member Function Documentation

◆ _getCompleted()

static ilLPStatusTestFinished::_getCompleted (   $a_obj_id)
static

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

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

59  {
60  global $DIC;
61 
62  $ilDB = $DIC['ilDB'];
63 
64  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
65 
66  $query = "
67  SELECT active_id, user_fi, COUNT(tst_sequence.active_fi) sequences
68  FROM tst_active
69  LEFT JOIN tst_sequence
70  ON tst_sequence.active_fi = tst_active.active_id
71  WHERE tries > {$ilDB->quote(0, "integer")}
72  AND test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id))}
73  GROUP BY active_id, user_fi
74  HAVING COUNT(tst_sequence.active_fi) > {$ilDB->quote(0, "integer")}
75  ";
76 
77  $res = $ilDB->query($query);
78 
79  $user_ids = array();
80 
81  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
82  $user_ids[$row->user_fi] = $row->user_fi;
83  }
84 
85  return array_values($user_ids);
86  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ _getInProgress()

static ilLPStatusTestFinished::_getInProgress (   $a_obj_id)
static

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

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

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

◆ _getNotAttempted()

static ilLPStatusTestFinished::_getNotAttempted (   $a_obj_id)
static

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

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

89  {
90  global $DIC;
91 
92  $ilDB = $DIC['ilDB'];
93 
94  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
95 
96  $query = "
97  SELECT active_id, user_fi, COUNT(tst_sequence.active_fi) sequences
98  FROM tst_active
99  LEFT JOIN tst_sequence
100  ON tst_sequence.active_fi = tst_active.active_id
101  WHERE test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id))}
102  GROUP BY active_id, user_fi
103  HAVING COUNT(tst_sequence.active_fi) = {$ilDB->quote(0, "integer")}
104  ";
105 
106  $res = $ilDB->query($query);
107 
108  $user_ids = array();
109 
110  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
111  $user_ids[$row->user_fi] = $row->user_fi;
112  }
113 
114  return array_values($user_ids);
115  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
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 150 of file class.ilLPStatusTestFinished.php.

References $DIC, $ilDB, and $res.

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

◆ getParticipants()

static ilLPStatusTestFinished::getParticipants (   $a_obj_id)
static

Get participants.

Parameters

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

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

124  {
125  global $DIC;
126 
127  $ilDB = $DIC['ilDB'];
128 
129  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
130 
131  $res = $ilDB->query("SELECT DISTINCT user_fi FROM tst_active" .
132  " WHERE test_fi = " . $ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id)));
133  $user_ids = array();
134 
135  while ($rec = $ilDB->fetchAssoc($res)) {
136  $user_ids[] = $rec["user_fi"];
137  }
138  return $user_ids;
139  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
static _getTestIDFromObjectID($object_id)
Returns the ILIAS test id for a given object id.
global $ilDB
+ Here is the call graph for this function:

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