ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilExcAssMemberState Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilExcAssMemberState:

Public Member Functions

 getIndividualDeadlineObject ()
 
 getGeneralStart ()
 
 getGeneralStartPresentation ()
 
 getIndividualStart ()
 
 hasGenerallyStarted ()
 
 getCalculatedDeadline ()
 Calculated deadline is only given, if a relative deadline is given and the user started the assignment the value may be restricted by the last submission date for relative deadlines. More...
 
 getRelativeDeadlineStartLeadText ()
 
 getRemainingTimePresentationOfLastSubmissionOfRelativeDeadline ()
 Remaining time for last submission of relative deadline. More...
 
 getRelativeDeadline ()
 
 getLastSubmissionOfRelativeDeadline ()
 
 getRelativeDeadlinePresentation ()
 
 getOfficialDeadline ()
 Get official deadline (individual deadline, fixed deadline or calculated deadline (using relative deadline and starting ts)) Grace period is not taken into account here. More...
 
 getOfficialDeadlinePresentation ()
 
 getLastSubmissionOfRelativeDeadlinePresentation ()
 
 exceededOfficialDeadline ()
 
 getRemainingTimePresentation ()
 Remaining time presentation (based on official deadline) More...
 
 getRemainingPeerReviewPresentation ()
 
 getRemainingTimeLeadText ()
 
 getPeerReviewLeadText ()
 
 getIndividualDeadline ()
 
 getIndividualDeadlinePresentation ()
 
 getCommonDeadline ()
 
 getCommonDeadlinePresentation ()
 
 getEffectiveDeadline ()
 
 getPeerReviewDeadline ()
 
 getPeerReviewDeadlinePresentation ()
 
 isPeerReviewAllowed ()
 
 isReceivedFeedbackAccessible ()
 
 areInstructionsVisible ()
 
 inLateSubmissionPhase ()
 
 hasSubmissionStarted ()
 Check if the submission phase has started for the current user (if the assignment is generally started and for relative deadlines, if the user started the assignment) More...
 
 hasSubmissionEnded ()
 
 hasEnded ()
 Check if assignment has ended for current user. More...
 
 isFuture ()
 
 hasSubmissionEndedForAllUsers ()
 
 isSubmissionAllowed ()
 
 isGlobalFeedbackFileAccessible (ilExSubmission $submission)
 
 needsIndividualDeadline ()
 
 hasRequestedIndividualDeadline ()
 

Static Public Member Functions

static getInstanceByIds (int $a_ass_id, int $a_user_id=0)
 
static getInstance (ilExAssignment $a_ass, ilObjUser $a_user, ilExcIndividualDeadline $a_idl, int $a_time, ilLanguage $lng, ?ilExAssignmentTeam $a_team=null)
 Usually you should prefer to use getInstanceByIds. More...
 

Protected Member Functions

 __construct (ilExAssignment $a_ass, ilObjUser $a_user, ilExcIndividualDeadline $a_idl, int $a_time, ilLanguage $lng, ?ilExAssignmentTeam $a_team=null)
 
 getTimePresentation ($a_timestamp)
 

Protected Attributes

int $ass_id
 
int $user_id
 
ilExAssignment $assignment
 
int $time
 
ilLanguage $lng
 
int $member_id
 either user id or team id, if this is a team assignment and the user is member of a team, in this case is_team is true More...
 
int $team_id = 0
 
bool $is_team = false
 
