26 protected \ILIAS\Exercise\InternalDomainService
$domain;
27 protected \ILIAS\Exercise\Assignment\DomainService
$ass_domain;
38 protected array
$cols_default = array(
"login",
"submission",
"idl",
"calc_deadline");
39 protected array
$cols_order = array(
"image",
"name",
"login",
"team_members",
40 "sent_time",
"submission",
"calc_deadline",
"idl",
"status",
"mark",
"status_time",
41 "feedback_time",
"comment",
"notice");
58 $this->ui_factory =
$DIC->ui()->factory();
59 $this->ui_renderer =
$DIC->ui()->renderer();
61 $this->
ctrl = $DIC->ctrl();
62 $this->
access = $DIC->access();
63 $this->tpl =
$DIC[
"tpl"];
64 $this->
lng = $DIC->language();
66 $ilCtrl =
$DIC->ctrl();
76 $this->
setRowTemplate(
"tpl.exc_members_row.html",
"components/ILIAS/Exercise");
79 if ($this->mode == self::MODE_BY_ASSIGNMENT) {
91 foreach ($this->cols_order as
$id) {
92 if (in_array(
$id, $this->cols_mandatory) ||
93 in_array(
$id, $selected)) {
94 if (array_key_exists(
$id, $columns)) {
110 $this->
addMultiCommand(
"compareTextAssignments", $this->
lng->txt(
"exc_compare_submissions"));
116 if ($this->mode == self::MODE_BY_ASSIGNMENT &&
117 $this->ass->hasActiveIDl() &&
118 !$this->ass->hasReadOnlyIDl()) {
119 $this->
addMultiCommand(
"setIndividualDeadline", $this->
lng->txt(
"exc_individual_deadline_action"));
122 if ($this->exc->hasTutorFeedbackMail() &&
123 $this->mode == self::MODE_BY_ASSIGNMENT) {
124 $this->
addMultiCommand(
"redirectFeedbackMail", $this->
lng->txt(
"exc_tbl_action_feedback_mail"));
129 if ($this->mode == self::MODE_BY_ASSIGNMENT) {
130 $this->
addMultiCommand(
"sendGradingNotification", $this->
lng->txt(
"exc_send_grading_notification"));
133 if ($this->mode == self::MODE_BY_ASSIGNMENT &&
135 $this->ass->hasTeam()) {
140 if ($this->mode == self::MODE_BY_ASSIGNMENT) {
141 $this->
addMultiCommand(
"confirmDeassignMembers", $this->
lng->txt(
"exc_deassign_members"));
149 $this->ass_domain =
$DIC->exercise()->internal()->domain()->assignment();
150 $this->domain =
$DIC->exercise()->internal()->domain();
155 if ($this->mode == self::MODE_BY_ASSIGNMENT) {
156 $item = $this->
addFilterItemByMetaType(
"flt_name", self::FILTER_TEXT,
false, $this->
lng->txt(
"name") .
" / " . $this->lng->txt(
"login"));
157 $this->
filter[
"name"] = $item->getValue();
160 $this->
lng->loadLanguageModule(
"search");
162 "" => $this->
lng->txt(
"search_any"),
163 "notgraded" => $this->lng->txt(
"exc_notgraded"),
164 "passed" => $this->lng->txt(
"exc_passed"),
165 "failed" => $this->lng->txt(
"exc_failed")
169 $this->
filter[
"status"] = $item->getValue();
172 "" => $this->
lng->txt(
"search_any"),
173 "y" => $this->lng->txt(
"exc_tbl_filter_has_submission"),
174 "n" => $this->lng->txt(
"exc_tbl_filter_has_no_submission")
178 $this->
filter[
"subm"] = $item->getValue();
180 $item = $this->
addFilterItemByMetaType(
"flt_subm_after", self::FILTER_DATE,
false, $this->
lng->txt(
"exc_tbl_filter_submission_after"));
181 $this->
filter[
"subm_after"] = $item->getDate();
183 $item = $this->
addFilterItemByMetaType(
"flt_subm_before", self::FILTER_DATE,
false, $this->
lng->txt(
"exc_tbl_filter_submission_before"));
184 $this->
filter[
"subm_before"] = $item->getDate();
186 if ($this->mode == self::MODE_BY_ASSIGNMENT && !$this->ass->hasTeam()) {
194 $this->
lng->txt(
'exc_member_of_crs_grp'),
197 ($this->isForwardingToFormDispatcher()) ? $this :
null
199 $repo->getExplorerGUI()->setSelectableTypes([
"crs",
"grp"]);
200 $repo->getExplorerGUI()->setTypeWhiteList([
"root",
"cat",
"crs",
"grp"]);
202 $repo->readFromSession();
203 $this->
filter[
'member_of'] = (
int) $repo->getValue();
213 abstract protected function initMode(
int $a_item_id): void;
224 foreach ($this->cols_order as
$id) {
225 if (in_array(
$id, $this->cols_mandatory)) {
229 if (array_key_exists(
$id, $columns)) {
230 $col = $columns[
$id];
234 "default" => in_array(
$id, $this->cols_default)
245 $cols[
"submission"] = array($this->
lng->txt(
"exc_tbl_submission_date"),
"submission");
247 $cols[
"status"] = array($this->
lng->txt(
"exc_tbl_status"),
"status");
248 $cols[
"mark"] = array($this->
lng->txt(
"exc_tbl_mark"),
"mark");
249 $cols[
"status_time"] = array($this->
lng->txt(
"exc_tbl_status_time"),
"status_time");
251 $cols[
"sent_time"] = array($this->
lng->txt(
"exc_tbl_sent_time"),
"sent_time");
253 if ($this->exc->hasTutorFeedbackText() ||
254 $this->exc->hasTutorFeedbackMail() ||
255 $this->exc->hasTutorFeedbackFile()) {
256 $cols[
"feedback_time"] = array($this->
lng->txt(
"exc_tbl_feedback_time"),
"feedback_time");
259 if ($this->exc->hasTutorFeedbackText()) {
260 $cols[
"comment"] = array($this->
lng->txt(
"exc_tbl_comment"),
"comment");
263 $cols[
"notice"] = array($this->
lng->txt(
"exc_tbl_notice"),
"notice");
273 protected function parseRow(
278 $ilCtrl = $this->
ctrl;
281 $has_no_team_yet = ($a_ass->
hasTeam() &&
287 if ($this->mode == self::MODE_BY_ASSIGNMENT) {
289 $this->tpl->setVariable(
"VAL_NAME", $a_row[
"name"]);
292 if (!$ilAccess->checkAccessOfUser($a_user_id,
"read",
"", $this->exc->getRefId()) &&
293 is_array(
$info = $ilAccess->getInfo())) {
294 $this->tpl->setCurrentBlock(
'access_warning');
295 $this->tpl->setVariable(
'PARENT_ACCESS',
$info[0][
"text"]);
296 $this->tpl->parseCurrentBlock();
299 asort($a_row[
"team"]);
300 foreach ($a_row[
"team"] as $team_member_id => $team_member_name) {
301 if (count($a_row[
"team"]) > 1) {
302 $ilCtrl->setParameterByClass(
"ilExSubmissionTeamGUI",
"id", $team_member_id);
303 $url = $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"confirmRemoveTeamMember");
304 $ilCtrl->setParameterByClass(
"ilExSubmissionTeamGUI",
"id",
"");
306 $this->tpl->setCurrentBlock(
"team_member_removal_bl");
307 $this->tpl->setVariable(
"URL_TEAM_MEMBER_REMOVAL",
$url);
309 $rem_gl = $this->ui_factory->button()->shy(
'',
$url)
310 ->withSymbol($this->ui_factory->symbol()->glyph()->remove());
311 $this->tpl->setVariable(
312 "TXT_TEAM_MEMBER_REMOVAL",
313 $this->ui_renderer->render($rem_gl)
316 $this->tpl->parseCurrentBlock();
320 if (!$ilAccess->checkAccessOfUser($team_member_id,
"read",
"", $this->exc->getRefId()) &&
321 is_array(
$info = $ilAccess->getInfo())) {
322 $this->tpl->setCurrentBlock(
'team_access_warning');
323 $this->tpl->setVariable(
'TEAM_PARENT_ACCESS',
$info[0][
"text"]);
324 $this->tpl->parseCurrentBlock();
327 $this->tpl->setCurrentBlock(
"team_member");
328 $this->tpl->setVariable(
"TXT_MEMBER_NAME", $team_member_name);
329 $this->tpl->parseCurrentBlock();
332 $this->tpl->setCurrentBlock(
"team_info");
333 if ($has_no_team_yet) {
335 $this->tpl->setVariable(
"TXT_TEAM_INFO", $this->
lng->txt(
"exc_no_team_yet"));
337 $this->tpl->setVariable(
"TXT_TEAM_INFO",
"(" . $a_row[
"submission_obj"]->getTeam()->
getId() .
")");
341 $this->tpl->setVariable(
"VAL_NAME", $a_row[
"name"]);
345 if (!$has_no_team_yet) {
347 $this->tpl->setVariable(
"SEL_" . strtoupper($a_row[
"status"] ??
""),
' selected="selected" ');
348 $this->tpl->setVariable(
"TXT_NOTGRADED", $this->
lng->txt(
"exc_notgraded"));
349 $this->tpl->setVariable(
"TXT_PASSED", $this->
lng->txt(
"exc_passed"));
350 $this->tpl->setVariable(
"TXT_FAILED", $this->
lng->txt(
"exc_failed"));
356 $this->tpl->setVariable(
"NO_TEAM_COLSPAN", $nt_colspan);
362 $include_seconds =
false;
368 $this->tpl->setVariable(
"VAL_IMAGE", $usr_obj->getPersonalPicturePath(
"xxsmall"));
369 $this->tpl->setVariable(
"TXT_IMAGE", $this->
lng->txt(
"personal_picture"));
376 if (count($a_row[
"team"]) === 0) {
377 $this->tpl->setVariable(
"VAL_TEAM_MEMBER", $this->
lng->txt(
"exc_no_team_yet"));
379 foreach ($a_row[
"team"] as $name) {
380 $this->tpl->setCurrentBlock(
"team_member_bl");
381 $this->tpl->setVariable(
"VAL_TEAM_MEMBER", $name);
382 $this->tpl->parseCurrentBlock();
386 $this->tpl->setVariable(
"VAL_TEAM_MEMBER",
" ");
390 case "calc_deadline":
394 if ($a_row[
"requested_idl"] ??
false) {
395 $this->tpl->setVariable(
396 "VAL_" . strtoupper($col),
397 $this->
lng->txt(
"exc_deadline_requested")
400 $this->tpl->setVariable(
401 "VAL_" . strtoupper($col),
406 $this->tpl->setVariable(
407 "VAL_" . strtoupper($col),
416 if (!$has_no_team_yet) {
417 $this->tpl->setVariable(
418 "VAL_" . strtoupper($col),
420 trim((
string) ($a_row[$col] ??
""))
428 $this->tpl->setVariable(
429 "VAL_" . strtoupper($col),
436 $comment_id =
"excasscomm_" . $a_ass->
getId() .
"_" . $a_user_id;
437 $this->tpl->setVariable(
"LCOMMENT_ID", $comment_id .
"_snip");
440 $this->tpl->setVariable(
"VAL_" . strtoupper($col), (trim((
string) ($a_row[$col] ??
"")) !==
"")
441 ? nl2br(trim((
string) $a_row[$col]))
445 case "feedback_time":
449 if ($col ==
"submission" && $a_row[
"submission_obj"]) {
450 $include_seconds =
true;
451 $sm = $this->domain->submission($a_row[
"submission_obj"]->getAssignment()->
getId());
452 foreach ($sm->getSubmissionsOfUser($a_row[
"submission_obj"]->getUserId()) as $sub) {
453 if ($sub->getLate()) {
454 $this->tpl->setVariable(
"TXT_LATE", $this->
lng->txt(
"exc_late_submission"));
459 $this->tpl->setVariable(
460 "VAL_" . strtoupper($col),
461 ($a_row[$col] ??
false)
474 $this->tpl->setVariable(
"VAL_" . strtoupper($col), $a_row[$col]
475 ? trim((
string) $a_row[$col])
481 $this->tpl->setVariable(
"VAL_" . strtoupper($col), $a_row[$col]
482 ? trim((
string) $a_row[$col])
493 $file_info = $a_row[
"submission_obj"]->getDownloadedFilesInfoForTableGUIS();
495 $counter = $file_info[
"files"][
"count"];
497 if (isset($file_info[
"files"][
"download_url"])) {
498 $items[] = $this->ui_factory->button()->shy(
499 $file_info[
"files"][
"download_txt"] .
" (" .
$counter .
")",
500 $file_info[
"files"][
"download_url"]
504 if (isset($file_info[
"files"][
"download_new_url"])) {
505 $items[] = $this->ui_factory->button()->shy(
506 $file_info[
"files"][
"download_new_txt"],
507 $file_info[
"files"][
"download_new_url"]
516 $items[] = $this->ui_factory->link()->standard($this->
lng->txt(
"exc_tbl_action_open_submission"),
$url)->withOpenInNewViewport(
true);
517 if ($a_row[
'submission_obj']->hasSubmittedPrintVersion()) {
519 $items[] = $this->ui_factory->link()->standard($this->
lng->txt(
"exc_print_pdf"),
$url)->withOpenInNewViewport(
true);
523 if (!$has_no_team_yet &&
526 (!is_null($a_row[
"calc_deadline"] ??
null) || $a_ass->
getDeadline() || $ind_deadline_mode)) {
531 $this->tpl->setVariable(
"VAL_IDL_ID", $a_ass->
getId() .
"_" . $idl_id);
533 $assignment_id = $a_ass->
getId();
534 $items[] = $this->ui_factory->button()->shy($this->
lng->txt(
"exc_individual_deadline_action"),
"#")
535 ->withOnLoadCode(
function (
$id) use ($idl_id, $assignment_id) {
536 return "$('#$id').on('click', function() {il.ExcIDl.trigger('$idl_id', '$assignment_id'); return false;})";
541 if ($this->exc->hasTutorFeedbackMail()) {
542 $items[] = $this->ui_factory->button()->shy(
543 $this->
lng->txt(
"exc_tbl_action_feedback_mail"),
544 $ilCtrl->getLinkTarget($this->parent_obj,
"redirectFeedbackMail")
550 if ($this->exc->hasTutorFeedbackFile()) {
551 $tutor_feedback_manager = $this->ass_domain->tutorFeedbackFile($a_ass->
getId());
552 if ($tutor_feedback_manager->hasCollection($a_user_id)) {
554 $counter = $tutor_feedback_manager->count($a_user_id);
558 $items[] = $this->ui_factory->button()->shy(
559 $this->
lng->txt(
"exc_tbl_action_feedback_file") .
$counter,
560 $ilCtrl->getLinkTargetByClass(ilResourceCollectionGUI::class,
"")
566 if ($this->exc->hasTutorFeedbackText()) {
567 $components = $this->feedback_gui->getComponents($a_ass->
getId(), $a_user_id);
569 if ($type ===
"modal") {
570 $this->comment_modals[] = $this->ui_renderer->render(
$c);
571 } elseif ($type ===
"button") {
579 if (($peer_review = $a_row[
"submission_obj"]->getPeerReview()) && $a_ass->
afterDeadlineStrict()) {
580 $counter = $peer_review->countGivenFeedback(
true, $a_user_id);
584 $items[] = $this->ui_factory->button()->shy(
585 $this->
lng->txt(
"exc_tbl_action_peer_review_given") .
$counter,
586 $ilCtrl->getLinkTargetByClass(
"ilexpeerreviewgui",
"showGivenPeerReview")
589 $counter = count($peer_review->getPeerReviewsByPeerId($a_user_id,
true));
594 $items[] = $this->ui_factory->button()->shy(
595 $this->
lng->txt(
"exc_tbl_action_peer_review_received") .
$counter,
596 $ilCtrl->getLinkTargetByClass(
"ilexpeerreviewgui",
"showReceivedPeerReview")
601 if ($has_no_team_yet) {
602 $items[] = $this->ui_factory->button()->shy(
603 $this->
lng->txt(
"exc_create_team"),
604 $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"createSingleMemberTeam")
607 $items[] = $this->ui_factory->button()->shy(
608 $this->
lng->txt(
"exc_tbl_action_team_log"),
609 $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"showTeamLog")
613 $actions = $this->ui_factory->dropdown()->standard($items);
615 $this->tpl->setVariable(
"ACTIONS", $this->ui_renderer->render($actions));
620 return parent::render() .
621 implode(
"\n", $this->comment_modals);
Builds a Color from either hex- or rgb values.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
static getTeamId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
getType()
Get type this will most probably become an non public function in the future (or become obsolete)
canParticipantReceiveFeedback(int $part_id)
const DEADLINE_ABSOLUTE_INDIVIDUAL
afterDeadlineStrict(bool $a_include_personal=true)
__construct(object $a_parent_obj, string $a_parent_cmd, ilObjExercise $a_exc, int $a_item_id, ilExerciseSubmissionFeedbackGUI $feedback_gui)
ilExerciseSubmissionFeedbackGUI $feedback_gui
ilExAssignmentTypes $ass_types
ILIAS Exercise InternalDomainService $domain
isForwardingToFormDispatcher()
getSelectableColumns()
Get selectable columns.
ilExAssignmentTypeInterface $ass_type
ILIAS Exercise Assignment DomainService $ass_domain
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFilterCommand(string $a_val, string $a_caption="")
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
setFormName(string $a_name="")
addMultiCommand(string $a_cmd, string $a_text)
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setResetCommand(string $a_val, string $a_caption="")
setData(array $a_data)
Set table data.
This is how the factory for UI elements looks.
An entity that renders components to a string output.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
filter(string $filter_id, array $class_path, string $cmd, bool $activated=true, bool $expanded=true)