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();
77 $this->assignment = $a_ass;
80 $this->is_team =
false;
82 if ($a_team->getId()) {
83 $this->member_id = $a_team->
getId();
84 $this->team_id = $a_team->getId();
85 $this->is_team =
true;
100 $user = ($a_user_id > 0)
111 if ($team->getId()) {
134 return new self($a_ass, $a_user, $a_idl, $a_time,
$lng, $a_team);
144 return $this->assignment->getStartTime();
153 if ($this->getGeneralStart()) {
154 return $this->getTimePresentation($this->getGeneralStart());
162 return $this->idl->getStartingTimestamp();
169 return !$this->assignment->notStartedYet();
179 $calculated_deadline = 0;
181 if ($this->idl->getStartingTimestamp() && $this->assignment->getRelativeDeadline()) {
182 $calculated_deadline = $this->idl->getStartingTimestamp() + ($this->assignment->getRelativeDeadline() * 24 * 60 * 60);
184 if ($this->assignment->getRelDeadlineLastSubmission() > 0 &&
185 $calculated_deadline > $this->assignment->getRelDeadlineLastSubmission()) {
186 $calculated_deadline = $this->assignment->getRelDeadlineLastSubmission();
189 return $calculated_deadline;
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;
201 if ($start_in_time) {
202 $lead_text = sprintf(
203 $this->
lng->txt(
"exc_rel_start_lead_text"),
204 $this->assignment->getRelativeDeadline()
206 if ($this->assignment->getRelDeadlineLastSubmission() > 0) {
207 $lead_text .=
", <br>" . sprintf(
208 $this->
lng->txt(
"exc_rel_start_latest_lead_text"),
209 $this->getLastSubmissionOfRelativeDeadlinePresentation()
214 $this->
lng->txt(
"exc_hand_in_lead_text"),
215 $this->getRemainingTimePresentationOfLastSubmissionOfRelativeDeadline()
229 $last_deadline = $this->assignment->getRelDeadlineLastSubmission();
230 if ($last_deadline - $this->time <= 0) {
231 $time_str =
$lng->txt(
"exc_time_over_short");
243 return $this->assignment->getRelativeDeadline();
251 return $this->assignment->getRelDeadlineLastSubmission();
259 return $this->getRelativeDeadline() .
" " . $this->
lng->txt(
"days");
271 $dl = $this->idl->getIndividualDeadline();
274 return max($this->assignment->getDeadline(), $dl);
278 return max($this->getCalculatedDeadline(), $dl);
287 if ($this->getOfficialDeadline() > 0) {
288 return $this->getTimePresentation($this->getOfficialDeadline());
300 if ($this->getLastSubmissionOfRelativeDeadline() > 0) {
301 return $this->getTimePresentation($this->getLastSubmissionOfRelativeDeadline());
310 $od = $this->getOfficialDeadline();
311 if ($od && $od < time()) {
325 $official_deadline = $this->getOfficialDeadline();
326 if ($official_deadline == 0) {
327 return $lng->txt(
"exc_no_deadline_specified");
329 if ($official_deadline - $this->time <= 0) {
330 $time_str =
$lng->txt(
"exc_time_over_short");
341 $official_deadline = $this->getPeerReviewDeadline();
342 if ($official_deadline == 0) {
343 return $lng->txt(
"exc_no_deadline_specified");
345 if ($official_deadline - $this->time <= 0) {
346 $time_str =
$lng->txt(
"exc_time_over_short");
357 return sprintf($this->
lng->txt(
"exc_hand_in_lead_text"), $this->getRemainingTimePresentation());
363 if ($this->assignment->getPeerReviewDeadline() > 0) {
365 $this->
lng->txt(
"exc_peer_reviews_in_lead_text"),
366 $this->getRemainingPeerReviewPresentation()
369 return $this->
lng->txt(
"exc_review_anytime");
375 if ($this->idl->getIndividualDeadline() > $this->getCommonDeadline()) {
376 return $this->idl->getIndividualDeadline();
387 if ($this->getIndividualDeadline() > 0) {
388 return $this->getTimePresentation($this->getIndividualDeadline());
398 return $this->assignment->getDeadline();
401 return $this->getCalculatedDeadline();
410 if ($this->getCommonDeadline() > 0) {
411 return $this->getTimePresentation($this->getCommonDeadline());
414 return "no deadline";
420 return max($this->getOfficialDeadline(), $this->assignment->getExtendedDeadline());
425 if ($this->assignment->getPeerReview() &&
426 $this->assignment->getPeerReviewDeadline()) {
427 return $this->assignment->getPeerReviewDeadline();
438 if ($this->getPeerReviewDeadline() > 0) {
439 return $this->getTimePresentation($this->getPeerReviewDeadline());
442 return "no peer review deadline";
448 if ($this->assignment->getPeerReview() && $this->hasSubmissionEndedForAllUsers()
449 && ($this->getPeerReviewDeadline() == 0 || $this->getPeerReviewDeadline() > $this->time)) {
458 if (!$this->isPeerReviewAllowed()) {
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())) {
466 if ($nr_missing_fb <= 0) {
480 if ($a_timestamp > 0) {
489 return $this->hasSubmissionStarted();
495 if ($this->getOfficialDeadline() &&
496 $this->getOfficialDeadline() < $this->time &&
497 $this->isSubmissionAllowed()) {
511 $deadline_type_specific_started =
false;
512 switch ($this->assignment->getDeadlineMode()) {
514 $deadline_type_specific_started =
true;
517 $deadline_type_specific_started = ($this->getIndividualStart() > 0);
520 $deadline_type_specific_started = ($this->idl->getIndividualDeadline() > 0);
523 if ($deadline_type_specific_started && $this->hasGenerallyStarted()) {
532 if ($this->getEffectiveDeadline() == 0) {
536 if ($this->time > $this->getEffectiveDeadline()) {
547 if ($this->hasSubmissionEnded()) {
548 if (!$this->assignment->getPeerReview() || ($this->getPeerReviewDeadline() !== 0 && $this->getPeerReviewDeadline() < $this->time)) {
557 return !$this->hasGenerallyStarted();
563 $global_subm_end = max($this->getEffectiveDeadline(), $this->assignment->getLastPersonalDeadline());
565 if ($global_subm_end == 0) {
569 if ($this->time > $global_subm_end) {
577 if ($this->hasSubmissionStarted() && !$this->hasSubmissionEnded()) {
586 if (!$this->assignment->getFeedbackFile()) {
592 $access = $this->hasSubmissionEndedForAllUsers();
594 $access = $this->assignment->afterCustomDate();
612 return $this->idl->getRequested();
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByUserId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
const FEEDBACK_DATE_CUSTOM
const FEEDBACK_DATE_DEADLINE
const DEADLINE_ABSOLUTE_INDIVIDUAL
Exercise submission //TODO: This class has many static methods related to delivered "files".
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPeerReviewDeadlinePresentation()
getRemainingTimePresentationOfLastSubmissionOfRelativeDeadline()
Remaining time for last submission of relative deadline.
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.
needsIndividualDeadline()
getOfficialDeadline()
Get official deadline (individual deadline, fixed deadline or calculated deadline (using relative dea...
getTimePresentation($a_timestamp)
getRemainingTimePresentation()
Remaining time presentation (based on official deadline)
ilExAssignment $assignment
exceededOfficialDeadline()
isReceivedFeedbackAccessible()
getRemainingPeerReviewPresentation()
hasSubmissionStarted()
Check if the submission phase has started for the current user (if the assignment is generally starte...
getIndividualDeadlinePresentation()
getLastSubmissionOfRelativeDeadline()
hasEnded()
Check if assignment has ended for current user.
int $member_id
either user id or team id, if this is a team assignment and the user is member of a team,...
getLastSubmissionOfRelativeDeadlinePresentation()
getCommonDeadlinePresentation()
isGlobalFeedbackFileAccessible(ilExSubmission $submission)
__construct(ilExAssignment $a_ass, ilObjUser $a_user, ilExcIndividualDeadline $a_idl, int $a_time, ilLanguage $lng, ?ilExAssignmentTeam $a_team=null)
getRelativeDeadlineStartLeadText()
getRelativeDeadlinePresentation()
ilExcIndividualDeadline $idl
getIndividualDeadlineObject()
hasRequestedIndividualDeadline()
getOfficialDeadlinePresentation()
getRemainingTimeLeadText()
getCalculatedDeadline()
Calculated deadline is only given, if a relative deadline is given and the user started the assignmen...
hasSubmissionEndedForAllUsers()
getGeneralStartPresentation()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(int $a_ass_id, int $a_participant_id, bool $a_is_team=false)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...