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;
104 $user = ($a_user_id > 0)
108 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
115 include_once(
"./Modules/Exercise/classes/class.ilExAssignmentTeam.php");
117 if ($team->getId()) {
124 include_once(
"./Modules/Exercise/classes/class.ilExcIndividualDeadline.php");
137 return new self($a_ass, $a_user, $a_idl, $a_time,
$lng, $a_team);
159 return $this->assignment->getStartTime();
183 return $this->idl->getStartingTimestamp();
196 return !$this->assignment->notStartedYet();
206 $calculated_deadline = 0;
208 if ($this->idl->getStartingTimestamp() && $this->assignment->getRelativeDeadline()) {
209 $calculated_deadline = $this->idl->getStartingTimestamp() + ($this->assignment->getRelativeDeadline() * 24 * 60 * 60);
212 return $calculated_deadline;
223 return $this->assignment->getRelativeDeadline();
250 $dl = $this->idl->getIndividualDeadline();
253 return max($this->assignment->getDeadline(), $dl);
283 if ($od && $od < time()) {
299 if ($official_deadline == 0) {
300 return $lng->txt(
"exc_no_deadline_specified");
302 if ($official_deadline - $this->time <= 0) {
303 $time_str =
$lng->txt(
"exc_time_over_short");
318 if ($this->idl->getIndividualDeadline() > $this->getCommonDeadline()) {
319 return $this->idl->getIndividualDeadline();
347 return $this->assignment->getDeadline();
364 return "no deadline";
384 if ($this->assignment->getPeerReview() &&
385 $this->assignment->getPeerReviewDeadline()) {
386 return $this->assignment->getPeerReviewDeadline();
402 return "no peer review deadline";
412 if ($this->assignment->getPeerReview() && $this->hasSubmissionEndedForAllUsers()
413 && ($this->getPeerReviewDeadline() == 0 || $this->getPeerReviewDeadline() > $this->time)) {
427 if ($a_timestamp > 0) {
496 $this->getIndividualStart() > 0)) {
527 $global_subm_end = max($this->
getEffectiveDeadline(), $this->assignment->getLastPersonalDeadline());
529 if ($global_subm_end == 0) {
533 if ($this->time > $global_subm_end) {
564 if (!$this->assignment->getFeedbackFile()) {
572 $access = $this->assignment->afterCustomDate();
An exception for terminatinating execution or to throw for unit testing.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
Exercise assignment team.
static getInstanceByUserId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
getId()
Get assignment id.
const FEEDBACK_DATE_CUSTOM
const FEEDBACK_DATE_DEADLINE
Exercise submission //TODO: This class has to much static methods related to delivered "files".
Handles everything about the state (current phase) of a user in an assignment using assignment,...
getPeerReviewDeadlinePresentation()
Get common deadline presentation.
areInstructionsVisible()
Instructions visible.
getOfficialDeadline()
Get official deadline (individual deadline, fixed deadline or calculated deadline (using relative dea...
hasSubmissionEnded()
Check if the submission phase has ended for the current user.
getTimePresentation($a_timestamp)
Get common deadline presentation.
getRemainingTimePresentation()
Remaining time presentation (based on official deadline)
getIndividualStart()
Get individual start.
getEffectiveDeadline()
Get effective deadline (max of official deadline and grace end period) for the user.
exceededOfficialDeadline()
Check if official deadline exists and has ended.
__construct(ilExAssignment $a_ass, ilObjUser $a_user, ilExcIndividualDeadline $a_idl, $a_time, ilLanguage $lng, ilExAssignmentTeam $a_team=null)
ilExcAssMemberState constructor.
hasSubmissionStarted()
Check if the submission phase has started for the current user.
isPeerReviewAllowed()
Is submission currently allowed.
getIndividualDeadlinePresentation()
Get common deadline presentation.
getCommonDeadline()
Get common deadline (no individual deadline or grace period included)
getRelativeDeadline()
Get relative deadline.
getGeneralStart()
Get general start.
getIndividualDeadline()
Get individual deadline.
getCommonDeadlinePresentation()
Get common deadline presentation.
isSubmissionAllowed()
Is submission currently allowed.
isGlobalFeedbackFileAccessible(ilExSubmission $submission)
Is global feedback file accessible?
getRelativeDeadlinePresentation()
Get relative deadline presentation.
getIndividualDeadlineObject()
Get individual deadline object.
inLateSubmissionPhase()
Get late submission warning.
getPeerReviewDeadline()
Get peer review deadline.
getOfficialDeadlinePresentation()
Get official deadline presentation.
getCalculatedDeadline()
Calculated deadline is only given, if a relative deadline is given and the user started the assignmen...
static getInstanceByIds($a_ass_id, $a_user_id=0)
Get instance by IDs (recommended for consumer code)
hasGenerallyStarted()
Has started.
hasSubmissionEndedForAllUsers()
Has submission ended for all users.
static getInstance(ilExAssignment $a_ass, ilObjUser $a_user, ilExcIndividualDeadline $a_idl, $a_time, ilLanguage $lng, ilExAssignmentTeam $a_team=null)
Get instance by dependencies.
getGeneralStartPresentation()
Get start presentation.
static getInstance($a_ass_id, $a_participant_id, $a_is_team=false)
Get instance.
getId()
get object id @access public
static period2String(ilDateTime $a_from, $a_to=null)
Return a string of time period.