ilExcIndividualDeadline $idl
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Handles everything about the state (current phase) of a user in an assignment using assignment, individual deadline, user and team information.

  • General Start: As entered in settings. For absolute deadlines, this also starts the submission, for relative deadline this allows the user to start the submission period. (0 = immediately)
  • Individual Start: TS when user hits "Start" button for an assignment using a relative deadline
  • Submission Start: For absolute deadlines this is General Start, for relative deadlines Individual Start
  • Deadline: absolute Deadline (e.g. 5.12.2017) as set in settings
  • Relative Deadline: relative Deadline (e.g. 10 Days) as set in settings
  • Last Submission for Relative Deadlines: As set in the settings
  • Calculated Deadline: Min of (Starting Timestamp + Relative Deadline, Last Submission for Relative Deadlines)
  • Individual Deadline: Set by tutor in "Submissions and Grade" screen
  • Common Deadline: Deadline or Calculated Deadline Used for "Ended on" or "Edit Until" presentation
  • Official Deadline: Max of (Deadline and Individual Deadline) or (Calculated Deadline and Individual Deadline)
  • Effective Deadline: Max of official deadline and grace period end date
  • Grace Period End Date: As being set in the settings of assignmet by tutor
  • Grace Period: Period between Official Deadline and Grace Period End Date.
  • Submission Period: From Submission Start (if not given immediately) to Max of (Official Deadline and Grace Period End Date)
  • Late Submission Period: Submissions being handed in during Grace Period
  • Peer Review Start: Max of (Official Deadline OF ALL USERS and Grace Period End Date)
  • Peer Review Deadline: As being set in the settings of assignmet by tutor
  • Peer Review Period: From Peer Feedback Start to Peer Feedback Deadline (may be infinite, if no deadline given)
Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 46 of file class.ilExcAssMemberState.php.

Constructor & Destructor Documentation

◆ __construct()

ilExcAssMemberState::__construct ( ilExAssignment  $a_ass,
ilObjUser  $a_user,
ilExcIndividualDeadline  $a_idl,
int  $a_time,
ilLanguage  $lng,
?ilExAssignmentTeam  $a_team = null 
)
protected

Definition at line 63 of file class.ilExcAssMemberState.php.

70 {
71 $this->time = $a_time;
72 $this->ass_id = $a_ass->getId();
73 $this->user_id = $a_user->getId();
74 $this->member_id = $a_user->getId();
75 $this->lng = $lng;
76
77 $this->assignment = $a_ass;
78
79 // check team status
80 $this->is_team = false;
81 if ($this->assignment->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) {
82 if ($a_team->getId()) {
83 $this->member_id = $a_team->getId();
84 $this->team_id = $a_team->getId();
85 $this->is_team = true;
86 }
87 }
88
89 $this->idl = $a_idl;
90 }

References $lng, ilExAssignment\getId(), ilObject\getId(), ILIAS\Repository\lng(), and ilExAssignment\TYPE_UPLOAD_TEAM.

+ Here is the call graph for this function:

Member Function Documentation

◆ areInstructionsVisible()

ilExcAssMemberState::areInstructionsVisible ( )

Definition at line 487 of file class.ilExcAssMemberState.php.

