58 $this->activeIds = array();
59 $this->userIds = array();
60 $this->anonymousIds = array();
62 $this->byActiveId = array();
63 $this->byUserId = array();
64 $this->byAnonymousId = array();
67 public function load($testId)
69 $this->byActiveId = array();
70 $this->byUserId = array();
80 ON ud.usr_id = ta.user_fi
82 AND {$this->getConditionalExpression()}
85 $res = $this->db->queryF(
$query, array(
'integer'), array($testId));
87 while(
$row = $this->db->fetchAssoc(
$res) )
89 $this->byActiveId[
$row[
'active_id'] ] =
$row;
91 if( $row[
'user_id'] == ANONYMOUS_USER_ID )
93 $this->byAnonymousId[ $row[
'anonymous_id'] ] =
$row;
97 $this->byUserId[ $row[
'user_id'] ] =
$row;
102 $this->
setUserIds(array_keys($this->byUserId));
108 $conditions = array();
112 $conditions[] = $this->db->in(
'active_id', $this->
getActiveIds(),
false,
'integer');
117 $conditions[] = $this->db->in(
'user_fi', $this->
getUserIds(),
false,
'integer');
122 $conditions[] = $this->db->in(
'anonymous_id', $this->
getAnonymousIds(),
false,
'integer');
125 if( count($conditions) )
127 return '('.implode(
' OR ', $conditions).
')';
165 return $this->byActiveId[$activeId][
'user_id'];
170 return $this->byUserId[$userId][
'active_id'];
175 return "{$this->byActiveId[$activeId]['firstname']} {$this->byActiveId[$activeId]['lastname']}";
187 foreach($this->byActiveId as $activeId => $usrData)
200 $this->lng->txt(
'tst_participant_fullname_pattern'), $usrData[
'firstname'], $usrData[
'lastname']
206 $anonymousActiveIds = array();
208 foreach($this->byActiveId as $activeId => $active)
210 if($active[
'user_id'] == ANONYMOUS_USER_ID)
212 $anonymousActiveIds[] = $activeId;
216 return $anonymousActiveIds;