61 $this->activeIdsFilter = array();
62 $this->userIdsFilter = array();
63 $this->anonymousIdsFilter = array();
65 $this->byActiveId = array();
66 $this->byUserId = array();
67 $this->byAnonymousId = array();
69 $this->scoredParticipantsFilterEnabled =
false;
104 public function load($testId): void
106 $this->byActiveId = array();
107 $this->byUserId = array();
118 LEFT JOIN usr_data ud 119 ON ud.usr_id = ta.user_fi 121 AND {$this->getConditionalExpression()} 122 AND {$this->getScoredParticipantsFilterExpression()} 125 $res = $this->db->queryF(
$query, array(
'integer'), array($testId));
128 $accessFilteredUsrIds = array();
130 while ($row = $this->db->fetchAssoc(
$res)) {
131 $accessFilteredUsrIds[] = $row[
'user_id'];
139 foreach (
$rows as $row) {
140 if (!in_array($row[
'user_id'], $accessFilteredUsrIds)) {
144 $this->byActiveId[ $row[
'active_id'] ] = $row;
147 $this->byAnonymousId[ $row[
'anonymous_id'] ] = $row;
149 $this->byUserId[ $row[
'user_id'] ] = $row;
157 return "ta.last_finished_pass = ta.last_started_pass";
165 $conditions = array();
168 $conditions[] = $this->db->in(
'active_id', $this->
getActiveIdsFilter(),
false,
'integer');
172 $conditions[] = $this->db->in(
'user_fi', $this->
getUserIdsFilter(),
false,
'integer');
179 if (count($conditions)) {
180 return '(' . implode(
' OR ', $conditions) .
')';
218 return array_keys($this->byActiveId);
223 return array_keys($this->byUserId);
228 return array_keys($this->byAnonymousId);
233 return $this->byActiveId[$activeId][
'user_id'];
238 return $this->byUserId[$userId][
'active_id'] ?? null;
243 return "{$this->byActiveId[$activeId]['firstname']} {$this->byActiveId[$activeId]['lastname']}";
253 $fullname = str_replace(
' ',
'', $this->byActiveId[$activeId][
'lastname']);
254 $fullname .=
'_' . str_replace(
' ',
'', $this->byActiveId[$activeId][
'firstname']);
255 $fullname .=
'_' . $this->byActiveId[$activeId][
'login'];
264 foreach ($this->byActiveId as $activeId => $usrData) {
275 $anonymousActiveIds = array();
277 foreach ($this->byActiveId as $activeId => $active) {
279 $anonymousActiveIds[] = $activeId;
283 return $anonymousActiveIds;
288 if (isset($this->byActiveId[$activeId])) {
289 return $this->byActiveId[$activeId];
__construct(ilDBInterface $db, ilLanguage $lng)
setAnonymousIdsFilter($anonymousIdsFilter)
static _getParticipantData($active_id)
Retrieves a participant name from active id.
getUserDataByActiveId($activeId)
getConcatedFullnameByActiveId($activeId)
setParticipantAccessFilter($participantAccessFilter)
setUserIdsFilter($userIdsFilter)
getConditionalExpression()
static getASCIIFilename(string $a_filename)
getFormatedFullnameByActiveId($activeId)
bool $scoredParticipantsFilterEnabled
setScoredParticipantsFilterEnabled($scoredParticipantsFilterEnabled)
getActiveIdByUserId($userId)
getParticipantAccessFilter()
getScoredParticipantsFilterExpression()
getFileSystemCompliantFullnameByActiveId($activeId)
array $anonymousIdsFilter
getUserIdByActiveId($activeId)
isScoredParticipantsFilterEnabled()
setActiveIdsFilter($activeIdsFilter)