ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 (string $type, int $obj_id, int $sub_id=0)
 
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 25 of file class.ilLPStatusTestFinished.php.

Member Function Documentation

◆ _getCompleted()

static ilLPStatusTestFinished::_getCompleted ( int  $a_obj_id)
static

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

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

54  : array
55  {
56  global $DIC;
57 
58  $ilDB = $DIC['ilDB'];
59  $query = "
60  SELECT active_id, user_fi, COUNT(tst_sequence.active_fi) sequences
61  FROM tst_active
62  LEFT JOIN tst_sequence
63  ON tst_sequence.active_fi = tst_active.active_id
64  WHERE tries > {$ilDB->quote(0, "integer")}
65  AND test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id))}
66  GROUP BY active_id, user_fi
67  HAVING COUNT(tst_sequence.active_fi) > {$ilDB->quote(0, "integer")}
68  ";
69 
70  $res = $ilDB->query($query);
71 
72  $user_ids = array();
73 
74  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
75  $user_ids[$row->user_fi] = (int) $row->user_fi;
76  }
77  return array_values($user_ids);
78  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ _getInProgress()

static ilLPStatusTestFinished::_getInProgress ( int  $a_obj_id)
static

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

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

27  : array
28  {
29  global $DIC;
30 
31  $ilDB = $DIC['ilDB'];
32 
33  $query = "
34  SELECT active_id, user_fi, COUNT(tst_sequence.active_fi) sequences
35  FROM tst_active
36  LEFT JOIN tst_sequence
37  ON tst_sequence.active_fi = tst_active.active_id
38  WHERE tries = {$ilDB->quote(0, "integer")}
39  AND test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id), "integer")}
40  GROUP BY active_id, user_fi
41  HAVING COUNT(tst_sequence.active_fi) > {$ilDB->quote(0, "integer")}
42  ";
43 
44  $res = $ilDB->query($query);
45 
46  $user_ids = array();
47 
48  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
49  $user_ids[$row->user_fi] = (int) $row->user_fi;
50  }
51  return array_values($user_ids);
52  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ _getNotAttempted()

static ilLPStatusTestFinished::_getNotAttempted ( int  $a_obj_id)
static

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

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

80  : array
81  {
82  global $DIC;
83 
84  $ilDB = $DIC['ilDB'];
85 
86  $query = "
87  SELECT active_id, user_fi, COUNT(tst_sequence.active_fi) sequences
88  FROM tst_active
89  LEFT JOIN tst_sequence
90  ON tst_sequence.active_fi = tst_active.active_id
91  WHERE test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id))}
92  GROUP BY active_id, user_fi
93  HAVING COUNT(tst_sequence.active_fi) = {$ilDB->quote(0, "integer")}
94  ";
95 
96  $res = $ilDB->query($query);
97 
98  $user_ids = array();
99 
100  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
101  $user_ids[$row->user_fi] = (int) $row->user_fi;
102  }
103 
104  return array_values($user_ids);
105  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ 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 127 of file class.ilLPStatusTestFinished.php.

References $res.

131  : int {
132  $res = $this->db->query(
133  "
134  SELECT active_id, user_fi, tries, COUNT(tst_sequence.active_fi) sequences
135  FROM tst_active
136  LEFT JOIN tst_sequence
137  ON tst_sequence.active_fi = tst_active.active_id
138  WHERE user_fi = {$this->db->quote($a_usr_id, "integer")}
139  AND test_fi = {$this->db->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id), ilDBConstants::T_INTEGER)}
140  GROUP BY active_id, user_fi, tries
141  "
142  );
143 
144  $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
145 
146  if ($rec = $this->db->fetchAssoc($res)) {
147  if ($rec['sequences'] > 0) {
148  $status = self::LP_STATUS_IN_PROGRESS_NUM;
149 
150  if ($rec['tries'] > 0) {
151  $status = self::LP_STATUS_COMPLETED_NUM;
152  }
153  }
154  }
155  return $status;
156  }
$res
Definition: ltiservices.php:66

◆ getParticipants()

static ilLPStatusTestFinished::getParticipants (   $a_obj_id)
static

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

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

108  {
109  global $DIC;
110 
111  $ilDB = $DIC['ilDB'];
112 
113  $res = $ilDB->query(
114  "SELECT DISTINCT user_fi FROM tst_active" .
115  " WHERE test_fi = " . $ilDB->quote(
117  )
118  );
119  $user_ids = array();
120 
121  while ($rec = $ilDB->fetchAssoc($res)) {
122  $user_ids[] = (int) $rec["user_fi"];
123  }
124  return $user_ids;
125  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
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: