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();
82 ON ud.usr_id = ta.user_fi 84 AND {$this->getConditionalExpression()} 87 $res = $this->db->queryF(
$query, array(
'integer'), array($testId));
89 while(
$row = $this->db->fetchAssoc(
$res) )
91 $this->byActiveId[
$row[
'active_id'] ] =
$row;
93 if( $row[
'user_id'] == ANONYMOUS_USER_ID )
95 $this->byAnonymousId[ $row[
'anonymous_id'] ] =
$row;
99 $this->byUserId[ $row[
'user_id'] ] =
$row;
104 $this->
setUserIds(array_keys($this->byUserId));
110 $conditions = array();
114 $conditions[] = $this->db->in(
'active_id', $this->
getActiveIds(),
false,
'integer');
119 $conditions[] = $this->db->in(
'user_fi', $this->
getUserIds(),
false,
'integer');
124 $conditions[] = $this->db->in(
'anonymous_id', $this->
getAnonymousIds(),
false,
'integer');
127 if( count($conditions) )
129 return '('.implode(
' OR ', $conditions).
')';
167 return $this->byActiveId[$activeId][
'user_id'];
172 return $this->byUserId[$userId][
'active_id'];
177 return "{$this->byActiveId[$activeId]['firstname']} {$this->byActiveId[$activeId]['lastname']}";
187 $fullname = str_replace(
' ',
'', $this->byActiveId[$activeId][
'lastname']);
188 $fullname .=
'_'.str_replace(
' ',
'', $this->byActiveId[$activeId][
'firstname']);
189 $fullname .=
'_'.$this->byActiveId[$activeId][
'login'];
198 foreach($this->byActiveId as $activeId => $usrData)
211 $this->lng->txt(
'tst_participant_fullname_pattern'), $usrData[
'firstname'], $usrData[
'lastname']
217 $anonymousActiveIds = array();
219 foreach($this->byActiveId as $activeId => $active)
221 if($active[
'user_id'] == ANONYMOUS_USER_ID)
223 $anonymousActiveIds[] = $activeId;
227 return $anonymousActiveIds;
232 if( isset($this->byActiveId[$activeId]) )
234 return $this->byActiveId[$activeId];
getUserDataByActiveId($activeId)
getConcatedFullnameByActiveId($activeId)
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
getConditionalExpression()
getFormatedFullnameByActiveId($activeId)
if(!is_array($argv)) $options
__construct(ilDB $db, ilLanguage $lng)
buildFormatedFullname($usrData)
setAnonymousIds($anonymousIds)
getActiveIdByUserId($userId)
getFileSystemCompliantFullnameByActiveId($activeId)
getUserIdByActiveId($activeId)