ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilExAssignmentGUI Class Reference

GUI class for exercise assignments. More...

+ Collaboration diagram for ilExAssignmentGUI:

Public Member Functions

 __construct (ilObjExercise $a_exc)
 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)
 

Protected Attributes

 $lng
 
 $user
 
 $ctrl
 
 $exc
 
 $current_ass_id
 

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
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilExAssignmentGUI::__construct ( ilObjExercise  $a_exc)

Constructor.

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

35 {
36 global $DIC;
37
38 $this->lng = $DIC->language();
39 $this->user = $DIC->user();
40 $this->ctrl = $DIC->ctrl();
41 $this->ui = $DIC->ui();
42
43 $this->exc = $a_exc;
44 }
user()
Definition: user.php:4
global $DIC
Definition: saml.php:7

References $DIC, 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 299 of file class.ilExAssignmentGUI.php.

300 {
303
304 $files = $a_ass->getFiles();
305
306 if (count($files) > 0) {
307 $a_info->addSection($lng->txt("exc_files"));
308
309 global $DIC;
310
311 //file has -> name,fullpath,size,ctime
312 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
313 include_once("./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
314 include_once "./Services/UIComponent/Modal/classes/class.ilModalGUI.php";
315
316 $cnt = 0;
317 foreach ($files as $file) {
318 $cnt++;
319 // get mime type
320 $mime = ilObjMediaObject::getMimeType($file['fullpath']);
321
322 list($format, $type) = explode("/", $mime);
323
324 $ui_factory = $DIC->ui()->factory();
325 $ui_renderer = $DIC->ui()->renderer();
326
327 if (in_array($mime, array("image/jpeg", "image/svg+xml", "image/gif", "image/png"))) {
328 $item_id = "il-ex-modal-img-" . $a_ass->getId() . "-" . $cnt;
329
330
331 $image = $ui_renderer->render($ui_factory->image()->responsive($file['fullpath'], $file['name']));
332 $image_lens = ilUtil::getImagePath("enlarge.svg");
333
334 $modal = ilModalGUI::getInstance();
335 $modal->setId($item_id);
336 $modal->setType(ilModalGUI::TYPE_LARGE);
337 $modal->setBody($image);
338 $modal->setHeading($file["name"]);
339 $modal = $modal->getHTML();
340
341 $img_tpl = new ilTemplate("tpl.image_file.html", true, true, "Modules/Exercise");
342 $img_tpl->setCurrentBlock("image_content");
343 $img_tpl->setVariable("MODAL", $modal);
344 $img_tpl->setVariable("ITEM_ID", $item_id);
345 $img_tpl->setVariable("IMAGE", $image);
346 $img_tpl->setvariable("IMAGE_LENS", $image_lens);
347 $img_tpl->parseCurrentBlock();
348
349 $a_info->addProperty($file["name"], $img_tpl->get());
350 } elseif (in_array($mime, array("audio/mpeg", "audio/ogg", "video/mp4", "video/x-flv", "video/webm"))) {
351 $media_tpl = new ilTemplate("tpl.media_file.html", true, true, "Modules/Exercise");
352 $mp = new ilMediaPlayerGUI();
353 $mp->setFile($file['fullpath']);
354 $media_tpl->setVariable("MEDIA", $mp->getMediaPlayerHtml());
355
356 $but = $ui_factory->button()->shy(
357 $lng->txt("download"),
358 $this->getSubmissionLink("downloadFile", array("file" => urlencode($file["name"])))
359 );
360 $media_tpl->setVariable("DOWNLOAD_BUTTON", $ui_renderer->render($but));
361 $a_info->addProperty($file["name"], $media_tpl->get());
362 } else {
363 $a_info->addProperty($file["name"], $lng->txt("download"), $this->getSubmissionLink("downloadFile", array("file" => urlencode($file["name"]))));
364 }
365 }
366 }
367 }
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)
global $ilCtrl
Definition: ilias.php:18
$format
Definition: metadata.php:141
$files
Definition: metarefresh.php:49
$type

References $ctrl, $DIC, $files, $format, $ilCtrl, $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 175 of file class.ilExAssignmentGUI.php.

176 {
179
180 include_once("./Modules/Exercise/classes/class.ilExcAssMemberState.php");
182
183 if ($state->areInstructionsVisible()) {
184 $inst = $a_ass->getInstruction();
185 if (trim($inst)) {
186 $a_info->addSection($lng->txt("exc_instruction"));
187
188 $is_html = (strlen($inst) != strlen(strip_tags($inst)));
189 if (!$is_html) {
190 $inst = nl2br(ilUtil::makeClickable($inst, true));
191 }
192 $a_info->addProperty("", $inst);
193 }
194 }
195 }
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
getInstruction()
Get instruction.
static getInstanceByIds($a_ass_id, $a_user_id=0)
Get instance by IDs (recommended for consumer code)
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
$ilUser
Definition: imgupload.php:18

References $ilUser, $lng, $state, $user, ilInfoScreenGUI\addProperty(), ilInfoScreenGUI\addSection(), ilExAssignment\getId(), ilExcAssMemberState\getInstanceByIds(), ilExAssignment\getInstruction(), and ilUtil\makeClickable().

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 275 of file class.ilExAssignmentGUI.php.

276 {
279
280
281 include_once("./Modules/Exercise/classes/class.ilExcAssMemberState.php");
283
284 // submissions are visible, even if other users may still have a larger individual deadline
285 if ($state->hasSubmissionEnded()) {
286 $button = ilLinkButton::getInstance();
287 $button->setCaption("exc_list_submission");
288 $button->setUrl($this->getSubmissionLink("listPublicSubmissions"));
289
290 $a_info->addProperty($lng->txt("exc_public_submission"), $button->render());
291 } else {
292 $a_info->addProperty(
293 $lng->txt("exc_public_submission"),
294 $lng->txt("exc_msg_public_submission")
295 );
296 }
297 }
getSubmissionLink($a_cmd, array $a_params=null)
static getInstance()
Factory.

References $ilUser, $lng, $state, $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 197 of file class.ilExAssignmentGUI.php.

198 {
202
203 $idl = $a_ass->getPersonalDeadline($ilUser->getId());
204
205 include_once("./Modules/Exercise/classes/class.ilExcAssMemberState.php");
207
208 $a_info->addSection($lng->txt("exc_schedule"));
209 if ($state->getGeneralStart() > 0) {
210 if ($state->getRelativeDeadline()) {
211 $a_info->addProperty($lng->txt("exc_earliest_start_time"), $state->getGeneralStartPresentation());
212 } else {
213 $a_info->addProperty($lng->txt("exc_start_time"), $state->getGeneralStartPresentation());
214 }
215 }
216
217 // extended deadline info/warning
218 $late_dl = "";
219 //if ($idl &&
220 // $idl < time() &&
221 // $a_ass->beforeDeadline()) // ext dl is last deadline
222 if ($state->inLateSubmissionPhase()) {
223 // extended deadline date should not be presented anywhere
224 $late_dl = $state->getOfficialDeadlinePresentation();
225 $late_dl = "<br />" . sprintf($lng->txt("exc_late_submission_warning"), $late_dl);
226 $late_dl = '<span class="warning">' . $late_dl . '</span>';
227 }
228
229 if ($state->getCommonDeadline()) { // if we have a common deadline (target timestamp)
230 $until = $state->getCommonDeadlinePresentation();
231
232 // add late info if no idl
233 if ($late_dl &&
234 $state->getOfficialDeadline() == $state->getCommonDeadline()) {
235 $until .= $late_dl;
236 }
237
238 $prop = $lng->txt("exc_edit_until");
239 if ($state->exceededOfficialDeadline()) {
240 $prop = $lng->txt("exc_ended_on");
241 }
242
243 $a_info->addProperty($prop, $until);
244 } elseif ($state->getRelativeDeadline()) { // if we only have a relative deadline (not started yet)
245 $but = "";
246 if ($state->hasGenerallyStarted()) {
247 $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_ass->getId());
248 $but = $this->ui->factory()->button()->primary($lng->txt("exc_start_assignment"), $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "startAssignment"));
249 $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $_GET["ass_id"]);
250 $but = $this->ui->renderer()->render($but);
251 }
252 $a_info->addProperty($lng->txt("exc_rem_time_after_start"), $state->getRelativeDeadlinePresentation() .
253 " " . $but);
254 }
255
256 if ($state->getOfficialDeadline() > $state->getCommonDeadline()) {
257 $until = $state->getOfficialDeadlinePresentation();
258
259 // add late info?
260 if ($late_dl) {
261 $until .= $late_dl;
262 }
263
264 $a_info->addProperty($lng->txt("exc_individual_deadline"), $until);
265 }
266
267 if ($state->hasSubmissionStarted()) {
268 $a_info->addProperty(
269 $lng->txt("exc_time_to_send"),
270 "<b>" . $state->getRemainingTimePresentation() . "</b>"
271 );
272 }
273 }
$_GET["client_id"]
getPersonalDeadline($a_user_id)
Get individual deadline (max of common or idl (team) deadline = Official Deadline)

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

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 369 of file class.ilExAssignmentGUI.php.

370 {
374
375 include_once("./Modules/Exercise/classes/class.ilExcAssMemberState.php");
377
378 $a_info->addSection($lng->txt("exc_your_submission"));
379
380 include_once "Modules/Exercise/classes/class.ilExSubmission.php";
381 $submission = new ilExSubmission($a_ass, $ilUser->getId());
382
383 include_once "Modules/Exercise/classes/class.ilExSubmissionGUI.php";
384 ilExSubmissionGUI::getOverviewContent($a_info, $submission, $this->exc);
385
386 $last_sub = null;
387 if ($submission->hasSubmitted()) {
388 $last_sub = $submission->getLastSubmission();
389 if ($last_sub) {
390 $last_sub = ilDatePresentation::formatDate(new ilDateTime($last_sub, IL_CAL_DATETIME));
391 $a_info->addProperty($lng->txt("exc_last_submission"), $last_sub);
392 }
393 }
394
395 if ($this->exc->getShowSubmissions()) {
396 $this->addPublicSubmissions($a_info, $a_ass);
397 }
398
399 include_once "Modules/Exercise/classes/class.ilExPeerReviewGUI.php";
400 ilExPeerReviewGUI::getOverviewContent($a_info, $submission);
401
402 // global feedback / sample solution
404 $show_global_feedback = ($state->hasSubmissionEndedForAllUsers() && $a_ass->getFeedbackFile());
405 }
406 //If it is not well configured...(e.g. show solution before deadline)
407 //the user can get the solution before he summit it.
408 //we can check in the elseif $submission->hasSubmitted()
410 $show_global_feedback = ($a_ass->afterCustomDate() && $a_ass->getFeedbackFile());
411 } else {
412 $show_global_feedback = ($last_sub && $a_ass->getFeedbackFile());
413 }
414
415 $this->addSubmissionFeedback($a_info, $a_ass, $submission->getFeedbackId(), $show_global_feedback);
416 }
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, $ilCtrl, $ilUser, $lng, $state, $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 418 of file class.ilExAssignmentGUI.php.

419 {
421
422 include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
423
424 $storage = new ilFSStorageExercise($a_ass->getExerciseId(), $a_ass->getId());
425 $cnt_files = $storage->countFeedbackFiles($a_feedback_id);
426
427 $lpcomment = $a_ass->getMemberStatus()->getComment();
428 $mark = $a_ass->getMemberStatus()->getMark();
429 $status = $a_ass->getMemberStatus()->getStatus();
430
431 if ($lpcomment != "" ||
432 $mark != "" ||
433 $status != "notgraded" ||
434 $cnt_files > 0 ||
435 $a_show_global_feedback) {
436 $a_info->addSection($lng->txt("exc_feedback_from_tutor"));
437 if ($lpcomment != "") {
438 $a_info->addProperty(
439 $lng->txt("exc_comment"),
440 nl2br($lpcomment)
441 );
442 }
443 if ($mark != "") {
444 $a_info->addProperty(
445 $lng->txt("exc_mark"),
446 $mark
447 );
448 }
449
450 if ($status == "") {
451 // $a_info->addProperty($lng->txt("status"),
452// $lng->txt("message_no_delivered_files"));
453 } elseif ($status != "notgraded") {
454 $img = '<img src="' . ilUtil::getImagePath("scorm/" . $status . ".svg") . '" ' .
455 ' alt="' . $lng->txt("exc_" . $status) . '" title="' . $lng->txt("exc_" . $status) .
456 '" />';
457 $a_info->addProperty(
458 $lng->txt("status"),
459 $img . " " . $lng->txt("exc_" . $status)
460 );
461 }
462
463 if ($cnt_files > 0) {
464 $a_info->addSection($lng->txt("exc_fb_files") .
465 '<a name="fb' . $a_ass->getId() . '"></a>');
466
467 if ($cnt_files > 0) {
468 $files = $storage->getFeedbackFiles($a_feedback_id);
469 foreach ($files as $file) {
470 $a_info->addProperty(
471 $file,
472 $lng->txt("download"),
473 $this->getSubmissionLink("downloadFeedbackFile", array("file" => urlencode($file)))
474 );
475 }
476 }
477 }
478
479 // #15002 - global feedback
480 if ($a_show_global_feedback) {
481 $a_info->addSection($lng->txt("exc_global_feedback_file"));
482
483 $a_info->addProperty(
484 $a_ass->getFeedbackFile(),
485 $lng->txt("download"),
486 $this->getSubmissionLink("downloadGlobalFeedbackFile")
487 );
488 }
489 }
490 }
getExerciseId()
Get exercise id.
getMemberStatus($a_user_id=null)

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

Referenced by addSubmission().

+ 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 139 of file class.ilExAssignmentGUI.php.

140 {
141 global $DIC;
142
143 $ilUser = $DIC->user();
144
145 $this->current_ass_id = $a_ass->getId();
146
147 $tpl = new ilTemplate("tpl.assignment_body.html", true, true, "Modules/Exercise");
148
149 include_once("./Modules/Exercise/classes/class.ilExcAssMemberState.php");
151
152 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
153 include_once("./Services/UIComponent/Button/classes/class.ilLinkButton.php");
154
155 $info = new ilInfoScreenGUI(null);
156 $info->setTableClass("");
157
158 if ($state->areInstructionsVisible()) {
159 $this->addInstructions($info, $a_ass);
160 $this->addFiles($info, $a_ass);
161 }
162
163 $this->addSchedule($info, $a_ass);
164
165 if ($state->hasSubmissionStarted()) {
166 $this->addSubmission($info, $a_ass);
167 }
168
169 $tpl->setVariable("CONTENT", $info->getHTML());
170
171 return $tpl->get();
172 }
$tpl
Definition: ilias.php:10
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.
$info
Definition: index.php:5

References $DIC, $ilUser, $info, $state, $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 49 of file class.ilExAssignmentGUI.php.

50 {
53
54 $lng->loadLanguageModule("exc");
55
56 include_once("./Modules/Exercise/classes/class.ilExcAssMemberState.php");
58
59 $tpl = new ilTemplate("tpl.assignment_head.html", true, true, "Modules/Exercise");
60
61 // we are completely ignoring the extended deadline here
62
63 $idl = $a_ass->getPersonalDeadline($ilUser->getId());
64
65 // :TODO: meaning of "ended on"
66 $dl = max($a_ass->getDeadline(), $idl);
67 // if ($dl &&
68 // $dl < time())
69 if ($state->exceededOfficialDeadline()) {
70 $tpl->setCurrentBlock("prop");
71 $tpl->setVariable("PROP", $lng->txt("exc_ended_on"));
72 $tpl->setVariable("PROP_VAL", $state->getCommonDeadlinePresentation());
73 $tpl->parseCurrentBlock();
74
75 // #14077 // this currently shows the feedback deadline during grace period
76 if ($state->getPeerReviewDeadline()) {
77 $tpl->setCurrentBlock("prop");
78 $tpl->setVariable("PROP", $lng->txt("exc_peer_review_deadline"));
79 $tpl->setVariable("PROP_VAL", $state->getPeerReviewDeadlinePresentation());
80 $tpl->parseCurrentBlock();
81 }
82 } elseif (!$state->hasGenerallyStarted()) {
83 if ($state->getRelativeDeadline()) {
84 $tpl->setCurrentBlock("prop");
85 $tpl->setVariable("PROP", $lng->txt("exc_earliest_start_time"));
86 $tpl->setVariable("PROP_VAL", $state->getGeneralStartPresentation());
87 $tpl->parseCurrentBlock();
88 } else {
89 $tpl->setCurrentBlock("prop");
90 $tpl->setVariable("PROP", $lng->txt("exc_starting_on"));
91 $tpl->setVariable("PROP_VAL", $state->getGeneralStartPresentation());
92 $tpl->parseCurrentBlock();
93 }
94 } else {
95 if ($state->getCommonDeadline() > 0) {
96 $tpl->setCurrentBlock("prop");
97 $tpl->setVariable("PROP", $lng->txt("exc_time_to_send"));
98 $tpl->setVariable("PROP_VAL", $state->getRemainingTimePresentation());
99 $tpl->parseCurrentBlock();
100
101 $tpl->setCurrentBlock("prop");
102 $tpl->setVariable("PROP", $lng->txt("exc_edit_until"));
103 $tpl->setVariable("PROP_VAL", $state->getCommonDeadlinePresentation());
104 $tpl->parseCurrentBlock();
105 } elseif ($state->getRelativeDeadline()) { // if we only have a relative deadline (not started yet)
106 $tpl->setCurrentBlock("prop");
107 $tpl->setVariable("PROP", $lng->txt("exc_rem_time_after_start"));
108 $tpl->setVariable("PROP_VAL", $state->getRelativeDeadlinePresentation());
109 $tpl->parseCurrentBlock();
110 }
111
112
113 if ($state->getIndividualDeadline() > 0) {
114 $tpl->setCurrentBlock("prop");
115 $tpl->setVariable("PROP", $lng->txt("exc_individual_deadline"));
116 $tpl->setVariable("PROP_VAL", $state->getIndividualDeadlinePresentation());
117 $tpl->parseCurrentBlock();
118 }
119 }
120
121 $mand = "";
122 if ($a_ass->getMandatory()) {
123 $mand = " (" . $lng->txt("exc_mandatory") . ")";
124 }
125 $tpl->setVariable("TITLE", $a_ass->getTitle() . $mand);
126
127 // status icon
128 $stat = $a_ass->getMemberStatus()->getStatus();
129 $pic = $a_ass->getMemberStatus()->getStatusIcon();
130 $tpl->setVariable("IMG_STATUS", ilUtil::getImagePath($pic));
131 $tpl->setVariable("ALT_STATUS", $lng->txt("exc_" . $stat));
132
133 return $tpl->get();
134 }
getDeadline()
Get deadline (timestamp)
getMandatory()
Get mandatory.