487 : bool
488 {
489 return $this->hasSubmissionStarted();
490 }
hasSubmissionStarted()
Check if the submission phase has started for the current user (if the assignment is generally starte...

◆ exceededOfficialDeadline()

ilExcAssMemberState::exceededOfficialDeadline ( )

Definition at line 308 of file class.ilExcAssMemberState.php.

308 : bool
309 {
310 $od = $this->getOfficialDeadline();
311 if ($od && $od < time()) {
312 return true;
313 }
314 return false;
315 }
getOfficialDeadline()
Get official deadline (individual deadline, fixed deadline or calculated deadline (using relative dea...

Referenced by ilExAssignmentInfo\getScheduleInfo().

+ Here is the caller graph for this function:

◆ getCalculatedDeadline()

ilExcAssMemberState::getCalculatedDeadline ( )

Calculated deadline is only given, if a relative deadline is given and the user started the assignment the value may be restricted by the last submission date for relative deadlines.

Definition at line 177 of file class.ilExcAssMemberState.php.

177 : int
178 {
179 $calculated_deadline = 0;
180 if ($this->assignment->getDeadlineMode() == ilExAssignment::DEADLINE_RELATIVE) {
181 if ($this->idl->getStartingTimestamp() && $this->assignment->getRelativeDeadline()) {
182 $calculated_deadline = $this->idl->getStartingTimestamp() + ($this->assignment->getRelativeDeadline() * 24 * 60 * 60);
183 }
184 if ($this->assignment->getRelDeadlineLastSubmission() > 0 &&
185 $calculated_deadline > $this->assignment->getRelDeadlineLastSubmission()) {
186 $calculated_deadline = $this->assignment->getRelDeadlineLastSubmission();
187 }
188 }
189 return $calculated_deadline;
190 }

References ilExAssignment\DEADLINE_RELATIVE.

◆ getCommonDeadline()

ilExcAssMemberState::getCommonDeadline ( )

Definition at line 395 of file class.ilExcAssMemberState.php.

395 : int
396 {
397 if ($this->assignment->getDeadlineMode() == ilExAssignment::DEADLINE_ABSOLUTE) { // absolute deadline
398 return $this->assignment->getDeadline();
399 }
400
401 return $this->getCalculatedDeadline();
402 }
getCalculatedDeadline()
Calculated deadline is only given, if a relative deadline is given and the user started the assignmen...

References ilExAssignment\DEADLINE_ABSOLUTE.

Referenced by ilExAssignmentInfo\getScheduleInfo().

+ Here is the caller graph for this function:

◆ getCommonDeadlinePresentation()

ilExcAssMemberState::getCommonDeadlinePresentation ( )
Returns
string
Exceptions
ilDateTimeException

Definition at line 408 of file class.ilExcAssMemberState.php.

408 : string
409 {
410 if ($this->getCommonDeadline() > 0) {
411 return $this->getTimePresentation($this->getCommonDeadline());
412 }
413
414 return "no deadline";
415 }

Referenced by ilExAssignmentInfo\getScheduleInfo().

+ Here is the caller graph for this function:

◆ getEffectiveDeadline()

ilExcAssMemberState::getEffectiveDeadline ( )

Definition at line 418 of file class.ilExcAssMemberState.php.

418 : int
419 {
420 return max($this->getOfficialDeadline(), $this->assignment->getExtendedDeadline());
421 }

◆ getGeneralStart()

ilExcAssMemberState::getGeneralStart ( )

Definition at line 142 of file class.ilExcAssMemberState.php.

142 : ?int
143 {
144 return $this->assignment->getStartTime();
145 }

Referenced by ilExAssignmentInfo\getScheduleInfo().

+ Here is the caller graph for this function:

◆ getGeneralStartPresentation()

ilExcAssMemberState::getGeneralStartPresentation ( )
Returns
string
Exceptions
ilDateTimeException

Definition at line 151 of file class.ilExcAssMemberState.php.

151 : string
152 {
153 if ($this->getGeneralStart()) {
154 return $this->getTimePresentation($this->getGeneralStart());
155 }
156 return "";
157 }

Referenced by ilExAssignmentInfo\getScheduleInfo().

+ Here is the caller graph for this function:

◆ getIndividualDeadline()

ilExcAssMemberState::getIndividualDeadline ( )

Definition at line 373 of file class.ilExcAssMemberState.php.

373 : int
374 {
375 if ($this->idl->getIndividualDeadline() > $this->getCommonDeadline()) {
376 return $this->idl->getIndividualDeadline();
377 }
378 return 0;
379 }

◆ getIndividualDeadlineObject()

ilExcAssMemberState::getIndividualDeadlineObject ( )

Definition at line 137 of file class.ilExcAssMemberState.php.

138 {
139 return $this->idl;
140 }
ilExcIndividualDeadline $idl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getIndividualDeadlinePresentation()

ilExcAssMemberState::getIndividualDeadlinePresentation ( )
Returns
string
Exceptions
ilDateTimeException

Definition at line 385 of file class.ilExcAssMemberState.php.

385 : string
386 {
387 if ($this->getIndividualDeadline() > 0) {
388 return $this->getTimePresentation($this->getIndividualDeadline());
389 }
390
391 return "";
392 }

◆ getIndividualStart()

ilExcAssMemberState::getIndividualStart ( )

Definition at line 159 of file class.ilExcAssMemberState.php.

159 : int
160 {
161 if ($this->assignment->getDeadlineMode() == ilExAssignment::DEADLINE_RELATIVE) {
162 return $this->idl->getStartingTimestamp();
163 }
164 return 0;
165 }

References ilExAssignment\DEADLINE_RELATIVE.

◆ getInstance()

static ilExcAssMemberState::getInstance ( ilExAssignment  $a_ass,
ilObjUser  $a_user,
ilExcIndividualDeadline  $a_idl,
int  $a_time,
ilLanguage  $lng,
?ilExAssignmentTeam  $a_team = null 
)
static

Usually you should prefer to use getInstanceByIds.

If you use getInstance you need to ensure consistency (e.g. deadline needs to match user)

Definition at line 126 of file class.ilExcAssMemberState.php.

134 return new self($a_ass, $a_user, $a_idl, $a_time, $lng, $a_team);
135 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getInstanceByIds()

static ilExcAssMemberState::getInstanceByIds ( int  $a_ass_id,
int  $a_user_id = 0 
)
static

Definition at line 93 of file class.ilExcAssMemberState.php.

97 global $DIC;
98
99 $lng = $DIC->language();
100 $user = ($a_user_id > 0)
101 ? new ilObjUser($a_user_id)
102 : $DIC->user();
103
104 $ass = new ilExAssignment($a_ass_id);
105
106 $member_id = $user->getId();
107 $is_team = false;
108 $team = null;
109 if ($ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) { // better move this to ilExcIndividualDeadline
110 $team = ilExAssignmentTeam::getInstanceByUserId($a_ass_id, $user->getId());
111 if ($team->getId()) {
112 $member_id = $team->getId();
113 $is_team = true;
114 }
115 }
116
117 // note: team may be not null, but is_team still false
119
120 return self::getInstance($ass, $user, $idl, time(), $lng, $team);
121 }
static getInstanceByUserId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
Exercise assignment.
static getInstance(ilExAssignment $a_ass, ilObjUser $a_user, ilExcIndividualDeadline $a_idl, int $a_time, ilLanguage $lng, ?ilExAssignmentTeam $a_team=null)
Usually you should prefer to use getInstanceByIds.
int $member_id
either user id or team id, if this is a team assignment and the user is member of a team,...
static getInstance(int $a_ass_id, int $a_participant_id, bool $a_is_team=false)
User class.
global $DIC
Definition: shib_login.php:26

Referenced by ilExSubmission\__construct(), ilExAssignmentInfo\__construct(), ilCalendarScheduleFilterExercise\addCustomEvents(), ilAppointmentPresentationExerciseGUI\collectPropertiesAndActions(), ilExSubmissionGUI\downloadFileObject(), ilExSubmissionGUI\downloadGlobalFeedbackFileObject(), ilAppointmentExerciseFileHandler\getFiles(), ilExerciseDerivedTaskProvider\getTasks(), ilExAssignmentReminder\parsePeerReminders(), and ilObjExerciseGUI\startAssignmentObject().

+ Here is the caller graph for this function:

◆ getLastSubmissionOfRelativeDeadline()

ilExcAssMemberState::getLastSubmissionOfRelativeDeadline ( )

Definition at line 248 of file class.ilExcAssMemberState.php.

248 : int
249 {
250 if ($this->assignment->getDeadlineMode() == ilExAssignment::DEADLINE_RELATIVE) {
251 return $this->assignment->getRelDeadlineLastSubmission();
252 }
253 return 0;
254 }

References ilExAssignment\DEADLINE_RELATIVE.

◆ getLastSubmissionOfRelativeDeadlinePresentation()

ilExcAssMemberState::getLastSubmissionOfRelativeDeadlinePresentation ( )
Returns
string
Exceptions
ilDateTimeException

Definition at line 298 of file class.ilExcAssMemberState.php.

298 : string
299 {
300 if ($this->getLastSubmissionOfRelativeDeadline() > 0) {
302 }
303
304 return "";
305 }

◆ getOfficialDeadline()

ilExcAssMemberState::getOfficialDeadline ( )

Get official deadline (individual deadline, fixed deadline or calculated deadline (using relative deadline and starting ts)) Grace period is not taken into account here.

Definition at line 269 of file class.ilExcAssMemberState.php.

269 : int
270 {
271 $dl = $this->idl->getIndividualDeadline(); // team or user individual deadline
272
273 if ($this->assignment->getDeadlineMode() == ilExAssignment::DEADLINE_ABSOLUTE) { // absolute deadline
274 return max($this->assignment->getDeadline(), $dl); // take what's greater: idl or abs deadline
275 }
276
277 // relative deadline: take max idl or calculated deadline
278 return max($this->getCalculatedDeadline(), $dl);
279 }

References ilExAssignment\DEADLINE_ABSOLUTE.

Referenced by ilExAssignmentInfo\getScheduleInfo().

+ Here is the caller graph for this function:

◆ getOfficialDeadlinePresentation()

ilExcAssMemberState::getOfficialDeadlinePresentation ( )
Returns
string
Exceptions
ilDateTimeException

Definition at line 285 of file class.ilExcAssMemberState.php.

285 : string
286 {
287 if ($this->getOfficialDeadline() > 0) {
288 return $this->getTimePresentation($this->getOfficialDeadline());
289 }
290
291 return "";
292 }

Referenced by ilExAssignmentInfo\getScheduleInfo().

+ Here is the caller graph for this function:

◆ getPeerReviewDeadline()

ilExcAssMemberState::getPeerReviewDeadline ( )

Definition at line 423 of file class.ilExcAssMemberState.php.

423 : int
424 {
425 if ($this->assignment->getPeerReview() &&
426 $this->assignment->getPeerReviewDeadline()) {
427 return $this->assignment->getPeerReviewDeadline();
428 }
429 return 0;
430 }

◆ getPeerReviewDeadlinePresentation()

ilExcAssMemberState::getPeerReviewDeadlinePresentation ( )
Returns
string
Exceptions
ilDateTimeException

Definition at line 436 of file class.ilExcAssMemberState.php.

436 : string
437 {
438 if ($this->getPeerReviewDeadline() > 0) {
439 return $this->getTimePresentation($this->getPeerReviewDeadline());
440 }
441
442 return "no peer review deadline";
443 }

◆ getPeerReviewLeadText()

ilExcAssMemberState::getPeerReviewLeadText ( )

Definition at line 360 of file class.ilExcAssMemberState.php.

360 : string
361 {
363 if ($this->assignment->getPeerReviewDeadline() > 0) {
364 return sprintf(
365 $this->lng->txt("exc_peer_reviews_in_lead_text"),
366 $this->getRemainingPeerReviewPresentation()
367 );
368 } else {
369 return $this->lng->txt("exc_review_anytime");
370 }
371 }

References $lng, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getRelativeDeadline()

ilExcAssMemberState::getRelativeDeadline ( )

Definition at line 240 of file class.ilExcAssMemberState.php.

240 : int
241 {
242 if ($this->assignment->getDeadlineMode() == ilExAssignment::DEADLINE_RELATIVE) {
243 return $this->assignment->getRelativeDeadline();
244 }
245 return 0;
246 }

References ilExAssignment\DEADLINE_RELATIVE.

Referenced by ilExAssignmentInfo\getScheduleInfo().

+ Here is the caller graph for this function:

◆ getRelativeDeadlinePresentation()

ilExcAssMemberState::getRelativeDeadlinePresentation ( )

Definition at line 256 of file class.ilExcAssMemberState.php.

256 : string
257 {
258 if ($this->assignment->getDeadlineMode() == ilExAssignment::DEADLINE_RELATIVE) {
259 return $this->getRelativeDeadline() . " " . $this->lng->txt("days");
260 }
261 return "";
262 }

References ilExAssignment\DEADLINE_RELATIVE, and ILIAS\Repository\lng().

Referenced by ilExAssignmentInfo\getScheduleInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRelativeDeadlineStartLeadText()

ilExcAssMemberState::getRelativeDeadlineStartLeadText ( )

Definition at line 192 of file class.ilExcAssMemberState.php.

192 : string
193 {
194 $start_in_time = true;
195 if ($this->assignment->getRelDeadlineLastSubmission() > 0) {
196 $starting_now = time() + ($this->assignment->getRelativeDeadline() * 24 * 60 * 60);
197 if ($starting_now > $this->assignment->getRelDeadlineLastSubmission()) {
198 $start_in_time = false;
199 }
200 }
201 if ($start_in_time) {
202 $lead_text = sprintf(
203 $this->lng->txt("exc_rel_start_lead_text"),
204 $this->assignment->getRelativeDeadline()
205 );
206 if ($this->assignment->getRelDeadlineLastSubmission() > 0) {
207 $lead_text .= ", <br>" . sprintf(
208 $this->lng->txt("exc_rel_start_latest_lead_text"),
209 $this->getLastSubmissionOfRelativeDeadlinePresentation()
210 );
211 }
212 } else {
213 return sprintf(
214 $this->lng->txt("exc_hand_in_lead_text"),
215 $this->getRemainingTimePresentationOfLastSubmissionOfRelativeDeadline()
216 );
217 }
218 return $lead_text;
219 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getRemainingPeerReviewPresentation()

ilExcAssMemberState::getRemainingPeerReviewPresentation ( )

Definition at line 338 of file class.ilExcAssMemberState.php.

338 : string
339 {
341 $official_deadline = $this->getPeerReviewDeadline();
342 if ($official_deadline == 0) {
343 return $lng->txt("exc_no_deadline_specified");
344 }
345 if ($official_deadline - $this->time <= 0) {
346 $time_str = $lng->txt("exc_time_over_short");
347 } else {
348 $time_str = ilLegacyFormElementsUtil::period2String(new ilDateTime($official_deadline, IL_CAL_UNIX));
349 }
350
351 return $time_str;
352 }
const IL_CAL_UNIX
@classDescription Date and time handling
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static period2String(ilDateTime $a_from, $a_to=null)
Return a string of time period.

References $lng, IL_CAL_UNIX, and ilLegacyFormElementsUtil\period2String().

+ Here is the call graph for this function:

◆ getRemainingTimeLeadText()

ilExcAssMemberState::getRemainingTimeLeadText ( )

Definition at line 354 of file class.ilExcAssMemberState.php.

354 : string
355 {
357 return sprintf($this->lng->txt("exc_hand_in_lead_text"), $this->getRemainingTimePresentation());
358 }

References $lng, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getRemainingTimePresentation()

ilExcAssMemberState::getRemainingTimePresentation ( )

Remaining time presentation (based on official deadline)

Returns
string
Exceptions
ilDateTimeException

Definition at line 322 of file class.ilExcAssMemberState.php.

322 : string
323 {
325 $official_deadline = $this->getOfficialDeadline();
326 if ($official_deadline == 0) {
327 return $lng->txt("exc_no_deadline_specified");
328 }
329 if ($official_deadline - $this->time <= 0) {
330 $time_str = $lng->txt("exc_time_over_short");
331 } else {
332 $time_str = ilLegacyFormElementsUtil::period2String(new ilDateTime($official_deadline, IL_CAL_UNIX));
333 }
334
335 return $time_str;
336 }

References $lng, IL_CAL_UNIX, and ilLegacyFormElementsUtil\period2String().

Referenced by ilExAssignmentInfo\getScheduleInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRemainingTimePresentationOfLastSubmissionOfRelativeDeadline()

ilExcAssMemberState::getRemainingTimePresentationOfLastSubmissionOfRelativeDeadline ( )

Remaining time for last submission of relative deadline.

Returns
string
Exceptions
ilDateTimeException

Definition at line 226 of file class.ilExcAssMemberState.php.

226 : string
227 {
229 $last_deadline = $this->assignment->getRelDeadlineLastSubmission();
230 if ($last_deadline - $this->time <= 0) {
231 $time_str = $lng->txt("exc_time_over_short");
232 } else {
233 $time_str = ilLegacyFormElementsUtil::period2String(new ilDateTime($last_deadline, IL_CAL_UNIX));
234 }
235
236 return $time_str;
237 }

References $lng, IL_CAL_UNIX, and ilLegacyFormElementsUtil\period2String().

+ Here is the call graph for this function:

◆ getTimePresentation()

ilExcAssMemberState::getTimePresentation (   $a_timestamp)
protected
Parameters
$a_timestamp
Returns
string
Exceptions
ilDateTimeException

Definition at line 478 of file class.ilExcAssMemberState.php.

478 : string
479 {
480 if ($a_timestamp > 0) {
481 return ilDatePresentation::formatDate(new ilDateTime($a_timestamp, IL_CAL_UNIX));
482 }
483
484 return "";
485 }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)

References ilDatePresentation\formatDate(), and IL_CAL_UNIX.

+ Here is the call graph for this function:

◆ hasEnded()

ilExcAssMemberState::hasEnded ( )

Check if assignment has ended for current user.

Definition at line 545 of file class.ilExcAssMemberState.php.

545 : bool
546 {
547 if ($this->hasSubmissionEnded()) {
548 if (!$this->assignment->getPeerReview() || ($this->getPeerReviewDeadline() !== 0 && $this->getPeerReviewDeadline() < $this->time)) {
549 return true;
550 }
551 }
552 return false;
553 }

◆ hasGenerallyStarted()

ilExcAssMemberState::hasGenerallyStarted ( )

Definition at line 167 of file class.ilExcAssMemberState.php.

167 : bool
168 {
169 return !$this->assignment->notStartedYet();
170 }

◆ hasRequestedIndividualDeadline()

ilExcAssMemberState::hasRequestedIndividualDeadline ( )

Definition at line 610 of file class.ilExcAssMemberState.php.

610 : bool
611 {
612 return $this->idl->getRequested();
613 }

◆ hasSubmissionEnded()

ilExcAssMemberState::hasSubmissionEnded ( )

Definition at line 530 of file class.ilExcAssMemberState.php.

530 : bool
531 {
532 if ($this->getEffectiveDeadline() == 0) {
533 return false;
534 }
535
536 if ($this->time > $this->getEffectiveDeadline()) {
537 return true;
538 }
539 return false;
540 }

◆ hasSubmissionEndedForAllUsers()

ilExcAssMemberState::hasSubmissionEndedForAllUsers ( )

Definition at line 561 of file class.ilExcAssMemberState.php.

561 : bool
562 {
563 $global_subm_end = max($this->getEffectiveDeadline(), $this->assignment->getLastPersonalDeadline());
564
565 if ($global_subm_end == 0) {
566 return false;
567 }
568
569 if ($this->time > $global_subm_end) {
570 return true;
571 }
572 return false;
573 }

◆ hasSubmissionStarted()

ilExcAssMemberState::hasSubmissionStarted ( )

Check if the submission phase has started for the current user (if the assignment is generally started and for relative deadlines, if the user started the assignment)

Definition at line 509 of file class.ilExcAssMemberState.php.

509 : bool
510 {
511 $deadline_type_specific_started = false;
512 switch ($this->assignment->getDeadlineMode()) {
514 $deadline_type_specific_started = true;
515 break;
517 $deadline_type_specific_started = ($this->getIndividualStart() > 0);
518 break;
520 $deadline_type_specific_started = ($this->idl->getIndividualDeadline() > 0);
521 break;
522 }
523 if ($deadline_type_specific_started && $this->hasGenerallyStarted()) {
524 return true;
525 }
526 return false;
527 }

References ilExAssignment\DEADLINE_ABSOLUTE, ilExAssignment\DEADLINE_ABSOLUTE_INDIVIDUAL, and ilExAssignment\DEADLINE_RELATIVE.

Referenced by ilExAssignmentInfo\getScheduleInfo().

+ Here is the caller graph for this function:

◆ inLateSubmissionPhase()

ilExcAssMemberState::inLateSubmissionPhase ( )

Definition at line 492 of file class.ilExcAssMemberState.php.

492 : bool
493 {
494 // official deadline is done, but submission still allowed
495 if ($this->getOfficialDeadline() &&
496 $this->getOfficialDeadline() < $this->time &&
497 $this->isSubmissionAllowed()) {
498 return true;
499 }
500 return false;
501 }

Referenced by ilExAssignmentInfo\getScheduleInfo().

+ Here is the caller graph for this function:

◆ isFuture()

ilExcAssMemberState::isFuture ( )

Definition at line 555 of file class.ilExcAssMemberState.php.

555 : bool
556 {
557 return !$this->hasGenerallyStarted();
558 }

◆ isGlobalFeedbackFileAccessible()

ilExcAssMemberState::isGlobalFeedbackFileAccessible ( ilExSubmission  $submission)

Definition at line 584 of file class.ilExcAssMemberState.php.

584 : bool
585 {
586 if (!$this->assignment->getFeedbackFile()) {
587 return false;
588 }
589
590 // global feedback / sample solution
591 if ($this->assignment->getFeedbackDate() == ilExAssignment::FEEDBACK_DATE_DEADLINE) {
592 $access = $this->hasSubmissionEndedForAllUsers();
593 } elseif ($this->assignment->getFeedbackDate() == ilExAssignment::FEEDBACK_DATE_CUSTOM) {
594 $access = $this->assignment->afterCustomDate();
595 } else {
596 $access = $submission->hasSubmitted();
597 }
598
599 return $access;
600 }

References ilExAssignment\FEEDBACK_DATE_CUSTOM, ilExAssignment\FEEDBACK_DATE_DEADLINE, and ilExSubmission\hasSubmitted().

+ Here is the call graph for this function:

◆ isPeerReviewAllowed()

ilExcAssMemberState::isPeerReviewAllowed ( )

Definition at line 446 of file class.ilExcAssMemberState.php.

446 : bool
447 {
448 if ($this->assignment->getPeerReview() && $this->hasSubmissionEndedForAllUsers()
449 && ($this->getPeerReviewDeadline() == 0 || $this->getPeerReviewDeadline() > $this->time)) {
450 return true;
451 }
452
453 return false;
454 }

◆ isReceivedFeedbackAccessible()

ilExcAssMemberState::isReceivedFeedbackAccessible ( )

Definition at line 456 of file class.ilExcAssMemberState.php.

456 : bool
457 {
458 if (!$this->isPeerReviewAllowed()) {
459 return false;
460 }
461 $submission = new ilExSubmission($this->assignment, $this->user_id);
462 $nr_missing_fb = (int) $submission->getPeerReview()?->getNumberOfMissingFeedbacksForReceived();
463 if ((!$this->assignment->getPeerReviewDeadline() ||
464 $this->assignment->getPeerReviewDeadline() < time())) {
465
466 if ($nr_missing_fb <= 0) {
467 return true;
468 }
469 }
470 return false;
471 }
Exercise submission //TODO: This class has many static methods related to delivered "files".

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ isSubmissionAllowed()

ilExcAssMemberState::isSubmissionAllowed ( )

Definition at line 575 of file class.ilExcAssMemberState.php.

575 : bool
576 {
577 if ($this->hasSubmissionStarted() && !$this->hasSubmissionEnded()) {
578 return true;
579 }
580 return false;
581 }

◆ needsIndividualDeadline()

ilExcAssMemberState::needsIndividualDeadline ( )

Definition at line 602 of file class.ilExcAssMemberState.php.

602 : bool
603 {
604 if ($this->assignment->getDeadlineMode() === ilExAssignment::DEADLINE_ABSOLUTE_INDIVIDUAL && $this->idl->getIndividualDeadline() === 0) {
605 return true;
606 }
607 return false;
608 }

References ilExAssignment\DEADLINE_ABSOLUTE_INDIVIDUAL.

Field Documentation

◆ $ass_id

int ilExcAssMemberState::$ass_id
protected

Definition at line 48 of file class.ilExcAssMemberState.php.

◆ $assignment

ilExAssignment ilExcAssMemberState::$assignment
protected

Definition at line 50 of file class.ilExcAssMemberState.php.

◆ $idl

ilExcIndividualDeadline ilExcAssMemberState::$idl
protected

Definition at line 61 of file class.ilExcAssMemberState.php.

◆ $is_team

bool ilExcAssMemberState::$is_team = false
protected

Definition at line 60 of file class.ilExcAssMemberState.php.

◆ $lng

ilLanguage ilExcAssMemberState::$lng
protected

Definition at line 52 of file class.ilExcAssMemberState.php.

Referenced by __construct().

◆ $member_id

int ilExcAssMemberState::$member_id
protected

either user id or team id, if this is a team assignment and the user is member of a team, in this case is_team is true

Definition at line 58 of file class.ilExcAssMemberState.php.

◆ $team_id

int ilExcAssMemberState::$team_id = 0
protected

Definition at line 59 of file class.ilExcAssMemberState.php.

◆ $time

int ilExcAssMemberState::$time
protected

Definition at line 51 of file class.ilExcAssMemberState.php.

◆ $user_id

int ilExcAssMemberState::$user_id
protected

Definition at line 49 of file class.ilExcAssMemberState.php.


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