ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

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

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  }
+ Here is the call graph for this function:

Member Function Documentation

◆ areInstructionsVisible()

ilExcAssMemberState::areInstructionsVisible ( )

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

References hasSubmissionStarted().

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...
+ Here is the call graph for this function:

◆ exceededOfficialDeadline()

ilExcAssMemberState::exceededOfficialDeadline ( )

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

References getOfficialDeadline().

Referenced by ilExAssignmentInfo\getScheduleInfo().

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...
+ Here is the call graph for this function:
+ 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.

References ilExAssignment\DEADLINE_RELATIVE.

Referenced by getCommonDeadline(), and getOfficialDeadline().

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  }
+ Here is the caller graph for this function:

◆ getCommonDeadline()

ilExcAssMemberState::getCommonDeadline ( )

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

References ilExAssignment\DEADLINE_ABSOLUTE, and getCalculatedDeadline().

Referenced by getCommonDeadlinePresentation(), getIndividualDeadline(), and ilExAssignmentInfo\getScheduleInfo().

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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCommonDeadlinePresentation()

ilExcAssMemberState::getCommonDeadlinePresentation ( )
Returns
string
Exceptions
ilDateTimeException

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

References getCommonDeadline(), and getTimePresentation().

Referenced by ilExAssignmentInfo\getScheduleInfo().

