19 declare(strict_types=0);
35 $members = self::getMembers($a_obj_id);
69 $users = array_intersect(self::getMembers($a_obj_id), $users);
83 $query =
"SELECT DISTINCT(usr_id) user_id FROM ut_lp_marks " .
84 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
85 "AND completed = '1' ";
89 $usr_ids[] = (
int) $row->user_id;
94 $usr_ids = array_intersect(self::getMembers($a_obj_id), $usr_ids);
105 ?
object $a_obj =
null 111 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
112 switch ($this->ilObjDataCache->lookupType($a_obj_id)) {
116 $set = $this->db->query(
117 $q =
"SELECT usr_id FROM ut_lp_marks " .
118 "WHERE obj_id = " . $this->db->quote(
122 "AND usr_id = " . $this->db->quote(
126 "AND completed = '1' " 128 if ($rec = $this->db->fetchAssoc($set)) {
129 $status = self::LP_STATUS_COMPLETED_NUM;
132 $status = self::LP_STATUS_IN_PROGRESS_NUM;
142 parent::refreshStatus($a_obj_id, $a_users);
154 $all_active_users = array_unique(
155 array_merge($in_progress, $completed, $failed, $not_attempted)
158 foreach ($all_active_users as $usr_id) {
159 $course_gui->updateLPFromStatus(
191 ?array $a_user_ids =
null 194 $a_user_ids = self::getMembers($a_obj_id);
199 return self::_lookupStatusForObject(
201 self::LP_STATUS_COMPLETED_NUM,
211 ?array $a_user_ids =
null 221 ?array $a_user_ids =
null 224 $a_user_ids = self::getMembers($a_obj_id);
229 return self::_lookupStatusForObject(
231 self::LP_STATUS_IN_PROGRESS_NUM,
determineStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
Determine status.
static _getCompleted(int $a_obj_id)
Static function to read the users who have the status 'completed'.
static _lookupCompletedForObject(int $a_obj_id, ?array $a_user_ids=null)
Get completed users for object.
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
static hasAccessed(int $a_obj_id, int $a_usr_id)
Has accessed.
static _hasPassed(int $a_obj_id, int $a_usr_id)
Check if user has passed course.
static _getInProgress(int $a_obj_id)
Static function to read users who have the status 'in_progress'.
static _getNotAttempted(int $a_obj_id)
Static function to read the number of user who have the status 'not_attempted'.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static lookupUsersInProgress(int $a_obj_id)
static getMembers(int $a_obj_id)
Get members for object.
static _getFailed(int $a_obj_id)
Static function to read the users who have the status 'completed'.
static _lookupFailedForObject(int $a_obj_id, ?array $a_user_ids=null)
Get failed users for object.
refreshStatus(int $a_obj_id, ?array $a_users=null)
ilObjectDataCache $ilObjDataCache
static _getCompleted(int $a_obj_id)
static _getNotAttempted(int $a_obj_id)
get not attempted
static _getInProgress(int $a_obj_id)
get in progress public
static _lookupType(int $id, bool $reference=false)
static _lookupInProgressForObject(int $a_obj_id, ?array $a_user_ids=null)
Get in progress users for object.