ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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, &$a_old_status=self::LP_STATUS_NOT_ATTEMPTED_NUM)
 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
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_old_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...
 
- Protected Attributes inherited from ilLPStatus
 $obj_id = null
 
 $db = null
 

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 $DIC;
20
21 $ilDB = $DIC['ilDB'];
22
23 parent::__construct($a_obj_id);
24 $this->db = $ilDB;
25 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilDB
$DIC
Definition: xapitoken.php:46

References $DIC, $ilDB, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getCompleted()

static ilLPStatusTestFinished::_getCompleted (   $a_obj_id)
static

Reimplemented from ilLPStatus.

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

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 }
$query
foreach($_POST as $key=> $value) $res

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

◆ _getInProgress()

static ilLPStatusTestFinished::_getInProgress (   $a_obj_id)
static

Reimplemented from ilLPStatus.

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

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 }

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

◆ _getNotAttempted()

static ilLPStatusTestFinished::_getNotAttempted (   $a_obj_id)
static

Reimplemented from ilLPStatus.

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

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 }

References $DIC, $ilDB, $query, $res, 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 150 of file class.ilLPStatusTestFinished.php.

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
169
170 if ($rec = $ilDB->fetchAssoc($res)) {
171 if ($rec['sequences'] > 0) {
173
174 if ($rec['tries'] > 0) {
176 }
177 }
178 }
179
180 return $status;
181 }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM

References $DIC, $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 123 of file class.ilLPStatusTestFinished.php.

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 }
static _getTestIDFromObjectID($object_id)
Returns the ILIAS test id for a given object id.

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

+ Here is the call graph for this function:

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