408  : string
409  {
410  if ($this->getCommonDeadline() > 0) {
411  return $this->getTimePresentation($this->getCommonDeadline());
412  }
413 
414  return "no deadline";
415  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEffectiveDeadline()

ilExcAssMemberState::getEffectiveDeadline ( )

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

References getOfficialDeadline().

Referenced by hasSubmissionEnded(), and hasSubmissionEndedForAllUsers().

418  : int
419  {
420  return max($this->getOfficialDeadline(), $this->assignment->getExtendedDeadline());
421  }
getOfficialDeadline()
Get official deadline (individual deadline, fixed deadline or calculated deadline (using relative dea...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGeneralStart()

ilExcAssMemberState::getGeneralStart ( )

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

Referenced by getGeneralStartPresentation(), and ilExAssignmentInfo\getScheduleInfo().

142  : ?int
143  {
144  return $this->assignment->getStartTime();
145  }
+ Here is the caller graph for this function:

◆ getGeneralStartPresentation()

ilExcAssMemberState::getGeneralStartPresentation ( )
Returns
string
Exceptions
ilDateTimeException

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

References getGeneralStart(), and getTimePresentation().

Referenced by ilExAssignmentInfo\getScheduleInfo().

151  : string
152  {
153  if ($this->getGeneralStart()) {
154  return $this->getTimePresentation($this->getGeneralStart());
155  }
156  return "";
157  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIndividualDeadline()

ilExcAssMemberState::getIndividualDeadline ( )

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

References getCommonDeadline().

Referenced by getIndividualDeadlinePresentation().

373  : int
374  {
375  if ($this->idl->getIndividualDeadline() > $this->getCommonDeadline()) {
376  return $this->idl->getIndividualDeadline();
377  }
378  return 0;
379  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIndividualDeadlineObject()

ilExcAssMemberState::getIndividualDeadlineObject ( )

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

References $idl.

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.

References getIndividualDeadline(), and getTimePresentation().

385  : string
386  {
387  if ($this->getIndividualDeadline() > 0) {
388  return $this->getTimePresentation($this->getIndividualDeadline());
389  }
390 
391  return "";
392  }
+ Here is the call graph for this function:

◆ getIndividualStart()

ilExcAssMemberState::getIndividualStart ( )

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

References ilExAssignment\DEADLINE_RELATIVE.

Referenced by hasSubmissionStarted().

159  : int
160  {
161  if ($this->assignment->getDeadlineMode() == ilExAssignment::DEADLINE_RELATIVE) {
162  return $this->idl->getStartingTimestamp();
163  }
164  return 0;
165  }
+ Here is the caller graph for this function:

◆ 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.

References $lng.

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.

References $DIC, ilExcIndividualDeadline\getInstance(), ilExAssignmentTeam\getInstanceByUserId(), null, and ilExAssignment\TYPE_UPLOAD_TEAM.

Referenced by ilExAssignmentInfo\__construct(), ilExSubmission\__construct(), ilCalendarScheduleFilterExercise\addCustomEvents(), ILIAS\Exercise\Assignment\PropertyAndActionBuilderUI\build(), ilAppointmentPresentationExerciseGUI\collectPropertiesAndActions(), ilExSubmissionGUI\downloadFileObject(), ilExSubmissionGUI\downloadGlobalFeedbackFileObject(), ilExPeerReviewGUI\editPeerReviewItemObject(), ilAppointmentExerciseFileHandler\getFiles(), ilExSubmissionTeamGUI\getOverviewContent(), ilExPeerReviewGUI\getOverviewContent(), ilExAssignmentReminder\getReminders(), ilBlogExerciseGUI\getSubmitButton(), ilPortfolioExerciseGUI\getSubmitButton(), ilExerciseDerivedTaskProvider\getTasks(), ilExAssignmentReminder\parsePeerReminders(), and ilObjExerciseGUI\startAssignmentObject().

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  }
ilExcIndividualDeadline $idl
Exercise assignment.
static getInstanceByUserId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
int $member_id
either user id or team id, if this is a team assignment and the user is member of a team...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
static getInstance(int $a_ass_id, int $a_participant_id, bool $a_is_team=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLastSubmissionOfRelativeDeadline()

ilExcAssMemberState::getLastSubmissionOfRelativeDeadline ( )

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

References ilExAssignment\DEADLINE_RELATIVE.

Referenced by getLastSubmissionOfRelativeDeadlinePresentation().

248  : int
249  {
250  if ($this->assignment->getDeadlineMode() == ilExAssignment::DEADLINE_RELATIVE) {
251  return $this->assignment->getRelDeadlineLastSubmission();
252  }
253  return 0;
254  }
+ Here is the caller graph for this function:

◆ getLastSubmissionOfRelativeDeadlinePresentation()

ilExcAssMemberState::getLastSubmissionOfRelativeDeadlinePresentation ( )
Returns
string
Exceptions
ilDateTimeException

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

References getLastSubmissionOfRelativeDeadline(), and getTimePresentation().

Referenced by getRelativeDeadlineStartLeadText().

298  : string
299  {
300  if ($this->getLastSubmissionOfRelativeDeadline() > 0) {
302  }
303 
304  return "";
305  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

References ilExAssignment\DEADLINE_ABSOLUTE, and getCalculatedDeadline().

Referenced by exceededOfficialDeadline(), getEffectiveDeadline(), getOfficialDeadlinePresentation(), getRemainingTimePresentation(), ilExAssignmentInfo\getScheduleInfo(), and inLateSubmissionPhase().

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  }
getCalculatedDeadline()
Calculated deadline is only given, if a relative deadline is given and the user started the assignmen...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOfficialDeadlinePresentation()

ilExcAssMemberState::getOfficialDeadlinePresentation ( )
Returns
string
Exceptions
ilDateTimeException

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

References getOfficialDeadline(), and getTimePresentation().

Referenced by ilExAssignmentInfo\getScheduleInfo().

285  : string
286  {
287  if ($this->getOfficialDeadline() > 0) {
288  return $this->getTimePresentation($this->getOfficialDeadline());
289  }
290 
291  return "";
292  }
getOfficialDeadline()
Get official deadline (individual deadline, fixed deadline or calculated deadline (using relative dea...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPeerReviewDeadline()

ilExcAssMemberState::getPeerReviewDeadline ( )

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

Referenced by getPeerReviewDeadlinePresentation(), getRemainingPeerReviewPresentation(), hasEnded(), and isPeerReviewAllowed().

423  : int
424  {
425  if ($this->assignment->getPeerReview() &&
426  $this->assignment->getPeerReviewDeadline()) {
427  return $this->assignment->getPeerReviewDeadline();
428  }
429  return 0;
430  }
+ Here is the caller graph for this function:

◆ getPeerReviewDeadlinePresentation()

ilExcAssMemberState::getPeerReviewDeadlinePresentation ( )
Returns
string
Exceptions
ilDateTimeException

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

References getPeerReviewDeadline(), and getTimePresentation().

436  : string
437  {
438  if ($this->getPeerReviewDeadline() > 0) {
439  return $this->getTimePresentation($this->getPeerReviewDeadline());
440  }
441 
442  return "no peer review deadline";
443  }
+ Here is the call graph for this function:

◆ getPeerReviewLeadText()

ilExcAssMemberState::getPeerReviewLeadText ( )

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

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

360  : string
361  {
362  $lng = $this->lng;
363  if ($this->assignment->getPeerReviewDeadline() > 0) {
364  return sprintf(
365  $this->lng->txt("exc_peer_reviews_in_lead_text"),
367  );
368  } else {
369  return $this->lng->txt("exc_review_anytime");
370  }
371  }
+ Here is the call graph for this function:

◆ getRelativeDeadline()

ilExcAssMemberState::getRelativeDeadline ( )

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

References ilExAssignment\DEADLINE_RELATIVE.

Referenced by getRelativeDeadlinePresentation(), and ilExAssignmentInfo\getScheduleInfo().

240  : int
241  {
242  if ($this->assignment->getDeadlineMode() == ilExAssignment::DEADLINE_RELATIVE) {
243  return $this->assignment->getRelativeDeadline();
244  }
245  return 0;
246  }
+ Here is the caller graph for this function:

◆ getRelativeDeadlinePresentation()

ilExcAssMemberState::getRelativeDeadlinePresentation ( )

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

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

Referenced by ilExAssignmentInfo\getScheduleInfo().

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

References getLastSubmissionOfRelativeDeadlinePresentation(), getRemainingTimePresentationOfLastSubmissionOfRelativeDeadline(), and ILIAS\Repository\lng().

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"),
210  );
211  }
212  } else {
213  return sprintf(
214  $this->lng->txt("exc_hand_in_lead_text"),
216  );
217  }
218  return $lead_text;
219  }
getRemainingTimePresentationOfLastSubmissionOfRelativeDeadline()
Remaining time for last submission of relative deadline.
+ Here is the call graph for this function:

◆ getRemainingPeerReviewPresentation()

ilExcAssMemberState::getRemainingPeerReviewPresentation ( )

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

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

Referenced by getPeerReviewLeadText().

338  : string
339  {
340  $lng = $this->lng;
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  }
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.
const IL_CAL_UNIX
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRemainingTimeLeadText()

ilExcAssMemberState::getRemainingTimeLeadText ( )

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

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

354  : string
355  {
356  $lng = $this->lng;
357  return sprintf($this->lng->txt("exc_hand_in_lead_text"), $this->getRemainingTimePresentation());
358  }
getRemainingTimePresentation()
Remaining time presentation (based on official deadline)
+ 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.

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

Referenced by getRemainingTimeLeadText(), and ilExAssignmentInfo\getScheduleInfo().

322  : string
323  {
324  $lng = $this->lng;
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  }
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.
const IL_CAL_UNIX
getOfficialDeadline()
Get official deadline (individual deadline, fixed deadline or calculated deadline (using relative dea...
+ 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.

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

Referenced by getRelativeDeadlineStartLeadText().

226  : string
227  {
228  $lng = $this->lng;
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  }
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.
const IL_CAL_UNIX
+ Here is the call graph for this function:
+ Here is the caller 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.

References ilDatePresentation\formatDate(), and IL_CAL_UNIX.

Referenced by getCommonDeadlinePresentation(), getGeneralStartPresentation(), getIndividualDeadlinePresentation(), getLastSubmissionOfRelativeDeadlinePresentation(), getOfficialDeadlinePresentation(), and getPeerReviewDeadlinePresentation().

478  : string
479  {
480  if ($a_timestamp > 0) {
481  return ilDatePresentation::formatDate(new ilDateTime($a_timestamp, IL_CAL_UNIX));
482  }
483 
484  return "";
485  }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasEnded()

ilExcAssMemberState::hasEnded ( )

Check if assignment has ended for current user.

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

References $time, getPeerReviewDeadline(), and hasSubmissionEnded().

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  }
+ Here is the call graph for this function:

◆ hasGenerallyStarted()

ilExcAssMemberState::hasGenerallyStarted ( )

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

Referenced by hasSubmissionStarted(), and isFuture().

167  : bool
168  {
169  return !$this->assignment->notStartedYet();
170  }
+ Here is the caller graph for this function:

◆ 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.

References getEffectiveDeadline().

Referenced by hasEnded(), and isSubmissionAllowed().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasSubmissionEndedForAllUsers()

ilExcAssMemberState::hasSubmissionEndedForAllUsers ( )

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

References getEffectiveDeadline().

Referenced by isGlobalFeedbackFileAccessible(), and isPeerReviewAllowed().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

References ilExAssignment\DEADLINE_ABSOLUTE, ilExAssignment\DEADLINE_ABSOLUTE_INDIVIDUAL, ilExAssignment\DEADLINE_RELATIVE, getIndividualStart(), and hasGenerallyStarted().

Referenced by areInstructionsVisible(), ilExAssignmentInfo\getScheduleInfo(), and isSubmissionAllowed().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ inLateSubmissionPhase()

ilExcAssMemberState::inLateSubmissionPhase ( )

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

References getOfficialDeadline(), and isSubmissionAllowed().

Referenced by ilExAssignmentInfo\getScheduleInfo().

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  }
getOfficialDeadline()
Get official deadline (individual deadline, fixed deadline or calculated deadline (using relative dea...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isFuture()

ilExcAssMemberState::isFuture ( )

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

References hasGenerallyStarted().

555  : bool
556  {
557  return !$this->hasGenerallyStarted();
558  }
+ Here is the call graph for this function:

◆ isGlobalFeedbackFileAccessible()

ilExcAssMemberState::isGlobalFeedbackFileAccessible ( ilExSubmission  $submission)

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

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

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  }
+ Here is the call graph for this function:

◆ isPeerReviewAllowed()

ilExcAssMemberState::isPeerReviewAllowed ( )

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

References $time, getPeerReviewDeadline(), and hasSubmissionEndedForAllUsers().

Referenced by isReceivedFeedbackAccessible().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isReceivedFeedbackAccessible()

ilExcAssMemberState::isReceivedFeedbackAccessible ( )

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

References ILIAS\Repository\int(), and isPeerReviewAllowed().

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"...
+ Here is the call graph for this function:

◆ isSubmissionAllowed()

ilExcAssMemberState::isSubmissionAllowed ( )

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

References hasSubmissionEnded(), and hasSubmissionStarted().

Referenced by inLateSubmissionPhase().

575  : bool
576  {
577  if ($this->hasSubmissionStarted() && !$this->hasSubmissionEnded()) {
578  return true;
579  }
580  return false;
581  }
hasSubmissionStarted()
Check if the submission phase has started for the current user (if the assignment is generally starte...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ needsIndividualDeadline()

ilExcAssMemberState::needsIndividualDeadline ( )

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

References ilExAssignment\DEADLINE_ABSOLUTE_INDIVIDUAL.

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

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.

Referenced by getIndividualDeadlineObject().

◆ $is_team

bool ilExcAssMemberState::$is_team = false
protected

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

◆ $lng

◆ $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.

Referenced by hasEnded(), and isPeerReviewAllowed().

◆ $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: