ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLPStatusTestFinished Class Reference
+ Inheritance diagram for ilLPStatusTestFinished:
+ Collaboration diagram for ilLPStatusTestFinished:

Public Member Functions

 determineStatus (int $a_obj_id, int $a_usr_id, object $a_obj=null)
 
- Public Member Functions inherited from ilLPStatus
 __construct (int $a_obj_id)
 
 _updateStatus (int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
 New status handling (st: status, nr: accesses, p: percentage, t: time spent, m: mark) Learning progress: More...
 
 determinePercentage (int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
 
 determineStatus (int $a_obj_id, int $a_usr_id, object $a_obj=null)
 
 refreshStatus (int $a_obj_id, ?array $a_users=null)
 Refresh status. More...
 

Static Public Member Functions

static _getInProgress (int $a_obj_id)
 
static _getCompleted (int $a_obj_id)
 
static _getNotAttempted (int $a_obj_id)
 
static getParticipants ($a_obj_id)
 
- Static Public Member Functions inherited from ilLPStatus
static _getCountNotAttempted (int $a_obj_id)
 
static _getNotAttempted (int $a_obj_id)
 
static _getCountInProgress (int $a_obj_id)
 
static _getInProgress (int $a_obj_id)
 
static _getCountCompleted (int $a_obj_id)
 
static _getCompleted (int $a_obj_id)
 
static _getFailed (int $a_obj_id)
 
static _getCountFailed (int $a_obj_id)
 
static _getStatusInfo (int $a_obj_id)
 
static _getTypicalLearningTime (int $a_obj_id)
 
static checkStatusForObject (int $a_obj_id, ?array $a_users=null)
 This function checks whether the status for a given number of users is dirty and must be recalculated. More...
 
static writeStatus (int $a_obj_id, int $a_user_id, int $a_status, int $a_percentage=0, bool $a_force_per=false, ?int &$a_old_status=self::LP_STATUS_NOT_ATTEMPTED_NUM)
 Write status for user and object. More...
 
static setInProgressIfNotAttempted (int $a_obj_id, int $a_user_id)
 This function shoudl be clalled for normal "read events". More...
 
static setAllDirty ()
 Sets all status to dirty. More...
 
static setDirty (int $a_obj_id)
 Sets status of an object to dirty. More...
 
static _lookupStatus (int $a_obj_id, int $a_user_id, bool $a_create=true)
 Lookup status. More...
 
static _lookupPercentage (int $a_obj_id, int $a_user_id)
 Lookup percentage. More...
 
static _hasUserCompleted (int $a_obj_id, int $a_user_id)
 Lookup user object completion. More...
 
static _lookupStatusChanged (int $a_obj_id, int $a_user_id)
 Lookup status changed. More...
 
static _lookupCompletedForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get completed users for object. More...
 
static _lookupFailedForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get failed users for object. More...
 
static _lookupInProgressForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get in progress users for object. More...
 
static preloadListGUIData (array $a_obj_ids)
 
static getListGUIStatus (int $a_obj_id, bool $a_image_only=true)
 
static hasListGUIStatus (int $a_obj_id)
 

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 (int $a_obj_id, int $a_usr_id, int $a_status, int $a_old_status, int $a_percentage)
 
static _lookupStatusForObject (int $a_obj_id, int $a_status, ?array $a_user_ids=null)
 Get users with given status for object. More...
 
static validateLPForObjects (int $a_user_id, array $a_obj_ids, int $a_parent_ref_id)
 Process given objects for lp-relevance. More...
 
static checkLPModesForObjects (array $a_obj_ids, array &$a_coll_obj_ids)
 Process lp modes for given objects. More...
 
static getLPStatusForObjects (int $a_user_id, array $a_obj_ids)
 Get LP status for given objects (and user) More...
 
- Protected Attributes inherited from ilLPStatus
int $obj_id
 
ilDBInterface $db
 
ilObjectDataCache $ilObjDataCache
 

Detailed Description

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

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

Member Function Documentation

◆ _getCompleted()

static ilLPStatusTestFinished::_getCompleted ( int  $a_obj_id)
static

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

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

40  : array
41  {
42  global $DIC;
43 
44  $ilDB = $DIC['ilDB'];
45  $query = "
46  SELECT active_id, user_fi, COUNT(tst_sequence.active_fi) sequences
47  FROM tst_active
48  LEFT JOIN tst_sequence
49  ON tst_sequence.active_fi = tst_active.active_id
50  WHERE tries > {$ilDB->quote(0, "integer")}
51  AND test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id))}
52  GROUP BY active_id, user_fi
53  HAVING COUNT(tst_sequence.active_fi) > {$ilDB->quote(0, "integer")}
54  ";
55 
56  $res = $ilDB->query($query);
57 
58  $user_ids = array();
59 
60  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
61  $user_ids[$row->user_fi] = (int) $row->user_fi;
62  }
63  return array_values($user_ids);
64  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:

◆ _getInProgress()

static ilLPStatusTestFinished::_getInProgress ( int  $a_obj_id)
static

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

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

13  : array
14  {
15  global $DIC;
16 
17  $ilDB = $DIC['ilDB'];
18 
19  $query = "
20  SELECT active_id, user_fi, COUNT(tst_sequence.active_fi) sequences
21  FROM tst_active
22  LEFT JOIN tst_sequence
23  ON tst_sequence.active_fi = tst_active.active_id
24  WHERE tries = {$ilDB->quote(0, "integer")}
25  AND test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id), "integer")}
26  GROUP BY active_id, user_fi
27  HAVING COUNT(tst_sequence.active_fi) > {$ilDB->quote(0, "integer")}
28  ";
29 
30  $res = $ilDB->query($query);
31 
32  $user_ids = array();
33 
34  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
35  $user_ids[$row->user_fi] = (int) $row->user_fi;
36  }
37  return array_values($user_ids);
38  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:

◆ _getNotAttempted()

static ilLPStatusTestFinished::_getNotAttempted ( int  $a_obj_id)
static

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

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

66  : array
67  {
68  global $DIC;
69 
70  $ilDB = $DIC['ilDB'];
71 
72  $query = "
73  SELECT active_id, user_fi, COUNT(tst_sequence.active_fi) sequences
74  FROM tst_active
75  LEFT JOIN tst_sequence
76  ON tst_sequence.active_fi = tst_active.active_id
77  WHERE test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id))}
78  GROUP BY active_id, user_fi
79  HAVING COUNT(tst_sequence.active_fi) = {$ilDB->quote(0, "integer")}
80  ";
81 
82  $res = $ilDB->query($query);
83 
84  $user_ids = array();
85 
86  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
87  $user_ids[$row->user_fi] = (int) $row->user_fi;
88  }
89 
90  return array_values($user_ids);
91  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:

◆ determineStatus()

ilLPStatusTestFinished::determineStatus ( int  $a_obj_id,
int  $a_usr_id,
object  $a_obj = null 
)

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

References $res.

117  : int {
118  $res = $this->db->query(
119  "
120  SELECT active_id, user_fi, tries, COUNT(tst_sequence.active_fi) sequences
121  FROM tst_active
122  LEFT JOIN tst_sequence
123  ON tst_sequence.active_fi = tst_active.active_id
124  WHERE user_fi = {$this->db->quote($a_usr_id, "integer")}
125  AND test_fi = {$this->db->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id), ilDBConstants::T_INTEGER)}
126  GROUP BY active_id, user_fi, tries
127  "
128  );
129 
130  $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
131 
132  if ($rec = $this->db->fetchAssoc($res)) {
133  if ($rec['sequences'] > 0) {
134  $status = self::LP_STATUS_IN_PROGRESS_NUM;
135 
136  if ($rec['tries'] > 0) {
137  $status = self::LP_STATUS_COMPLETED_NUM;
138  }
139  }
140  }
141  return $status;
142  }
$res
Definition: ltiservices.php:69

◆ getParticipants()

static ilLPStatusTestFinished::getParticipants (   $a_obj_id)
static

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

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

94  {
95  global $DIC;
96 
97  $ilDB = $DIC['ilDB'];
98 
99  $res = $ilDB->query(
100  "SELECT DISTINCT user_fi FROM tst_active" .
101  " WHERE test_fi = " . $ilDB->quote(
103  )
104  );
105  $user_ids = array();
106 
107  while ($rec = $ilDB->fetchAssoc($res)) {
108  $user_ids[] = (int) $rec["user_fi"];
109  }
110  return $user_ids;
111  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
static _getTestIDFromObjectID($object_id)
Returns the ILIAS test id for a given object id.
+ Here is the call graph for this function:

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