ILIAS  release_7 Revision v7.30-3-g800a261c036
ilExAssignmentGUI Class Reference

GUI class for exercise assignments. More...

+ Collaboration diagram for ilExAssignmentGUI:

Public Member Functions

 __construct (ilObjExercise $a_exc, ilExerciseInternalService $service)
 Constructor. More...
 
 getOverviewHeader (ilExAssignment $a_ass)
 Get assignment header for overview. More...
 
 getOverviewBody (ilExAssignment $a_ass)
 Get assignment body for overview. More...
 
 getTimeString ($a_deadline)
 Get time string for deadline. More...
 

Protected Member Functions

 addInstructions (ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
 
 addSchedule (ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
 
 addPublicSubmissions (ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
 
 addFiles (ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
 
 addSubmission (ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
 
 addSubmissionFeedback (ilInfoScreenGUI $a_info, ilExAssignment $a_ass, $a_feedback_id, $a_show_global_feedback)
 
 getSubmissionLink ($a_cmd, array $a_params=null)
 
 getIconForStatus (string $status, int $variant=ilLPStatusIcons::ICON_VARIANT_LONG)
 Get the rendered icon for a status (failed, passed or not graded). More...
 

Protected Attributes

 $lng
 
 $user
 
 $ctrl
 
 $exc
 
 $current_ass_id
 
 $service
 
 $mandatory_manager
 

Detailed Description

GUI class for exercise assignments.

This is not a real GUI class, could be moved to ilObjExerciseGUI

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

Definition at line 10 of file class.ilExAssignmentGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilExAssignmentGUI::__construct ( ilObjExercise  $a_exc,
ilExerciseInternalService  $service 
)

Constructor.

Definition at line 43 of file class.ilExAssignmentGUI.php.

44 {
45 global $DIC;
46
47 $this->lng = $DIC->language();
48 $this->user = $DIC->user();
49 $this->ctrl = $DIC->ctrl();
50 $this->ui = $DIC->ui();
51
52 $this->exc = $a_exc;
53 $this->service = $service;
54 $this->mandatory_manager = $service->getMandatoryAssignmentManager($this->exc);
55 }
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
ui()
Definition: ui.php:5

References $DIC, $service, ui(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addFiles()

ilExAssignmentGUI::addFiles ( ilInfoScreenGUI  $a_info,
ilExAssignment  $a_ass 
)
protected

Definition at line 272 of file class.ilExAssignmentGUI.php.

273 {
275 $ilCtrl = $this->ctrl;
276
277 $lng->loadLanguageModule("exc");
278
279 $files = $a_ass->getFiles();
280
281 if (count($files) > 0) {
282 $a_info->addSection($lng->txt("exc_files"));
283
284 global $DIC;
285
286 //file has -> name,fullpath,size,ctime
287 $cnt = 0;
288 foreach ($files as $file) {
289 $cnt++;
290 // get mime type
291 $mime = ilObjMediaObject::getMimeType($file['fullpath']);
292
293 list($format, $type) = explode("/", $mime);
294
295 $ui_factory = $DIC->ui()->factory();
296 $ui_renderer = $DIC->ui()->renderer();
297
298 $output_filename = htmlspecialchars($file['name']);
299
300 if (in_array($mime, array("image/jpeg", "image/svg+xml", "image/gif", "image/png"))) {
301 $item_id = "il-ex-modal-img-" . $a_ass->getId() . "-" . $cnt;
302
303
304 $image = $ui_renderer->render($ui_factory->image()->responsive($file['fullpath'], $output_filename));
305 $image_lens = ilUtil::getImagePath("enlarge.svg");
306
307 $modal = ilModalGUI::getInstance();
308 $modal->setId($item_id);
309 $modal->setType(ilModalGUI::TYPE_LARGE);
310 $modal->setBody($image);
311 $modal->setHeading($output_filename);
312 $modal = $modal->getHTML();
313
314 $img_tpl = new ilTemplate("tpl.image_file.html", true, true, "Modules/Exercise");
315 $img_tpl->setCurrentBlock("image_content");
316 $img_tpl->setVariable("MODAL", $modal);
317 $img_tpl->setVariable("ITEM_ID", $item_id);
318 $img_tpl->setVariable("IMAGE", $image);
319 $img_tpl->setvariable("IMAGE_LENS", $image_lens);
320 $img_tpl->setvariable("ALT_LENS", $lng->txt("exc_fullscreen"));
321 $img_tpl->parseCurrentBlock();
322
323 $a_info->addProperty($output_filename, $img_tpl->get());
324 } elseif (in_array($mime, array("audio/mpeg", "audio/ogg", "video/mp4", "video/x-flv", "video/webm"))) {
325 $media_tpl = new ilTemplate("tpl.media_file.html", true, true, "Modules/Exercise");
326 $mp = new ilMediaPlayerGUI();
327 $mp->setFile($file['fullpath']);
328 $media_tpl->setVariable("MEDIA", $mp->getMediaPlayerHtml());
329
330 $but = $ui_factory->button()->shy(
331 $lng->txt("download"),
332 $this->getSubmissionLink("downloadFile", array("file" => urlencode($file["name"])))
333 );
334 $media_tpl->setVariable("DOWNLOAD_BUTTON", $ui_renderer->render($but));
335 $a_info->addProperty($output_filename, $media_tpl->get());
336 } else {
337 $a_info->addProperty($output_filename, $lng->txt("download"), $this->getSubmissionLink("downloadFile", array("file" => urlencode($file["name"]))));
338 }
339 }
340 }
341 }
getId()
Get assignment id.
addProperty($a_name, $a_value, $a_link="")
add a property to current section
addSection($a_title)
add a new section
User interface for media player.
static getInstance()
Get instance.
static getMimeType($a_file, $a_external=null)
get mime type for file
special template class to simplify handling of ITX/PEAR
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$format
Definition: metadata.php:218
$type

References $ctrl, $DIC, $format, $lng, $type, ilInfoScreenGUI\addProperty(), ilInfoScreenGUI\addSection(), ilExAssignment\getFiles(), ilExAssignment\getId(), ilUtil\getImagePath(), ilModalGUI\getInstance(), ilObjMediaObject\getMimeType(), and ilModalGUI\TYPE_LARGE.

Referenced by getOverviewBody().

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

◆ addInstructions()

ilExAssignmentGUI::addInstructions ( ilInfoScreenGUI  $a_info,
ilExAssignment  $a_ass 
)
protected

Definition at line 191 of file class.ilExAssignmentGUI.php.

192 {
194
195 $info = new ilExAssignmentInfo($a_ass->getId(), $ilUser->getId());
196 $inst = $info->getInstructionInfo();
197 if (count($inst) > 0) {
198 $a_info->addSection($inst["instruction"]["txt"]);
199 $a_info->addProperty("", $inst["instruction"]["value"]);
200 }
201 }
$ilUser
Definition: imgupload.php:18

References $ilUser, $user, ilInfoScreenGUI\addProperty(), ilInfoScreenGUI\addSection(), and ilExAssignment\getId().

Referenced by getOverviewBody().

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

◆ addPublicSubmissions()

ilExAssignmentGUI::addPublicSubmissions ( ilInfoScreenGUI  $a_info,
ilExAssignment  $a_ass 
)
protected

Definition at line 249 of file class.ilExAssignmentGUI.php.

250 {
253
254
255 $state = ilExcAssMemberState::getInstanceByIds($a_ass->getId(), $ilUser->getId());
256
257 // submissions are visible, even if other users may still have a larger individual deadline
258 if ($state->hasSubmissionEnded()) {
259 $button = ilLinkButton::getInstance();
260 $button->setCaption("exc_list_submission");
261 $button->setUrl($this->getSubmissionLink("listPublicSubmissions"));
262
263 $a_info->addProperty($lng->txt("exc_public_submission"), $button->render());
264 } else {
265 $a_info->addProperty(
266 $lng->txt("exc_public_submission"),
267 $lng->txt("exc_msg_public_submission")
268 );
269 }
270 }
getSubmissionLink($a_cmd, array $a_params=null)
static getInstanceByIds($a_ass_id, $a_user_id=0)
Get instance by IDs (recommended for consumer code)
static getInstance()
Factory.

References $ilUser, $lng, $user, ilInfoScreenGUI\addProperty(), ilExAssignment\getId(), ilLinkButton\getInstance(), ilExcAssMemberState\getInstanceByIds(), and getSubmissionLink().

Referenced by addSubmission().

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

◆ addSchedule()

ilExAssignmentGUI::addSchedule ( ilInfoScreenGUI  $a_info,
ilExAssignment  $a_ass 
)
protected

Definition at line 203 of file class.ilExAssignmentGUI.php.

204 {
207 $ilCtrl = $this->ctrl;
208
209 $info = new ilExAssignmentInfo($a_ass->getId(), $ilUser->getId());
210 $schedule = $info->getScheduleInfo();
211
212 $state = ilExcAssMemberState::getInstanceByIds($a_ass->getId(), $ilUser->getId());
213
214 $a_info->addSection($lng->txt("exc_schedule"));
215 if ($state->getGeneralStart() > 0) {
216 $a_info->addProperty($schedule["start_time"]["txt"], $schedule["start_time"]["value"]);
217 }
218
219
220 if ($state->getCommonDeadline()) { // if we have a common deadline (target timestamp)
221 $a_info->addProperty($schedule["until"]["txt"], $schedule["until"]["value"]);
222 } elseif ($state->getRelativeDeadline()) { // if we only have a relative deadline (not started yet)
223 $but = "";
224 if ($state->hasGenerallyStarted()) {
225 $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_ass->getId());
226 $but = $this->ui->factory()->button()->primary($lng->txt("exc_start_assignment"), $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "startAssignment"));
227 $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $_GET["ass_id"]);
228 $but = $this->ui->renderer()->render($but);
229 }
230
231 $a_info->addProperty($schedule["time_after_start"]["txt"], $schedule["time_after_start"]["value"] . " " . $but);
232 if ($state->getLastSubmissionOfRelativeDeadline()) { // if we only have a relative deadline (not started yet)
233 $a_info->addProperty(
234 $lng->txt("exc_rel_last_submission"),
235 $state->getLastSubmissionOfRelativeDeadlinePresentation()
236 );
237 }
238 }
239
240 if ($state->getOfficialDeadline() > $state->getCommonDeadline()) {
241 $a_info->addProperty($schedule["individual_deadline"]["txt"], $schedule["individual_deadline"]["value"]);
242 }
243
244 if ($state->hasSubmissionStarted()) {
245 $a_info->addProperty($schedule["time_to_send"]["txt"], $schedule["time_to_send"]["value"]);
246 }
247 }
$_GET["client_id"]

References $_GET, $ctrl, $ilUser, $lng, $user, ilInfoScreenGUI\addProperty(), ilInfoScreenGUI\addSection(), ilExAssignment\getId(), ilExcAssMemberState\getInstanceByIds(), and ui().

Referenced by getOverviewBody().

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

◆ addSubmission()

ilExAssignmentGUI::addSubmission ( ilInfoScreenGUI  $a_info,
ilExAssignment  $a_ass 
)
protected

Definition at line 343 of file class.ilExAssignmentGUI.php.

344 {
346 $ilCtrl = $this->ctrl;
348
349 $state = ilExcAssMemberState::getInstanceByIds($a_ass->getId(), $ilUser->getId());
350
351 $a_info->addSection($lng->txt("exc_your_submission"));
352
353 $submission = new ilExSubmission($a_ass, $ilUser->getId());
354
355 ilExSubmissionGUI::getOverviewContent($a_info, $submission, $this->exc);
356
357 $last_sub = null;
358 if ($submission->hasSubmitted()) {
359 $last_sub = $submission->getLastSubmission();
360 if ($last_sub) {
361 $last_sub = ilDatePresentation::formatDate(new ilDateTime($last_sub, IL_CAL_DATETIME));
362 $a_info->addProperty($lng->txt("exc_last_submission"), $last_sub);
363 }
364 }
365
366 if ($this->exc->getShowSubmissions()) {
367 $this->addPublicSubmissions($a_info, $a_ass);
368 }
369
370 ilExPeerReviewGUI::getOverviewContent($a_info, $submission);
371
372 // global feedback / sample solution
374 $show_global_feedback = ($state->hasSubmissionEndedForAllUsers() && $a_ass->getFeedbackFile());
375 }
376 //If it is not well configured...(e.g. show solution before deadline)
377 //the user can get the solution before he summit it.
378 //we can check in the elseif $submission->hasSubmitted()
380 $show_global_feedback = ($a_ass->afterCustomDate() && $a_ass->getFeedbackFile());
381 } else {
382 $show_global_feedback = ($last_sub && $a_ass->getFeedbackFile());
383 }
384
385 $this->addSubmissionFeedback($a_info, $a_ass, $submission->getFeedbackId(), $show_global_feedback);
386 }
const IL_CAL_DATETIME
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
addSubmissionFeedback(ilInfoScreenGUI $a_info, ilExAssignment $a_ass, $a_feedback_id, $a_show_global_feedback)
addPublicSubmissions(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
getFeedbackDate()
Get (global) feedback file availability date.
getFeedbackFile()
Get (global) feedback file.
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission, ilObjExercise $a_exc)
Exercise submission //TODO: This class has to much static methods related to delivered "files".

References $ctrl, $ilUser, $lng, $user, ilInfoScreenGUI\addProperty(), addPublicSubmissions(), ilInfoScreenGUI\addSection(), addSubmissionFeedback(), ilExAssignment\afterCustomDate(), ilExAssignment\FEEDBACK_DATE_CUSTOM, ilExAssignment\FEEDBACK_DATE_DEADLINE, ilDatePresentation\formatDate(), ilExAssignment\getFeedbackDate(), ilExAssignment\getFeedbackFile(), ilExAssignment\getId(), ilExcAssMemberState\getInstanceByIds(), ilExPeerReviewGUI\getOverviewContent(), ilExSubmissionGUI\getOverviewContent(), and IL_CAL_DATETIME.

Referenced by getOverviewBody().

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

◆ addSubmissionFeedback()

ilExAssignmentGUI::addSubmissionFeedback ( ilInfoScreenGUI  $a_info,
ilExAssignment  $a_ass,
  $a_feedback_id,
  $a_show_global_feedback 
)
protected

Definition at line 388 of file class.ilExAssignmentGUI.php.

389 {
391
392 $storage = new ilFSStorageExercise($a_ass->getExerciseId(), $a_ass->getId());
393 $cnt_files = $storage->countFeedbackFiles($a_feedback_id);
394
395 $lpcomment = $a_ass->getMemberStatus()->getComment();
396 $mark = $a_ass->getMemberStatus()->getMark();
397 $status = $a_ass->getMemberStatus()->getStatus();
398
399 if ($lpcomment != "" ||
400 $mark != "" ||
401 $status != "notgraded" ||
402 $cnt_files > 0 ||
403 $a_show_global_feedback) {
404 $a_info->addSection($lng->txt("exc_feedback_from_tutor"));
405 if ($lpcomment != "") {
406 $a_info->addProperty(
407 $lng->txt("exc_comment"),
408 nl2br($lpcomment)
409 );
410 }
411 if ($mark != "") {
412 $a_info->addProperty(
413 $lng->txt("exc_mark"),
414 $mark
415 );
416 }
417
418 if ($status != "" && $status != "notgraded") {
419 $img = $this->getIconForStatus($status);
420 $a_info->addProperty(
421 $lng->txt("status"),
422 $img . " " . $lng->txt("exc_" . $status)
423 );
424 }
425
426 if ($cnt_files > 0) {
427 $a_info->addSection($lng->txt("exc_fb_files") .
428 '<a name="fb' . $a_ass->getId() . '"></a>');
429
430 if ($cnt_files > 0) {
431 $files = $storage->getFeedbackFiles($a_feedback_id);
432 foreach ($files as $file) {
433 $a_info->addProperty(
434 $file,
435 $lng->txt("download"),
436 $this->getSubmissionLink("downloadFeedbackFile", array("file" => urlencode($file)))
437 );
438 }
439 }
440 }
441
442 // #15002 - global feedback
443 if ($a_show_global_feedback) {
444 $a_info->addSection($lng->txt("exc_global_feedback_file"));
445
446 $a_info->addProperty(
447 $a_ass->getFeedbackFile(),
448 $lng->txt("download"),
449 $this->getSubmissionLink("downloadGlobalFeedbackFile")
450 );
451 }
452 }
453 }
getIconForStatus(string $status, int $variant=ilLPStatusIcons::ICON_VARIANT_LONG)
Get the rendered icon for a status (failed, passed or not graded).
getExerciseId()
Get exercise id.
getMemberStatus($a_user_id=null)
$img
Definition: imgupload.php:57

References $img, $lng, ilInfoScreenGUI\addProperty(), ilInfoScreenGUI\addSection(), ilExAssignment\getExerciseId(), ilExAssignment\getFeedbackFile(), getIconForStatus(), ilExAssignment\getId(), and ilExAssignment\getMemberStatus().

Referenced by addSubmission().

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

◆ getIconForStatus()

ilExAssignmentGUI::getIconForStatus ( string  $status,
int  $variant = ilLPStatusIcons::ICON_VARIANT_LONG 
)
protected

Get the rendered icon for a status (failed, passed or not graded).

Definition at line 501 of file class.ilExAssignmentGUI.php.

501 : string
502 {
503 $icons = ilLPStatusIcons::getInstance($variant);
505
506 switch ($status) {
507 case "passed":
508 return $icons->renderIcon(
509 $icons->getImagePathCompleted(),
510 $lng->txt("exc_" . $status)
511 );
512
513 case "failed":
514 return $icons->renderIcon(
515 $icons->getImagePathFailed(),
516 $lng->txt("exc_" . $status)
517 );
518
519 default:
520 return $icons->renderIcon(
521 $icons->getImagePathNotAttempted(),
522 $lng->txt("exc_" . $status)
523 );
524 }
525 }
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)

References $lng, and ilLPStatusIcons\getInstance().

Referenced by addSubmissionFeedback(), and getOverviewHeader().

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

◆ getOverviewBody()

ilExAssignmentGUI::getOverviewBody ( ilExAssignment  $a_ass)

Get assignment body for overview.

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

160 {
161 global $DIC;
162
163 $ilUser = $DIC->user();
164
165 $this->current_ass_id = $a_ass->getId();
166
167 $tpl = new ilTemplate("tpl.assignment_body.html", true, true, "Modules/Exercise");
168
169 $state = ilExcAssMemberState::getInstanceByIds($a_ass->getId(), $ilUser->getId());
170
171 $info = new ilInfoScreenGUI(null);
172 $info->setTableClass("");
173
174 if ($state->areInstructionsVisible()) {
175 $this->addInstructions($info, $a_ass);
176 $this->addFiles($info, $a_ass);
177 }
178
179 $this->addSchedule($info, $a_ass);
180
181 if ($state->hasSubmissionStarted()) {
182 $this->addSubmission($info, $a_ass);
183 }
184
185 $tpl->setVariable("CONTENT", $info->getHTML());
186
187 return $tpl->get();
188 }
addSubmission(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
addSchedule(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
addFiles(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
addInstructions(ilInfoScreenGUI $a_info, ilExAssignment $a_ass)
Class ilInfoScreenGUI.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

References $DIC, $ilUser, $tpl, addFiles(), addInstructions(), addSchedule(), addSubmission(), ilExAssignment\getId(), and ilExcAssMemberState\getInstanceByIds().

+ Here is the call graph for this function:

◆ getOverviewHeader()

ilExAssignmentGUI::getOverviewHeader ( ilExAssignment  $a_ass)

Get assignment header for overview.

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

61 {
64
65 $lng->loadLanguageModule("exc");
66
67 $state = ilExcAssMemberState::getInstanceByIds($a_ass->getId(), $ilUser->getId());
68
69 $tpl = new ilTemplate("tpl.assignment_head.html", true, true, "Modules/Exercise");
70
71 // we are completely ignoring the extended deadline here
72
73 $idl = $a_ass->getPersonalDeadline($ilUser->getId());
74
75 // :TODO: meaning of "ended on"
76 $dl = max($a_ass->getDeadline(), $idl);
77 // if ($dl &&
78 // $dl < time())
79 if ($state->exceededOfficialDeadline()) {
80 $tpl->setCurrentBlock("prop");
81 $tpl->setVariable("PROP", $lng->txt("exc_ended_on"));
82 $tpl->setVariable("PROP_VAL", $state->getCommonDeadlinePresentation());
83 $tpl->parseCurrentBlock();
84
85 // #14077 // this currently shows the feedback deadline during grace period
86 if ($state->getPeerReviewDeadline()) {
87 $tpl->setCurrentBlock("prop");
88 $tpl->setVariable("PROP", $lng->txt("exc_peer_review_deadline"));
89 $tpl->setVariable("PROP_VAL", $state->getPeerReviewDeadlinePresentation());
90 $tpl->parseCurrentBlock();
91 }
92 } elseif (!$state->hasGenerallyStarted()) {
93 if ($state->getRelativeDeadline()) {
94 $tpl->setCurrentBlock("prop");
95 $tpl->setVariable("PROP", $lng->txt("exc_earliest_start_time"));
96 $tpl->setVariable("PROP_VAL", $state->getGeneralStartPresentation());
97 $tpl->parseCurrentBlock();
98 } else {
99 $tpl->setCurrentBlock("prop");
100 $tpl->setVariable("PROP", $lng->txt("exc_starting_on"));
101 $tpl->setVariable("PROP_VAL", $state->getGeneralStartPresentation());
102 $tpl->parseCurrentBlock();
103 }
104 } else {
105 if ($state->getCommonDeadline() > 0) {
106 $tpl->setCurrentBlock("prop");
107 $tpl->setVariable("PROP", $lng->txt("exc_time_to_send"));
108 $tpl->setVariable("PROP_VAL", $state->getRemainingTimePresentation());
109 $tpl->parseCurrentBlock();
110
111 $tpl->setCurrentBlock("prop");
112 $tpl->setVariable("PROP", $lng->txt("exc_edit_until"));
113 $tpl->setVariable("PROP_VAL", $state->getCommonDeadlinePresentation());
114 $tpl->parseCurrentBlock();
115 } elseif ($state->getRelativeDeadline()) { // if we only have a relative deadline (not started yet)
116 $tpl->setCurrentBlock("prop");
117 $tpl->setVariable("PROP", $lng->txt("exc_rem_time_after_start"));
118 $tpl->setVariable("PROP_VAL", $state->getRelativeDeadlinePresentation());
119 $tpl->parseCurrentBlock();
120
121 if ($state->getLastSubmissionOfRelativeDeadline()) { // if we only have a relative deadline (not started yet)
122 $tpl->setCurrentBlock("prop");
123 $tpl->setVariable("PROP", $lng->txt("exc_rel_last_submission"));
124 $tpl->setVariable("PROP_VAL", $state->getLastSubmissionOfRelativeDeadlinePresentation());
125 $tpl->parseCurrentBlock();
126 }
127 }
128
129
130 if ($state->getIndividualDeadline() > 0) {
131 $tpl->setCurrentBlock("prop");
132 $tpl->setVariable("PROP", $lng->txt("exc_individual_deadline"));
133 $tpl->setVariable("PROP_VAL", $state->getIndividualDeadlinePresentation());
134 $tpl->parseCurrentBlock();
135 }
136 }
137
138 $mand = "";
139 if ($this->mandatory_manager->isMandatoryForUser($a_ass->getId(), $this->user->getId())) {
140 $mand = " (" . $lng->txt("exc_mandatory") . ")";
141 }
142 $tpl->setVariable("TITLE", $a_ass->getTitle() . $mand);
143
144 // status icon
145 $tpl->setVariable(
146 "ICON_STATUS",
147 $this->getIconForStatus(
148 $a_ass->getMemberStatus()->getStatus(),
150 )
151 );
152
153 return $tpl->get();
154 }
getPersonalDeadline($a_user_id)
Get individual deadline (max of common or idl (team) deadline = Official Deadline)
getDeadline()
Get deadline (timestamp)

References $ilUser, $lng, $tpl, $user, ilExAssignment\getDeadline(), getIconForStatus(), ilExAssignment\getId(), ilExcAssMemberState\getInstanceByIds(), ilExAssignment\getMemberStatus(), ilExAssignment\getPersonalDeadline(), ilExAssignment\getTitle(), and ilLPStatusIcons\ICON_VARIANT_SHORT.

+ Here is the call graph for this function:

◆ getSubmissionLink()

ilExAssignmentGUI::getSubmissionLink (   $a_cmd,
array  $a_params = null 
)
protected

Definition at line 475 of file class.ilExAssignmentGUI.php.

476 {
477 $ilCtrl = $this->ctrl;
478
479 if (is_array($a_params)) {
480 foreach ($a_params as $name => $value) {
481 $ilCtrl->setParameterByClass("ilexsubmissiongui", $name, $value);
482 }
483 }
484
485 $ilCtrl->setParameterByClass("ilexsubmissiongui", "ass_id", $this->current_ass_id);
486 $url = $ilCtrl->getLinkTargetByClass("ilexsubmissiongui", $a_cmd);
487 $ilCtrl->setParameterByClass("ilexsubmissiongui", "ass_id", "");
488
489 if (is_array($a_params)) {
490 foreach ($a_params as $name => $value) {
491 $ilCtrl->setParameterByClass("ilexsubmissiongui", $name, "");
492 }
493 }
494
495 return $url;
496 }
if($format !==null) $name
Definition: metadata.php:230
$url

References $ctrl, $name, and $url.

Referenced by addPublicSubmissions().

+ Here is the caller graph for this function:

◆ getTimeString()

ilExAssignmentGUI::getTimeString (   $a_deadline)

Get time string for deadline.

Definition at line 458 of file class.ilExAssignmentGUI.php.

459 {
461
462 if ($a_deadline == 0) {
463 return $lng->txt("exc_submit_convenience_no_deadline");
464 }
465
466 if ($a_deadline - time() <= 0) {
467 $time_str = $lng->txt("exc_time_over_short");
468 } else {
469 $time_str = ilUtil::period2String(new ilDateTime($a_deadline, IL_CAL_UNIX));
470 }
471
472 return $time_str;
473 }
const IL_CAL_UNIX
static period2String(ilDateTime $a_from, $a_to=null)
Return a string of time period.

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

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilExAssignmentGUI::$ctrl
protected

◆ $current_ass_id

ilExAssignmentGUI::$current_ass_id
protected

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

◆ $exc

ilExAssignmentGUI::$exc
protected

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

◆ $lng

◆ $mandatory_manager

ilExAssignmentGUI::$mandatory_manager
protected

Definition at line 38 of file class.ilExAssignmentGUI.php.

◆ $service

ilExAssignmentGUI::$service
protected

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

Referenced by __construct().

◆ $user

ilExAssignmentGUI::$user
protected

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