19 declare(strict_types=0);
34 SELECT active_id, user_fi, COUNT(tst_sequence.active_fi) sequences 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
")} 49 $user_ids[$row->user_fi] = (
int) $row->user_fi;
51 return array_values($user_ids);
60 SELECT active_id, user_fi, COUNT(tst_sequence.active_fi) sequences 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
")} 75 $user_ids[$row->user_fi] = (
int) $row->user_fi;
77 return array_values($user_ids);
87 SELECT active_id, user_fi, COUNT(tst_sequence.active_fi) sequences 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
")} 101 $user_ids[$row->user_fi] = (
int) $row->user_fi;
104 return array_values($user_ids);
111 $ilDB = $DIC[
'ilDB'];
114 "SELECT DISTINCT user_fi FROM tst_active" .
115 " WHERE test_fi = " .
$ilDB->quote(
122 $user_ids[] = (
int) $rec[
"user_fi"];
130 ?
object $a_obj =
null 132 $res = $this->db->query(
134 SELECT active_id, user_fi, tries, COUNT(tst_sequence.active_fi) sequences 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 144 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
146 if ($rec = $this->db->fetchAssoc(
$res)) {
147 if ($rec[
'sequences'] > 0) {
148 $status = self::LP_STATUS_IN_PROGRESS_NUM;
150 if ($rec[
'tries'] > 0) {
151 $status = self::LP_STATUS_COMPLETED_NUM;
static _getNotAttempted(int $a_obj_id)
static _getInProgress(int $a_obj_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
determineStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
static _getCompleted(int $a_obj_id)
static _getTestIDFromObjectID($object_id)
Returns the ILIAS test id for a given object id.
static getParticipants($a_obj_id)