ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilExerciseSubmissionTableGUI.php
Go to the documentation of this file.
1 <?php
2 
21 
29 {
30  public const MODE_BY_ASSIGNMENT = 1;
31  public const MODE_BY_USER = 2;
32  protected \ILIAS\Exercise\Assignment\DomainService $ass_domain;
33 
35  protected ilObjExercise $exc;
36  protected int $mode;
37  protected array $filter;
38  protected array $comment_modals = array();
39  protected ?ilExAssignment $ass = null;
40 
41  protected array $cols_mandatory = array("name", "status");
42  protected array $cols_default = array("login", "submission", "idl", "calc_deadline");
43  protected array $cols_order = array("image", "name", "login", "team_members",
44  "sent_time", "submission", "calc_deadline", "idl", "status", "mark", "status_time",
45  "feedback_time", "comment", "notice");
46 
49 
50  protected Factory $ui_factory;
52 
53  public function __construct(
54  object $a_parent_obj,
55  string $a_parent_cmd,
56  ilObjExercise $a_exc,
57  int $a_item_id
58  ) {
59  global $DIC;
60 
61  $this->ui_factory = $DIC->ui()->factory();
62  $this->ui_renderer = $DIC->ui()->renderer();
63 
64  $this->ctrl = $DIC->ctrl();
65  $this->access = $DIC->access();
66  $this->tpl = $DIC["tpl"];
67  $this->lng = $DIC->language();
68 
69  $ilCtrl = $DIC->ctrl();
70 
71  $this->exc = $a_exc;
72 
73  $this->initMode($a_item_id);
74 
75  parent::__construct($a_parent_obj, $a_parent_cmd);
76 
77  $this->setShowTemplates(true);
78 
79  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
80  $this->setRowTemplate("tpl.exc_members_row.html", "Modules/Exercise");
81 
82  #25100
83  if ($this->mode == self::MODE_BY_ASSIGNMENT) {
84  $this->setDefaultOrderField("name");
85  $this->setDefaultOrderDirection("asc");
86  }
87 
88 
89  // columns
90 
91  $this->addColumn("", "", "1", true);
92 
93  $selected = $this->getSelectedColumns();
94  $columns = $this->parseColumns();
95  foreach ($this->cols_order as $id) {
96  if (in_array($id, $this->cols_mandatory) ||
97  in_array($id, $selected)) {
98  if (array_key_exists($id, $columns)) {
99  $col = $columns[$id];
100  $this->addColumn($col[0], $col[1] ?? "");
101  }
102  }
103  }
104 
105  $this->addColumn($this->lng->txt("actions"));
106 
107 
108  // multi actions
109 
110  $this->addMultiCommand("saveStatusSelected", $this->lng->txt("exc_save_selected"));
111 
112  // TODO get rid of the constant from ilExAssignment. Get this value from ilExAssignmentTypes
113  if ($this->mode == self::MODE_BY_ASSIGNMENT && $this->ass->getType() == ilExAssignment::TYPE_TEXT) {
114  $this->addMultiCommand("compareTextAssignments", $this->lng->txt("exc_compare_submissions"));
115  }
116 
117  $this->setFormName("ilExcIDlForm");
118 
119  // see 0021530 and parseRow here with similar action per user
120  if ($this->mode == self::MODE_BY_ASSIGNMENT &&
121  $this->ass->hasActiveIDl() &&
122  !$this->ass->hasReadOnlyIDl()) {
123  $this->addMultiCommand("setIndividualDeadline", $this->lng->txt("exc_individual_deadline_action"));
124  }
125 
126  if ($this->exc->hasTutorFeedbackMail() &&
127  $this->mode == self::MODE_BY_ASSIGNMENT) {
128  $this->addMultiCommand("redirectFeedbackMail", $this->lng->txt("exc_tbl_action_feedback_mail"));
129  }
130 
131  $this->addMultiCommand("sendMembers", $this->lng->txt("exc_send_assignment"));
132 
133  if ($this->mode == self::MODE_BY_ASSIGNMENT) {
134  $this->addMultiCommand("sendGradingNotification", $this->lng->txt("exc_send_grading_notification"));
135  }
136 
137  if ($this->mode == self::MODE_BY_ASSIGNMENT &&
138  $this->ass &&
139  $this->ass->hasTeam()) {
140  $this->addMultiCommand("createTeams", $this->lng->txt("exc_team_multi_create"));
141  $this->addMultiCommand("dissolveTeams", $this->lng->txt("exc_team_multi_dissolve"));
142  }
143 
144  if ($this->mode == self::MODE_BY_ASSIGNMENT) {
145  $this->addMultiCommand("confirmDeassignMembers", $this->lng->txt("exc_deassign_members"));
146  }
147 
148  $this->setFilterCommand($this->getParentCmd() . "Apply");
149  $this->setResetCommand($this->getParentCmd() . "Reset");
150 
151  $this->initFilter();
152  $this->setData($this->parseData());
153  $this->ass_domain = $DIC->exercise()->internal()->domain()->assignment();
154  }
155 
156  public function initFilter(): void
157  {
158  if ($this->mode == self::MODE_BY_ASSIGNMENT) {
159  $item = $this->addFilterItemByMetaType("flt_name", self::FILTER_TEXT, false, $this->lng->txt("name") . " / " . $this->lng->txt("login"));
160  $this->filter["name"] = $item->getValue();
161  }
162 
163  $this->lng->loadLanguageModule("search");
164  $options = array(
165  "" => $this->lng->txt("search_any"),
166  "notgraded" => $this->lng->txt("exc_notgraded"),
167  "passed" => $this->lng->txt("exc_passed"),
168  "failed" => $this->lng->txt("exc_failed")
169  );
170  $item = $this->addFilterItemByMetaType("flt_status", self::FILTER_SELECT, false, $this->lng->txt("exc_tbl_status"));
171  $item->setOptions($options);
172  $this->filter["status"] = $item->getValue();
173 
174  $options = array(
175  "" => $this->lng->txt("search_any"),
176  "y" => $this->lng->txt("exc_tbl_filter_has_submission"),
177  "n" => $this->lng->txt("exc_tbl_filter_has_no_submission")
178  );
179  $item = $this->addFilterItemByMetaType("flt_subm", self::FILTER_SELECT, false, $this->lng->txt("exc_tbl_filter_submission"));
180  $item->setOptions($options);
181  $this->filter["subm"] = $item->getValue();
182 
183  $item = $this->addFilterItemByMetaType("flt_subm_after", self::FILTER_DATE, false, $this->lng->txt("exc_tbl_filter_submission_after"));
184  $this->filter["subm_after"] = $item->getDate();
185 
186  $item = $this->addFilterItemByMetaType("flt_subm_before", self::FILTER_DATE, false, $this->lng->txt("exc_tbl_filter_submission_before"));
187  $this->filter["subm_before"] = $item->getDate();
188 
189  if ($this->mode == self::MODE_BY_ASSIGNMENT && !$this->ass->hasTeam()) {
190  $this->initCourseGroupFilter();
191  }
192  }
193 
194  protected function initCourseGroupFilter(): void
195  {
196  $repo = new ilRepositorySelector2InputGUI(
197  $this->lng->txt('exc_member_of_crs_grp'),
198  'effective_from',
199  false,
200  ($this->isForwardingToFormDispatcher()) ? $this : null
201  );
202  $repo->getExplorerGUI()->setSelectableTypes(["crs", "grp"]);
203  $repo->getExplorerGUI()->setTypeWhiteList(["root", "cat", "crs", "grp"]);
204  $this->addFilterItem($repo);
205  $repo->readFromSession();
206  $this->filter['member_of'] = (int) $repo->getValue();
207  }
208 
209  protected function isForwardingToFormDispatcher(): bool
210  {
211  return false;
212  }
213 
214 
215 
216  abstract protected function initMode(int $a_item_id): void;
217 
218  abstract protected function parseData(): array;
219 
220  abstract protected function parseModeColumns(): array;
221 
222  public function getSelectableColumns(): array
223  {
224  $cols = array();
225 
226  $columns = $this->parseColumns();
227  foreach ($this->cols_order as $id) {
228  if (in_array($id, $this->cols_mandatory)) {
229  continue;
230  }
231 
232  if (array_key_exists($id, $columns)) {
233  $col = $columns[$id];
234 
235  $cols[$id] = array(
236  "txt" => $col[0],
237  "default" => in_array($id, $this->cols_default)
238  );
239  }
240  }
241  return $cols;
242  }
243 
244  protected function parseColumns(): array
245  {
246  $cols = $this->parseModeColumns();
247 
248  $cols["submission"] = array($this->lng->txt("exc_tbl_submission_date"), "submission");
249 
250  $cols["status"] = array($this->lng->txt("exc_tbl_status"), "status");
251  $cols["mark"] = array($this->lng->txt("exc_tbl_mark"), "mark");
252  $cols["status_time"] = array($this->lng->txt("exc_tbl_status_time"), "status_time");
253 
254  $cols["sent_time"] = array($this->lng->txt("exc_tbl_sent_time"), "sent_time");
255 
256  if ($this->exc->hasTutorFeedbackText() ||
257  $this->exc->hasTutorFeedbackMail() ||
258  $this->exc->hasTutorFeedbackFile()) {
259  $cols["feedback_time"] = array($this->lng->txt("exc_tbl_feedback_time"), "feedback_time");
260  }
261 
262  if ($this->exc->hasTutorFeedbackText()) {
263  $cols["comment"] = array($this->lng->txt("exc_tbl_comment"), "comment");
264  }
265 
266  $cols["notice"] = array($this->lng->txt("exc_tbl_notice"), "notice");
267 
268  return $cols;
269  }
270 
276  protected function parseRow(
277  int $a_user_id,
278  ilExAssignment $a_ass,
279  array $a_row
280  ): void {
281  $ilCtrl = $this->ctrl;
282  $ilAccess = $this->access;
283 
284  $has_no_team_yet = ($a_ass->hasTeam() &&
285  !ilExAssignmentTeam::getTeamId($a_ass->getId(), $a_user_id));
286 
287 
288  // static columns
289 
290  if ($this->mode == self::MODE_BY_ASSIGNMENT) {
291  if (!$a_ass->hasTeam()) {
292  $this->tpl->setVariable("VAL_NAME", $a_row["name"]);
293 
294  // #18327
295  if (!$ilAccess->checkAccessOfUser($a_user_id, "read", "", $this->exc->getRefId()) &&
296  is_array($info = $ilAccess->getInfo())) {
297  $this->tpl->setCurrentBlock('access_warning');
298  $this->tpl->setVariable('PARENT_ACCESS', $info[0]["text"]);
299  $this->tpl->parseCurrentBlock();
300  }
301  } else {
302  asort($a_row["team"]);
303  foreach ($a_row["team"] as $team_member_id => $team_member_name) { // #10749
304  if (count($a_row["team"]) > 1) {
305  $ilCtrl->setParameterByClass("ilExSubmissionTeamGUI", "id", $team_member_id);
306  $url = $ilCtrl->getLinkTargetByClass("ilExSubmissionTeamGUI", "confirmRemoveTeamMember");
307  $ilCtrl->setParameterByClass("ilExSubmissionTeamGUI", "id", "");
308 
309  $this->tpl->setCurrentBlock("team_member_removal_bl");
310  $this->tpl->setVariable("URL_TEAM_MEMBER_REMOVAL", $url);
311 
312  $rem_gl = $this->ui_factory->symbol()->glyph()->remove($url);
313  $this->tpl->setVariable(
314  "TXT_TEAM_MEMBER_REMOVAL",
315  $this->ui_renderer->render($rem_gl)
316  );
317 
318  $this->tpl->parseCurrentBlock();
319  }
320 
321  // #18327
322  if (!$ilAccess->checkAccessOfUser($team_member_id, "read", "", $this->exc->getRefId()) &&
323  is_array($info = $ilAccess->getInfo())) {
324  $this->tpl->setCurrentBlock('team_access_warning');
325  $this->tpl->setVariable('TEAM_PARENT_ACCESS', $info[0]["text"]);
326  $this->tpl->parseCurrentBlock();
327  }
328 
329  $this->tpl->setCurrentBlock("team_member");
330  $this->tpl->setVariable("TXT_MEMBER_NAME", $team_member_name);
331  $this->tpl->parseCurrentBlock();
332  }
333 
334  $this->tpl->setCurrentBlock("team_info");
335  if ($has_no_team_yet) {
336  // #11957
337  $this->tpl->setVariable("TXT_TEAM_INFO", $this->lng->txt("exc_no_team_yet"));
338  } else {
339  $this->tpl->setVariable("TXT_TEAM_INFO", "(" . $a_row["submission_obj"]->getTeam()->getId() . ")");
340  }
341  }
342  } else {
343  $this->tpl->setVariable("VAL_NAME", $a_row["name"]);
344  }
345 
346  // do not grade or mark if no team yet
347  if (!$has_no_team_yet) {
348  // status
349  $this->tpl->setVariable("SEL_" . strtoupper($a_row["status"] ?? ""), ' selected="selected" ');
350  $this->tpl->setVariable("TXT_NOTGRADED", $this->lng->txt("exc_notgraded"));
351  $this->tpl->setVariable("TXT_PASSED", $this->lng->txt("exc_passed"));
352  $this->tpl->setVariable("TXT_FAILED", $this->lng->txt("exc_failed"));
353  } else {
354  $nt_colspan = in_array("mark", $this->getSelectedColumns())
355  ? 2
356  : 1;
357 
358  $this->tpl->setVariable("NO_TEAM_COLSPAN", $nt_colspan);
359  }
360 
361 
362  // comment modal
363  $comment_id = "excasscomm_" . $a_ass->getId() . "_" . $a_user_id;
364  if ($this->exc->hasTutorFeedbackText()) {
365  $modal = ilModalGUI::getInstance();
366  $modal->setId($comment_id);
367  $modal->setHeading($this->lng->txt("exc_tbl_action_feedback_text"));
368 
369  $lcomment_form = new ilPropertyFormGUI();
370  $lcomment_form->setId($comment_id);
371  $lcomment_form->setPreventDoubleSubmission(false);
372 
373  $lcomment = new ilTextAreaInputGUI($this->lng->txt("exc_comment_for_learner"), "lcomment_" . $a_ass->getId() . "_" . $a_user_id);
374  $lcomment->setInfo($this->lng->txt("exc_comment_for_learner_info"));
375  $lcomment->setValue((string) ($a_row["comment"] ?? ""));
376  $lcomment->setRows(10);
377  $lcomment_form->addItem($lcomment);
378 
379  $lcomment_form->addCommandButton("save", $this->lng->txt("save"));
380  // $lcomment_form->addCommandButton("cancel", $lng->txt("cancel"));
381 
382  $modal->setBody($lcomment_form->getHTML());
383 
384  $this->comment_modals[] = $modal->getHTML();
385  unset($modal);
386  }
387 
388 
389  // selectable columns
390 
391  foreach ($this->getSelectedColumns() as $col) {
392  $include_seconds = false;
393  switch ($col) {
394  case "image":
395  if (!$a_ass->hasTeam()) {
397  if ($usr_obj = ilObjectFactory::getInstanceByObjId($a_user_id, false)) {
398  $this->tpl->setVariable("VAL_IMAGE", $usr_obj->getPersonalPicturePath("xxsmall"));
399  $this->tpl->setVariable("TXT_IMAGE", $this->lng->txt("personal_picture"));
400  }
401  }
402  break;
403 
404  case "team_members":
405  if ($a_ass->hasTeam()) {
406  if (count($a_row["team"]) === 0) {
407  $this->tpl->setVariable("VAL_TEAM_MEMBER", $this->lng->txt("exc_no_team_yet"));
408  } else {
409  foreach ($a_row["team"] as $name) {
410  $this->tpl->setCurrentBlock("team_member_bl");
411  $this->tpl->setVariable("VAL_TEAM_MEMBER", $name);
412  $this->tpl->parseCurrentBlock();
413  }
414  }
415  } else {
416  $this->tpl->setVariable("VAL_TEAM_MEMBER", "&nbsp;");
417  }
418  break;
419 
420  case "calc_deadline":
421  case "idl":
422 
423  if ($a_ass->getDeadlineMode() === ilExAssignment::DEADLINE_ABSOLUTE_INDIVIDUAL && ($a_row[$col] ?? 0) == 0) {
424  if ($a_row["requested_idl"] ?? false) {
425  $this->tpl->setVariable(
426  "VAL_" . strtoupper($col),
427  $this->lng->txt("exc_deadline_requested")
428  );
429  } else {
430  $this->tpl->setVariable(
431  "VAL_" . strtoupper($col),
432  "&nbsp;"
433  );
434  }
435  } else {
436  $this->tpl->setVariable(
437  "VAL_" . strtoupper($col),
438  isset($a_row[$col])
440  : "&nbsp;"
441  );
442  }
443  break;
444 
445  case "mark":
446  if (!$has_no_team_yet) {
447  $this->tpl->setVariable(
448  "VAL_" . strtoupper($col),
450  trim((string) ($a_row[$col] ?? ""))
451  )
452  );
453  }
454  break;
455 
456  case "notice":
457  // see #22076
458  $this->tpl->setVariable(
459  "VAL_" . strtoupper($col),
460  ilLegacyFormElementsUtil::prepareFormOutput(trim((string) ($a_row[$col] ?? "")))
461  );
462  break;
463 
464  case "comment":
465  // for js-updating
466  $this->tpl->setVariable("LCOMMENT_ID", $comment_id . "_snip");
467 
468  // see #22076
469  $this->tpl->setVariable("VAL_" . strtoupper($col), (trim((string) ($a_row[$col] ?? "")) !== "")
470  ? nl2br(trim((string) $a_row[$col]))
471  : "&nbsp;");
472  break;
473 
474  case "feedback_time":
475  case "status_time":
476  case "sent_time":
477  case "submission":
478  if ($col == "submission" && $a_row["submission_obj"]) {
479  $include_seconds = true;
480  foreach ($a_row["submission_obj"]->getFiles() as $file) {
481  if ($file["late"]) {
482  $this->tpl->setVariable("TXT_LATE", $this->lng->txt("exc_late_submission"));
483  break;
484  }
485  }
486  }
487  $this->tpl->setVariable(
488  "VAL_" . strtoupper($col),
489  ($a_row[$col] ?? false)
491  new ilDateTime($a_row[$col], IL_CAL_DATETIME),
492  false,
493  false,
494  $include_seconds
495  )
496  : "&nbsp;"
497  );
498  break;
499 
500  case "login":
501  if (!$a_ass->hasTeam()) {
502  $this->tpl->setVariable("VAL_" . strtoupper($col), $a_row[$col]
503  ? trim((string) $a_row[$col])
504  : "&nbsp;");
505  }
506  break;
507 
508  default:
509  $this->tpl->setVariable("VAL_" . strtoupper($col), $a_row[$col]
510  ? trim((string) $a_row[$col])
511  : "&nbsp;");
512  break;
513  }
514  }
515 
516 
517  // actions
518 
519  $items = array();
520 
521  $file_info = $a_row["submission_obj"]->getDownloadedFilesInfoForTableGUIS();
522 
523  $counter = $file_info["files"]["count"];
524  if ($counter) {
525  if (isset($file_info["files"]["download_url"])) {
526  $items[] = $this->ui_factory->button()->shy(
527  $file_info["files"]["download_txt"] . " (" . $counter . ")",
528  $file_info["files"]["download_url"]
529  );
530  }
531 
532  if (isset($file_info["files"]["download_new_url"])) {
533  $items[] = $this->ui_factory->button()->shy(
534  $file_info["files"]["download_new_txt"],
535  $file_info["files"]["download_new_url"]
536  );
537  }
538  }
539 
540  $ass_type = $this->ass_type ?: ilExAssignmentTypes::getInstance()->getById($a_ass->getType());
541 
542  if ($ass_type->supportsWebDirAccess() && $a_row['submission_obj']->hasSubmittedPrintVersion()) {
543  $url = $ilCtrl->getLinkTarget($this->getParentObject(), "openSubmissionView");
544  $items[] = $this->ui_factory->link()->standard($this->lng->txt("exc_tbl_action_open_submission"), $url)->withOpenInNewViewport(true);
545  if ($a_row['submission_obj']->hasSubmittedPrintVersion()) {
546  $url = $ilCtrl->getLinkTarget($this->getParentObject(), "openSubmissionPrintView");
547  $items[] = $this->ui_factory->link()->standard($this->lng->txt("exc_print_pdf"), $url)->withOpenInNewViewport(true);
548  }
549  }
550  $ind_deadline_mode = ($a_ass->getDeadlineMode() === ilExAssignment::DEADLINE_ABSOLUTE_INDIVIDUAL);
551  if (!$has_no_team_yet &&
552  $a_ass->hasActiveIDl() &&
553  !$a_ass->hasReadOnlyIDl() &&
554  (!is_null($a_row["calc_deadline"] ?? null) || $a_ass->getDeadline() || $ind_deadline_mode)) { // calculated or common deadline given
555  $idl_id = $a_ass->hasTeam()
556  ? "t" . ilExAssignmentTeam::getTeamId($a_ass->getId(), $a_user_id)
557  : $a_user_id;
558 
559  $this->tpl->setVariable("VAL_IDL_ID", $a_ass->getId() . "_" . $idl_id);
560 
561  $assignment_id = $a_ass->getId();
562  $items[] = $this->ui_factory->button()->shy($this->lng->txt("exc_individual_deadline_action"), "#")
563  ->withOnLoadCode(function ($id) use ($idl_id, $assignment_id) {
564  return "$('#$id').on('click', function() {il.ExcIDl.trigger('$idl_id', '$assignment_id'); return false;})";
565  });
566  }
567 
568  // feedback mail
569  if ($this->exc->hasTutorFeedbackMail()) {
570  $items[] = $this->ui_factory->button()->shy(
571  $this->lng->txt("exc_tbl_action_feedback_mail"),
572  $ilCtrl->getLinkTarget($this->parent_obj, "redirectFeedbackMail")
573  );
574  }
575 
576  // feedback files
577  if ($a_ass->canParticipantReceiveFeedback($a_user_id)) {
578  if ($this->exc->hasTutorFeedbackFile()) {
579  $tutor_feedback_manager = $this->ass_domain->tutorFeedbackFile($a_ass->getId());
580  if ($tutor_feedback_manager->hasCollection($a_user_id)) {
581  // IRSS
582  $counter = $tutor_feedback_manager->count($a_user_id);
583  $counter = $counter
584  ? " (" . $counter . ")"
585  : "";
586  $items[] = $this->ui_factory->button()->shy(
587  $this->lng->txt("exc_tbl_action_feedback_file") . $counter,
588  $ilCtrl->getLinkTargetByClass(ilResourceCollectionGUI::class, "")
589  );
590  } else {
591  // LEGACY
592  $storage = new ilFSStorageExercise($this->exc->getId(), $a_ass->getId());
593  $counter = $storage->countFeedbackFiles($a_row["submission_obj"]->getFeedbackId());
594  $counter = $counter
595  ? " (" . $counter . ")"
596  : "";
597 
598  $items[] = $this->ui_factory->button()->shy(
599  $this->lng->txt("exc_tbl_action_feedback_file") . $counter,
600  $ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles")
601  );
602  }
603  }
604 
605  // comment (modal - see above)
606  if ($this->exc->hasTutorFeedbackText()) {
607  $items[] = $this->ui_factory->button()->shy($this->lng->txt("exc_tbl_action_feedback_text"), "#")
608  ->withOnLoadCode(function ($id) use ($comment_id) {
609  return "$('#$id').on('click', function() {il.ExcManagement.showComment('$comment_id'); return false;})";
610  });
611  }
612  }
613 
614  // peer review
615  if (($peer_review = $a_row["submission_obj"]->getPeerReview()) && $a_ass->afterDeadlineStrict()) { // see #22246
616  $counter = $peer_review->countGivenFeedback(true, $a_user_id);
617  $counter = $counter
618  ? " (" . $counter . ")"
619  : "";
620  $items[] = $this->ui_factory->button()->shy(
621  $this->lng->txt("exc_tbl_action_peer_review_given") . $counter,
622  $ilCtrl->getLinkTargetByClass("ilexpeerreviewgui", "showGivenPeerReview")
623  );
624 
625  $counter = count($peer_review->getPeerReviewsByPeerId($a_user_id, true));
626  $counter = $counter !== 0
627  ? " (" . $counter . ")"
628  : "";
629 
630  $items[] = $this->ui_factory->button()->shy(
631  $this->lng->txt("exc_tbl_action_peer_review_received") . $counter,
632  $ilCtrl->getLinkTargetByClass("ilexpeerreviewgui", "showReceivedPeerReview")
633  );
634  }
635 
636  // team
637  if ($has_no_team_yet) {
638  $items[] = $this->ui_factory->button()->shy(
639  $this->lng->txt("exc_create_team"),
640  $ilCtrl->getLinkTargetByClass("ilExSubmissionTeamGUI", "createSingleMemberTeam")
641  );
642  } elseif ($a_ass->hasTeam()) {
643  $items[] = $this->ui_factory->button()->shy(
644  $this->lng->txt("exc_tbl_action_team_log"),
645  $ilCtrl->getLinkTargetByClass("ilExSubmissionTeamGUI", "showTeamLog")
646  );
647  }
648 
649  $actions = $this->ui_factory->dropdown()->standard($items);
650 
651  $this->tpl->setVariable("ACTIONS", $this->ui_renderer->render($actions));
652  }
653 
654  public function render(): string
655  {
656  global $DIC;
657  $ilCtrl = $this->ctrl;
658  $tpl = $DIC->ui()->mainTemplate();
659 
660  $url = $ilCtrl->getLinkTarget($this->getParentObject(), "saveCommentForLearners", "", true, false);
661 
662  $tpl->addJavaScript("Modules/Exercise/js/ilExcManagement.js");
663  $tpl->addOnLoadCode('il.ExcManagement.init("' . $url . '");');
664 
665  return parent::render() .
666  implode("\n", $this->comment_modals);
667  }
668 }
setData(array $a_data)
An entity that renders components to a string output.
Definition: Renderer.php:30
getType()
Get type this will most probably become an non public function in the future (or become obsolete) ...
Exercise assignment.
const IL_CAL_DATETIME
canParticipantReceiveFeedback(int $part_id)
setFormAction(string $a_form_action, bool $a_multipart=false)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
setResetCommand(string $a_val, string $a_caption="")
afterDeadlineStrict(bool $a_include_personal=true)
setShowTemplates(bool $a_value)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static prepareFormOutput($a_str, bool $a_strip=false)
const IL_CAL_UNIX
setFormName(string $a_name="")
global $DIC
Definition: feed.php:28
countFeedbackFiles(string $a_user_id)
Class ilObjExercise.
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
__construct(VocabulariesInterface $vocabularies)
setDefaultOrderField(string $a_defaultorderfield)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setFilterCommand(string $a_val, string $a_caption="")
setDefaultOrderDirection(string $a_defaultorderdirection)
$url
Definition: ltiregstart.php:35
static getTeamId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
ILIAS Exercise Assignment DomainService $ass_domain
__construct(object $a_parent_obj, string $a_parent_cmd, ilObjExercise $a_exc, int $a_item_id)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstance()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
addMultiCommand(string $a_cmd, string $a_text)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...