References $ilUser, $lng, $state, $tpl, $user, ilExAssignment\getDeadline(), ilExAssignment\getId(), ilUtil\getImagePath(), ilExcAssMemberState\getInstanceByIds(), ilExAssignment\getMandatory(), ilExAssignment\getMemberStatus(), ilExAssignment\getPersonalDeadline(), and ilExAssignment\getTitle().

+ Here is the call graph for this function:

◆ getSubmissionLink()

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

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

513 {
515
516 if (is_array($a_params)) {
517 foreach ($a_params as $name => $value) {
518 $ilCtrl->setParameterByClass("ilexsubmissiongui", $name, $value);
519 }
520 }
521
522 $ilCtrl->setParameterByClass("ilexsubmissiongui", "ass_id", $this->current_ass_id);
523 $url = $ilCtrl->getLinkTargetByClass("ilexsubmissiongui", $a_cmd);
524 $ilCtrl->setParameterByClass("ilexsubmissiongui", "ass_id", "");
525
526 if (is_array($a_params)) {
527 foreach ($a_params as $name => $value) {
528 $ilCtrl->setParameterByClass("ilexsubmissiongui", $name, "");
529 }
530 }
531
532 return $url;
533 }
$url

References $ctrl, $ilCtrl, $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 495 of file class.ilExAssignmentGUI.php.

496 {
498
499 if ($a_deadline == 0) {
500 return $lng->txt("exc_submit_convenience_no_deadline");
501 }
502
503 if ($a_deadline - time() <= 0) {
504 $time_str = $lng->txt("exc_time_over_short");
505 } else {
506 $time_str = ilUtil::period2String(new ilDateTime($a_deadline, IL_CAL_UNIX));
507 }
508
509 return $time_str;
510 }
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 29 of file class.ilExAssignmentGUI.php.

◆ $exc

ilExAssignmentGUI::$exc
protected

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

◆ $lng

◆ $user

ilExAssignmentGUI::$user
protected

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