5require_once 
'Modules/Test/classes/class.ilTestParticipant.php';
 
   56        $this->participants[] = $participant;
 
   61        foreach ($this as $participant) {
 
   62            if ($participant->getUsrId() != $usrId) {
 
   76        foreach ($this as $participant) {
 
   77            if ($participant->getActiveId() != $activeId) {
 
   90        foreach ($this as $participant) {
 
   91            if ($participant->hasUnfinishedPasses()) {
 
  104        foreach ($this as $participant) {
 
  117        foreach ($this as $participant) {
 
  118            $usrIds[] = $participant->getUsrId();
 
  126        $activeIds = array();
 
  128        foreach ($this as $participant) {
 
  129            $activeIds[] = $participant->getActiveId();
 
  137        foreach ($this as $participant) {
 
  138            if ($participant->getActiveId() == $activeId) {
 
  148        $usrIds = call_user_func_array($userAccessFilter, [$this->
getAllUserIds()]);
 
  150        $accessFilteredList = 
new self($this->
getTestObj());
 
  152        foreach ($this as $participant) {
 
  153            if (in_array($participant->getUsrId(), $usrIds)) {
 
  154                $participant = clone $participant;
 
  155                $accessFilteredList->addParticipant($participant);
 
  159        return $accessFilteredList;
 
  164        return current($this->participants);
 
  168        return next($this->participants);
 
  172        return key($this->participants);
 
  176        return key($this->participants) !== 
null;
 
  180        return reset($this->participants);
 
  188        foreach ($dbRows as $rowKey => $rowData) {
 
  191            if ((
int) $rowData[
'active_id']) {
 
  192                $participant->setActiveId((
int) $rowData[
'active_id']);
 
  195            $participant->setUsrId((
int) $rowData[
'usr_id']);
 
  197            $participant->setLogin($rowData[
'login']);
 
  198            $participant->setLastname($rowData[
'lastname']);
 
  199            $participant->setFirstname($rowData[
'firstname']);
 
  200            $participant->setMatriculation($rowData[
'matriculation']);
 
  202            $participant->setActiveStatus((
bool) $rowData[
'active']);
 
  204            if (isset($rowData[
'clientip'])) {
 
  205                $participant->setClientIp($rowData[
'clientip']);
 
  208            $participant->setFinishedTries((
int) $rowData[
'tries']);
 
  209            $participant->setTestFinished((
bool) $rowData[
'test_finished']);
 
  210            $participant->setUnfinishedPasses((
bool) $rowData[
'unfinished_passes']);
 
  221        require_once 
'Modules/Test/classes/class.ilTestParticipantScoring.php';
 
  223        $scoredParticipantList = 
new self($this->
getTestObj());
 
  229        while (
$row = $DIC->database()->fetchAssoc(
$res)) {
 
  232            $scoring->setActiveId((
int) 
$row[
'active_fi']);
 
  233            $scoring->setScoredPass((
int) 
$row[
'pass']);
 
  235            $scoring->setAnsweredQuestions((
int) 
$row[
'answeredquestions']);
 
  236            $scoring->setTotalQuestions((
int) 
$row[
'questioncount']);
 
  238            $scoring->setReachedPoints((
float) 
$row[
'reached_points']);
 
  239            $scoring->setMaxPoints((
float) 
$row[
'max_points']);
 
  241            $scoring->setPassed((
bool) 
$row[
'passed']);
 
  242            $scoring->setFinalMark((
string) 
$row[
'mark_official']);
 
  246            $scoredParticipantList->addParticipant(
 
  251        return $scoredParticipantList;
 
  258        $IN_activeIds = 
$DIC->database()->in(
 
  265        if (
false && !$this->
getTestObj()->isDynamicTest()) { 
 
  266            $closedScoringsOnly = 
" 
  267                                INNER JOIN tst_active tact 
  268                                ON tact.active_id = tres.active_fi 
  269                                AND tact.last_finished_pass = tact.last_started_pass 
  272            $closedScoringsOnly = 
'';
 
  276                        SELECT * FROM tst_result_cache tres 
  278                        INNER JOIN tst_pass_result pres 
  279                        ON pres.active_fi = tres.active_fi 
  280                        AND pres.pass = tres.pass 
  294        foreach ($this as $participant) {
 
  296                'usr_id' => $participant->getUsrId(),
 
  297                'active_id' => $participant->getActiveId(),
 
  298                'login' => $participant->getLogin(),
 
  299                'clientip' => $participant->getClientIp(),
 
  300                'firstname' => $participant->getFirstname(),
 
  301                'lastname' => $participant->getLastname(),
 
  302                'name' => $this->buildFullname($participant),
 
  303                'started' => ($participant->getActiveId() > 0) ? 1 : 0,
 
  304                'unfinished' => $participant->hasUnfinishedPasses() ? 1 : 0,
 
  305                'finished' => $participant->isTestFinished() ? 1 : 0,
 
  306                'access' => $this->lookupLastAccess($participant->getActiveId()),
 
  307                'tries' => $this->lookupNrOfTries($participant->getActiveId())
 
  320        foreach ($this as $participant) {
 
  321            if (!$participant->hasScoring()) {
 
  326                'usr_id' => $participant->getUsrId(),
 
  327                'active_id' => $participant->getActiveId(),
 
  328                'login' => $participant->getLogin(),
 
  329                'firstname' => $participant->getFirstname(),
 
  330                'lastname' => $participant->getLastname(),
 
  331                'name' => $this->buildFullname($participant)
 
  334            if ($participant->getScoring()) {
 
  335                $row[
'scored_pass'] = $participant->getScoring()->getScoredPass();
 
  336                $row[
'answered_questions'] = $participant->getScoring()->getAnsweredQuestions();
 
  337                $row[
'total_questions'] = $participant->getScoring()->getTotalQuestions();
 
  338                $row[
'reached_points'] = $participant->getScoring()->getReachedPoints();
 
  339                $row[
'max_points'] = $participant->getScoring()->getMaxPoints();
 
  340                $row[
'percent_result'] = $participant->getScoring()->getPercentResult();
 
  341                $row[
'passed_status'] = $participant->getScoring()->isPassed();
 
  342                $row[
'final_mark'] = $participant->getScoring()->getFinalMark();
 
  345                    $participant->getActiveId(),
 
  346                    $participant->getScoring()->getScoredPass()
 
  364        if ($maxPassIndex !== 
null) {
 
  365            $nrOfTries = $maxPassIndex + 1;
 
  382        return $this->
getTestObj()->_getLastAccess($activeId);
 
  407            return $DIC->language()->txt(
"deleted_user");
 
  411            return $DIC->language()->txt(
'anonymous');
 
  423        require_once 
'Modules/Test/classes/class.ilObjTestAccess.php';
 
An exception for terminatinating execution or to throw for unit testing.
static _getParticipantData($active_id)
Retrieves a participant name from active id.
static lookupLastTestPassAccess($activeId, $passIndex)
static _getMaxPass($active_id)
Retrieves the maximum pass of a given user for a given test in which the user answered at least one q...
buildParticipantsFullname(ilTestParticipant $participant)
getParticipantsTableRows()
isActiveIdInList($activeId)
lookupLastAccess($activeId)
buildInviteeFullname(ilTestParticipant $participant)
getAccessFilteredList(callable $userAccessFilter)
getScoredParticipantList()
initializeFromDbRows($dbRows)
addParticipant(ilTestParticipant $participant)
getParticipantByActiveId($activeId)
lookupNrOfTries($activeId)
buildFullname(ilTestParticipant $participant)
__construct(ilObjTest $testObj)
getParticipantByUsrId($usrId)
foreach($_POST as $key=> $value) $res