ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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=false)
 

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)

Reimplemented from ilLPStatus.

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

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

References $ilDB.

Member Function Documentation

◆ _getCompleted()

static ilLPStatusTestFinished::_getCompleted (   $a_obj_id)
static

Reimplemented from ilLPStatus.

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

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

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

◆ _getInProgress()

static ilLPStatusTestFinished::_getInProgress (   $a_obj_id)
static

Reimplemented from ilLPStatus.

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

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

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

◆ _getNotAttempted()

static ilLPStatusTestFinished::_getNotAttempted (   $a_obj_id)
static

Reimplemented from ilLPStatus.

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

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

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

◆ 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

Reimplemented from ilLPStatus.

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

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

References $ilDB, $res, ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

◆ getParticipants()

static ilLPStatusTestFinished::getParticipants (   $a_obj_id)
static

Get participants.

Parameters

return

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

116 {
117 global $ilDB;
118
119 include_once './Modules/Test/classes/class.ilObjTestAccess.php';
120
121 $res = $ilDB->query("SELECT DISTINCT user_fi FROM tst_active" .
122 " WHERE test_fi = " . $ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id)));
123 $user_ids = array();
124
125 while ($rec = $ilDB->fetchAssoc($res)) {
126 $user_ids[] = $rec["user_fi"];
127 }
128 return $user_ids;
129 }
static _getTestIDFromObjectID($object_id)
Returns the ILIAS test id for a given object id.

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

+ Here is the call graph for this function:

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