ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilExAssignmentInfo 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 ilExAssignmentInfo:

Public Member Functions

 __construct (int $ass_id, int $user_id)
 
 getInstructionInfo ()
 
 getInstructionFileInfo (int $readable_ref_id=0)
 
 getScheduleInfo ()
 
 getSubmissionInfo ()
 

Protected Attributes

ilExcAssMemberState $state
 
ilExAssignment $ass
 
int $user_id
 
ilLanguage $lng
 
ilCtrl $ctrl
 

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

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 22 of file class.ilExAssignmentInfo.php.

Constructor & Destructor Documentation

◆ __construct()

ilExAssignmentInfo::__construct ( int  $ass_id,
int  $user_id 
)
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 33 of file class.ilExAssignmentInfo.php.

References $DIC, $user_id, ILIAS\Repository\ctrl(), ilExcAssMemberState\getInstanceByIds(), and ILIAS\Repository\lng().

34  {
35  global $DIC;
36 
37  $this->state = ilExcAssMemberState::getInstanceByIds($ass_id, $user_id);
38  $this->lng = $DIC->language();
39  $this->ass = new ilExAssignment($ass_id);
40  $this->ctrl = $DIC->ctrl();
41  $this->user_id = $user_id;
42  }
Exercise assignment.
global $DIC
Definition: feed.php:28
static getInstanceByIds(int $a_ass_id, int $a_user_id=0)
+ Here is the call graph for this function:

Member Function Documentation

◆ getInstructionFileInfo()

ilExAssignmentInfo::getInstructionFileInfo ( int  $readable_ref_id = 0)

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

References $ctrl, ilCtrl\clearParametersByClass(), ilCtrl\getLinkTargetByClass(), and ilCtrl\setParameterByClass().

60  : array
61  {
63  $ass_files = $this->ass->getFiles();
64  $items = [];
65  if (count($ass_files) > 0) {
66  foreach ($ass_files as $file) {
67  $dl_link = "";
68  if ($readable_ref_id > 0) {
69  $ctrl->setParameterByClass("ilExSubmissionGUI", "ref_id", $readable_ref_id);
70  $ctrl->setParameterByClass("ilExSubmissionGUI", "ass_id", $this->ass->getId());
71  $ctrl->setParameterByClass("ilExSubmissionGUI", "file", urlencode($file["name"]));
72  $dl_link = $ctrl->getLinkTargetByClass([
73  "ilExerciseHandlerGUI",
74  "ilObjExerciseGUI",
75  "ilExSubmissionGUI"
76  ], "downloadFile");
77  $ctrl->clearParametersByClass("ilExSubmissionGUI");
78  }
79  $items[] = [
80  "txt" => $file["name"],
81  "value" => $dl_link
82  ];
83  }
84  }
85  return $items;
86  }
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
setParameterByClass(string $a_class, string $a_parameter, $a_value)
clearParametersByClass(string $a_class)
+ Here is the call graph for this function:

◆ getInstructionInfo()

ilExAssignmentInfo::getInstructionInfo ( )

Definition at line 44 of file class.ilExAssignmentInfo.php.

References ILIAS\Repository\lng().

Referenced by ilExAssignmentGUI\addInstructions().

44  : array
45  {
46  if ($this->state->areInstructionsVisible()) {
47  $inst = $this->ass->getInstructionPresentation();
48  if (trim($inst)) {
49  return [
50  "instruction" => [
51  "txt" => $this->lng->txt("exc_instruction"),
52  "value" => $inst
53  ]
54  ];
55  }
56  }
57  return [];
58  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScheduleInfo()

ilExAssignmentInfo::getScheduleInfo ( )
Exceptions
ilDateTimeException

Definition at line 91 of file class.ilExAssignmentInfo.php.

References $lng, $state, $txt, ilExcAssMemberState\exceededOfficialDeadline(), ilExcAssMemberState\getCommonDeadline(), ilExcAssMemberState\getCommonDeadlinePresentation(), ilExcAssMemberState\getGeneralStart(), ilExcAssMemberState\getGeneralStartPresentation(), ilExcAssMemberState\getOfficialDeadline(), ilExcAssMemberState\getOfficialDeadlinePresentation(), ilExcAssMemberState\getRelativeDeadline(), ilExcAssMemberState\getRelativeDeadlinePresentation(), ilExcAssMemberState\getRemainingTimePresentation(), ilExcAssMemberState\hasSubmissionStarted(), ilExcAssMemberState\inLateSubmissionPhase(), and ilLanguage\txt().

Referenced by ilExAssignmentGUI\addSchedule().

91  : array
92  {
93  $lng = $this->lng;
94  $ret = [];
96 
97  if ($state->getGeneralStart() > 0) {
98  if ($state->getRelativeDeadline()) {
99  $txt = $lng->txt("exc_earliest_start_time");
100  } else {
101  $txt = $lng->txt("exc_start_time");
102  }
103  $ret["start_time"] = [
104  "txt" => $txt,
105  "value" => $state->getGeneralStartPresentation()
106  ];
107  }
108 
109  // extended deadline info/warning
110  $late_dl = "";
111  if ($state->inLateSubmissionPhase()) {
112  // extended deadline date should not be presented anywhere
114  $late_dl = "<br />" . sprintf($lng->txt("exc_late_submission_warning"), $late_dl);
115  $late_dl = '<span class="warning">' . $late_dl . '</span>';
116  }
117 
118  if ($state->getCommonDeadline()) { // if we have a common deadline (target timestamp)
120 
121  // add late info if no idl
122  if ($late_dl &&
124  $until .= $late_dl;
125  }
126 
127  $prop = $lng->txt("exc_edit_until");
129  $prop = $lng->txt("exc_ended_on");
130  }
131 
132  $ret["until"] = ["txt" => $prop, "value" => $until];
133  } elseif ($state->getRelativeDeadline()) { // if we only have a relative deadline (not started yet)
134  $ret["time_after_start"] = ["txt" => $lng->txt("exc_rem_time_after_start"), "value" => $state->getRelativeDeadlinePresentation()];
135  }
136 
139 
140  // add late info?
141  if ($late_dl) {
142  $until .= $late_dl;
143  }
144 
145  $ret["individual_deadline"] = ["txt" => $lng->txt("exc_individual_deadline"), "value" => $until];
146  }
147 
148  if ($state->hasSubmissionStarted()) {
149  $ret["time_to_send"] = ["txt" => $lng->txt("exc_time_to_send"), "value" => "<b>" . $state->getRemainingTimePresentation() . "</b>"];
150  }
151  return $ret;
152  }
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...
hasSubmissionStarted()
Check if the submission phase has started for the current user (if the assignment is generally starte...
ilExcAssMemberState $state
$txt
Definition: error.php:13
getRemainingTimePresentation()
Remaining time presentation (based on official deadline)
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:

◆ getSubmissionInfo()

ilExAssignmentInfo::getSubmissionInfo ( )
Exceptions
ilDateTimeException

Definition at line 157 of file class.ilExAssignmentInfo.php.

References ilDatePresentation\formatDate(), IL_CAL_DATETIME, and ILIAS\Repository\lng().

157  : array
158  {
159  // submitted files
160  $submission = new ilExSubmission($this->ass, $this->user_id);
161  $ret = [];
162  if ($submission->hasSubmitted()) {
163  // #16888
164  $submitted = $submission->getSelectedObject();
165  if ($submitted["ts"] != "") {
166  $ret["submitted"] = [
167  "txt" => $this->lng->txt("exc_last_submission"),
168  "value" => ilDatePresentation::formatDate(new ilDateTime($submitted["ts"], IL_CAL_DATETIME))
169  ];
170  }
171  }
172  return $ret;
173  }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

Field Documentation

◆ $ass

ilExAssignment ilExAssignmentInfo::$ass
protected

Definition at line 25 of file class.ilExAssignmentInfo.php.

◆ $ctrl

ilCtrl ilExAssignmentInfo::$ctrl
protected

Definition at line 28 of file class.ilExAssignmentInfo.php.

Referenced by getInstructionFileInfo().

◆ $lng

ilLanguage ilExAssignmentInfo::$lng
protected

Definition at line 27 of file class.ilExAssignmentInfo.php.

Referenced by getScheduleInfo().

◆ $state

ilExcAssMemberState ilExAssignmentInfo::$state
protected

Definition at line 24 of file class.ilExAssignmentInfo.php.

Referenced by getScheduleInfo().

◆ $user_id

int ilExAssignmentInfo::$user_id
protected

Definition at line 26 of file class.ilExAssignmentInfo.php.

Referenced by __construct().


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