ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\Test\Participants\Participant Class Reference
+ Collaboration diagram for ILIAS\Test\Participants\Participant:

Public Member Functions

 __construct (private readonly int $user_id, private readonly ?int $active_id=null, private readonly ?int $test_id=null, private readonly ?string $anonymous_id=null, private readonly string $firstname='', private readonly string $lastname='', private readonly string $login='', private readonly string $matriculation='', private int $extra_time=0, private readonly int $attempts=0, private ?string $client_ip_from=null, private ?string $client_ip_to=null, private readonly ?int $invitation_date=null, private readonly ?bool $submitted=null, private readonly ?int $last_started_attempt=null, private readonly ?int $last_finished_attempt=null, private readonly bool $unfinished_attempts=false, private readonly ?\DateTimeImmutable $first_access=null, private readonly ?\DateTimeImmutable $last_access=null)
 
 getUserId ()
 
 getActiveId ()
 
 getTestId ()
 
 getAnonymousId ()
 
 getFirstname ()
 
 getLastname ()
 
 getLogin ()
 
 getMatriculation ()
 
 getExtraTime ()
 
 withAddedExtraTime (int $extra_time)
 
 getAttempts ()
 
 getClientIpFrom ()
 
 withClientIpFrom (?string $ip)
 
 getClientIpTo ()
 
 withClientIpTo (?string $ip)
 
 isInvitedParticipant ()
 
 getSubmitted ()
 
 getTotalDuration (?int $processing_time)
 
 getLastStartedAttempt ()
 
 getLastFinishedAttempt ()
 
 hasUnfinishedAttempts ()
 
 getFirstAccess ()
 
 getLastAccess ()
 
 hasAnsweredQuestionsForScoredAttempt ()
 
 getRemainingDuration (int $processing_time, bool $reset_time_on_new_attempt)
 
 getAttemptOverviewInformation ()
 
 withAttemptOverviewInformation (?AttemptOverview $attempt_overview)
 
 withRunningAttemptStart (\DateTimeImmutable $start_date)
 

Private Attributes

AttemptOverview $attempt_overview = null
 
DateTimeImmutable $running_attempt_start = null
 

Detailed Description

Definition at line 25 of file Participant.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Participants\Participant::__construct ( private readonly int  $user_id,
private readonly ?int  $active_id = null,
private readonly ?int  $test_id = null,
private readonly ?string  $anonymous_id = null,
private readonly string  $firstname = '',
private readonly string  $lastname = '',
private readonly string  $login = '',
private readonly string  $matriculation = '',
private int  $extra_time = 0,
private readonly int  $attempts = 0,
private ?string  $client_ip_from = null,
private ?string  $client_ip_to = null,
private readonly ?int  $invitation_date = null,
private readonly ?bool  $submitted = null,
private readonly ?int  $last_started_attempt = null,
private readonly ?int  $last_finished_attempt = null,
private readonly bool  $unfinished_attempts = false,
private readonly ?\DateTimeImmutable  $first_access = null,
private readonly ?\DateTimeImmutable  $last_access = null 
)

Definition at line 30 of file Participant.php.

50  {
51  }

Member Function Documentation

◆ getActiveId()

◆ getAnonymousId()

ILIAS\Test\Participants\Participant::getAnonymousId ( )

Definition at line 68 of file Participant.php.

68  : ?string
69  {
70  return $this->anonymous_id;
71  }

◆ getAttemptOverviewInformation()

ILIAS\Test\Participants\Participant::getAttemptOverviewInformation ( )

Definition at line 214 of file Participant.php.

References ILIAS\Test\Participants\Participant\$attempt_overview.

Referenced by ILIAS\Test\Participants\ParticipantTable\getPostLoadFilters(), and ILIAS\Test\Participants\ParticipantTable\getPostLoadOrderFields().

214  : ?AttemptOverview
215  {
217  }
+ Here is the caller graph for this function:

◆ getAttempts()

ILIAS\Test\Participants\Participant::getAttempts ( )

Definition at line 105 of file Participant.php.

105  : int
106  {
107  return $this->attempts;
108  }

◆ getClientIpFrom()

ILIAS\Test\Participants\Participant::getClientIpFrom ( )

Definition at line 110 of file Participant.php.

Referenced by ilTestAccess\isParticipantExplicitelyAllowedByIndividualIPRange(), and ILIAS\Test\Participants\ParticipantTableIpRangeAction\isUniqueClientIp().

110  : ?string
111  {
112  return $this->client_ip_from;
113  }
+ Here is the caller graph for this function:

◆ getClientIpTo()

ILIAS\Test\Participants\Participant::getClientIpTo ( )

Definition at line 125 of file Participant.php.

Referenced by ilTestAccess\isParticipantExplicitelyAllowedByIndividualIPRange(), and ILIAS\Test\Participants\ParticipantTableIpRangeAction\isUniqueClientIp().

125  : ?string
126  {
127  return $this->client_ip_to;
128  }
+ Here is the caller graph for this function:

◆ getExtraTime()

ILIAS\Test\Participants\Participant::getExtraTime ( )

Definition at line 93 of file Participant.php.

Referenced by ILIAS\Test\Participants\ParticipantTableExtraTimeAction\getModal(), ILIAS\Test\Participants\ParticipantTableExtraTimeAction\resolveHasDifferentExtraTime(), and ILIAS\Test\Participants\ParticipantRepository\updateExtraTime().

93  : int
94  {
95  return $this->extra_time;
96  }
+ Here is the caller graph for this function:

◆ getFirstAccess()

ILIAS\Test\Participants\Participant::getFirstAccess ( )

Definition at line 174 of file Participant.php.

Referenced by ILIAS\Test\Participants\ParticipantTable\getPostLoadOrderFields(), and ILIAS\Test\Participants\Participant\getRemainingDuration().

174  : ?\DateTimeImmutable
175  {
176  return $this->first_access;
177  }
+ Here is the caller graph for this function:

◆ getFirstname()

ILIAS\Test\Participants\Participant::getFirstname ( )

Definition at line 73 of file Participant.php.

Referenced by ILIAS\Test\Participants\ParticipantTableIpRangeAction\getModal(), and ILIAS\Test\Participants\ParticipantTableExtraTimeAction\getModal().

73  : string
74  {
75  return $this->firstname;
76  }
+ Here is the caller graph for this function:

◆ getLastAccess()

ILIAS\Test\Participants\Participant::getLastAccess ( )

Definition at line 179 of file Participant.php.

Referenced by ILIAS\Test\Participants\ParticipantTable\getPostLoadOrderFields(), and ILIAS\Test\Participants\Participant\getRemainingDuration().

179  : ?\DateTimeImmutable
180  {
181  return $this->last_access;
182  }
+ Here is the caller graph for this function:

◆ getLastFinishedAttempt()

ILIAS\Test\Participants\Participant::getLastFinishedAttempt ( )

Definition at line 164 of file Participant.php.

164  : ?int
165  {
166  return $this->last_finished_attempt;
167  }

◆ getLastname()

ILIAS\Test\Participants\Participant::getLastname ( )

Definition at line 78 of file Participant.php.

Referenced by ILIAS\Test\Participants\ParticipantTableIpRangeAction\getModal(), and ILIAS\Test\Participants\ParticipantTableExtraTimeAction\getModal().

78  : string
79  {
80  return $this->lastname;
81  }
+ Here is the caller graph for this function:

◆ getLastStartedAttempt()

ILIAS\Test\Participants\Participant::getLastStartedAttempt ( )

Definition at line 159 of file Participant.php.

159  : ?int
160  {
161  return $this->last_started_attempt;
162  }

◆ getLogin()

ILIAS\Test\Participants\Participant::getLogin ( )

Definition at line 83 of file Participant.php.

83  : string
84  {
85  return $this->login;
86  }

◆ getMatriculation()

ILIAS\Test\Participants\Participant::getMatriculation ( )

Definition at line 88 of file Participant.php.

Referenced by ILIAS\Test\Participants\ParticipantTable\getPostLoadOrderFields().

88  : string
89  {
90  return $this->matriculation;
91  }
+ Here is the caller graph for this function:

◆ getRemainingDuration()

ILIAS\Test\Participants\Participant::getRemainingDuration ( int  $processing_time,
bool  $reset_time_on_new_attempt 
)

Definition at line 189 of file Participant.php.

References ILIAS\Test\Participants\Participant\getFirstAccess(), ILIAS\Test\Participants\Participant\getLastAccess(), ILIAS\Test\Participants\Participant\getTotalDuration(), and null.

Referenced by ILIAS\Test\Participants\ParticipantTable\getPostLoadOrderFields().

192  : int {
193  $remaining = $this->getTotalDuration($processing_time);
194 
195  $start = $this->getFirstAccess()?->getTimestamp();
196  if ($reset_time_on_new_attempt) {
197  $start = $this->running_attempt_start?->getTimestamp();
198  }
199 
200  if ($start === null) {
201  return $remaining;
202  }
203 
204  $remaining += $start;
205  if ($this->submitted) {
206  $remaining -= $this->getLastAccess()?->getTimestamp() ?? time();
207  } else {
208  $remaining -= time();
209  }
210 
211  return max(0, $remaining);
212  }
getTotalDuration(?int $processing_time)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSubmitted()

ILIAS\Test\Participants\Participant::getSubmitted ( )

Definition at line 145 of file Participant.php.

145  : ?bool
146  {
147  return $this->submitted;
148  }

◆ getTestId()

ILIAS\Test\Participants\Participant::getTestId ( )

Definition at line 63 of file Participant.php.

Referenced by ILIAS\Test\Participants\ParticipantRepository\updateExtraTime().

63  : ?int
64  {
65  return $this->test_id;
66  }
+ Here is the caller graph for this function:

◆ getTotalDuration()

ILIAS\Test\Participants\Participant::getTotalDuration ( ?int  $processing_time)

Definition at line 150 of file Participant.php.

Referenced by ILIAS\Test\Participants\ParticipantTable\getPostLoadOrderFields(), and ILIAS\Test\Participants\Participant\getRemainingDuration().

150  : int
151  {
152  if (!$processing_time) {
153  return 0;
154  }
155 
156  return $processing_time + $this->extra_time * 60;
157  }
+ Here is the caller graph for this function:

◆ getUserId()

◆ hasAnsweredQuestionsForScoredAttempt()

ILIAS\Test\Participants\Participant::hasAnsweredQuestionsForScoredAttempt ( )

Definition at line 184 of file Participant.php.

Referenced by ILIAS\Test\Participants\ParticipantTable\getPostLoadFilters().

184  : bool
185  {
186  return $this->attempt_overview?->hasAnsweredQuestions() ?? false;
187  }
+ Here is the caller graph for this function:

◆ hasUnfinishedAttempts()

ILIAS\Test\Participants\Participant::hasUnfinishedAttempts ( )

Definition at line 169 of file Participant.php.

Referenced by ILIAS\Test\Participants\ParticipantTableFinishTestAction\allowActionForRecord().

169  : bool
170  {
171  return $this->unfinished_attempts;
172  }
+ Here is the caller graph for this function:

◆ isInvitedParticipant()

ILIAS\Test\Participants\Participant::isInvitedParticipant ( )

Definition at line 140 of file Participant.php.

Referenced by ILIAS\Test\Participants\ParticipantTableIpRangeAction\allowActionForRecord().

140  : bool
141  {
142  return $this->invitation_date > 0;
143  }
+ Here is the caller graph for this function:

◆ withAddedExtraTime()

ILIAS\Test\Participants\Participant::withAddedExtraTime ( int  $extra_time)

Definition at line 98 of file Participant.php.

98  : self
99  {
100  $clone = clone $this;
101  $clone->extra_time += $extra_time;
102  return $clone;
103  }

◆ withAttemptOverviewInformation()

ILIAS\Test\Participants\Participant::withAttemptOverviewInformation ( ?AttemptOverview  $attempt_overview)

Definition at line 219 of file Participant.php.

References ILIAS\Test\Participants\Participant\$attempt_overview.

Referenced by ILIAS\Test\Results\Data\Factory\addAttemptOverviewInformationToParticipants().

219  : self
220  {
221  $clone = clone $this;
222  $clone->attempt_overview = $attempt_overview;
223  return $clone;
224  }
+ Here is the caller graph for this function:

◆ withClientIpFrom()

ILIAS\Test\Participants\Participant::withClientIpFrom ( ?string  $ip)

Definition at line 115 of file Participant.php.

References null.

Referenced by ILIAS\Test\Participants\ParticipantTableIpRangeAction\onSubmit().

115  : self
116  {
117  if ($ip === '') {
118  $ip = null;
119  }
120  $clone = clone $this;
121  $clone->client_ip_from = $ip;
122  return $clone;
123  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ withClientIpTo()

ILIAS\Test\Participants\Participant::withClientIpTo ( ?string  $ip)

Definition at line 130 of file Participant.php.

References null.

130  : self
131  {
132  if ($ip === '') {
133  $ip = null;
134  }
135  $clone = clone $this;
136  $clone->client_ip_to = $ip;
137  return $clone;
138  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ withRunningAttemptStart()

ILIAS\Test\Participants\Participant::withRunningAttemptStart ( \DateTimeImmutable  $start_date)

Definition at line 226 of file Participant.php.

Referenced by ILIAS\Test\Results\Data\Factory\addAttemptOverviewInformationToParticipants().

226  : self
227  {
228  $clone = clone $this;
229  $clone->running_attempt_start = $start_date;
230  return $clone;
231  }
+ Here is the caller graph for this function:

Field Documentation

◆ $attempt_overview

AttemptOverview ILIAS\Test\Participants\Participant::$attempt_overview = null
private

◆ $running_attempt_start

DateTimeImmutable ILIAS\Test\Participants\Participant::$running_attempt_start = null
private

Definition at line 28 of file Participant.php.


The documentation for this class was generated from the following file: