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) {
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")
168 $item->setOptions($options);
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")
177 $item->setOptions($options);
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'),
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;
215 abstract protected function parseData(): array;
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(
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->symbol()->glyph()->remove(
$url);
310 $this->tpl->setVariable(
311 "TXT_TEAM_MEMBER_REMOVAL",
312 $this->ui_renderer->render($rem_gl)
315 $this->tpl->parseCurrentBlock();
319 if (!$ilAccess->checkAccessOfUser($team_member_id,
"read",
"", $this->exc->getRefId()) &&
320 is_array(
$info = $ilAccess->getInfo())) {
321 $this->tpl->setCurrentBlock(
'team_access_warning');
322 $this->tpl->setVariable(
'TEAM_PARENT_ACCESS',
$info[0][
"text"]);
323 $this->tpl->parseCurrentBlock();
326 $this->tpl->setCurrentBlock(
"team_member");
327 $this->tpl->setVariable(
"TXT_MEMBER_NAME", $team_member_name);
328 $this->tpl->parseCurrentBlock();
331 $this->tpl->setCurrentBlock(
"team_info");
332 if ($has_no_team_yet) {
334 $this->tpl->setVariable(
"TXT_TEAM_INFO", $this->
lng->txt(
"exc_no_team_yet"));
336 $this->tpl->setVariable(
"TXT_TEAM_INFO",
"(" . $a_row[
"submission_obj"]->getTeam()->
getId() .
")");
340 $this->tpl->setVariable(
"VAL_NAME", $a_row[
"name"]);
344 if (!$has_no_team_yet) {
346 $this->tpl->setVariable(
"SEL_" . strtoupper($a_row[
"status"] ??
""),
' selected="selected" ');
347 $this->tpl->setVariable(
"TXT_NOTGRADED", $this->
lng->txt(
"exc_notgraded"));
348 $this->tpl->setVariable(
"TXT_PASSED", $this->
lng->txt(
"exc_passed"));
349 $this->tpl->setVariable(
"TXT_FAILED", $this->
lng->txt(
"exc_failed"));
355 $this->tpl->setVariable(
"NO_TEAM_COLSPAN", $nt_colspan);
361 $include_seconds =
false;
367 $this->tpl->setVariable(
"VAL_IMAGE", $usr_obj->getPersonalPicturePath(
"xxsmall"));
368 $this->tpl->setVariable(
"TXT_IMAGE", $this->
lng->txt(
"personal_picture"));
375 if (count($a_row[
"team"]) === 0) {
376 $this->tpl->setVariable(
"VAL_TEAM_MEMBER", $this->
lng->txt(
"exc_no_team_yet"));
378 foreach ($a_row[
"team"] as $name) {
379 $this->tpl->setCurrentBlock(
"team_member_bl");
380 $this->tpl->setVariable(
"VAL_TEAM_MEMBER", $name);
381 $this->tpl->parseCurrentBlock();
385 $this->tpl->setVariable(
"VAL_TEAM_MEMBER",
" ");
389 case "calc_deadline":
393 if ($a_row[
"requested_idl"] ??
false) {
394 $this->tpl->setVariable(
395 "VAL_" . strtoupper($col),
396 $this->
lng->txt(
"exc_deadline_requested")
399 $this->tpl->setVariable(
400 "VAL_" . strtoupper($col),
405 $this->tpl->setVariable(
406 "VAL_" . strtoupper($col),
415 if (!$has_no_team_yet) {
416 $this->tpl->setVariable(
417 "VAL_" . strtoupper($col),
419 trim((
string) ($a_row[$col] ??
""))
427 $this->tpl->setVariable(
428 "VAL_" . strtoupper($col),
435 $comment_id =
"excasscomm_" . $a_ass->
getId() .
"_" . $a_user_id;
436 $this->tpl->setVariable(
"LCOMMENT_ID", $comment_id .
"_snip");
439 $this->tpl->setVariable(
"VAL_" . strtoupper($col), (trim((
string) ($a_row[$col] ??
"")) !==
"")
440 ? nl2br(trim((
string) $a_row[$col]))
444 case "feedback_time":
448 if ($col ==
"submission" && $a_row[
"submission_obj"]) {
449 $include_seconds =
true;
450 $sm = $this->domain->submission($a_row[
"submission_obj"]->getAssignment()->
getId());
451 foreach ($sm->getSubmissionsOfUser($a_row[
"submission_obj"]->getUserId()) as $sub) {
452 if ($sub->getLate()) {
453 $this->tpl->setVariable(
"TXT_LATE", $this->
lng->txt(
"exc_late_submission"));
458 $this->tpl->setVariable(
459 "VAL_" . strtoupper($col),
460 ($a_row[$col] ??
false)
473 $this->tpl->setVariable(
"VAL_" . strtoupper($col), $a_row[$col]
474 ? trim((
string) $a_row[$col])
480 $this->tpl->setVariable(
"VAL_" . strtoupper($col), $a_row[$col]
481 ? trim((
string) $a_row[$col])
492 $file_info = $a_row[
"submission_obj"]->getDownloadedFilesInfoForTableGUIS();
494 $counter = $file_info[
"files"][
"count"];
496 if (isset($file_info[
"files"][
"download_url"])) {
497 $items[] = $this->ui_factory->button()->shy(
498 $file_info[
"files"][
"download_txt"] .
" (" . $counter .
")",
499 $file_info[
"files"][
"download_url"]
503 if (isset($file_info[
"files"][
"download_new_url"])) {
504 $items[] = $this->ui_factory->button()->shy(
505 $file_info[
"files"][
"download_new_txt"],
506 $file_info[
"files"][
"download_new_url"]
513 if ($ass_type->
supportsWebDirAccess() && $a_row[
'submission_obj']->hasSubmittedPrintVersion()) {
516 if ($a_row[
'submission_obj']->hasSubmittedPrintVersion()) {
522 if (!$has_no_team_yet &&
525 (!is_null($a_row[
"calc_deadline"] ??
null) || $a_ass->
getDeadline() || $ind_deadline_mode)) {
530 $this->tpl->setVariable(
"VAL_IDL_ID", $a_ass->
getId() .
"_" . $idl_id);
532 $assignment_id = $a_ass->
getId();
533 $items[] = $this->ui_factory->button()->shy($this->
lng->txt(
"exc_individual_deadline_action"),
"#")
535 return "$('#$id').on('click', function() {il.ExcIDl.trigger('$idl_id', '$assignment_id'); return false;})";
540 if ($this->exc->hasTutorFeedbackMail()) {
541 $items[] = $this->ui_factory->button()->shy(
542 $this->
lng->txt(
"exc_tbl_action_feedback_mail"),
543 $ilCtrl->getLinkTarget($this->parent_obj,
"redirectFeedbackMail")
549 if ($this->exc->hasTutorFeedbackFile()) {
550 $tutor_feedback_manager = $this->ass_domain->tutorFeedbackFile($a_ass->
getId());
551 if ($tutor_feedback_manager->hasCollection($a_user_id)) {
553 $counter = $tutor_feedback_manager->count($a_user_id);
555 ?
" (" . $counter .
")" 557 $items[] = $this->ui_factory->button()->shy(
558 $this->
lng->txt(
"exc_tbl_action_feedback_file") . $counter,
559 $ilCtrl->getLinkTargetByClass(ilResourceCollectionGUI::class,
"")
565 if ($this->exc->hasTutorFeedbackText()) {
566 $components = $this->feedback_gui->getComponents($a_ass->
getId(), $a_user_id);
568 if ($type ===
"modal") {
569 $this->comment_modals[] = $this->ui_renderer->render(
$c);
570 } elseif ($type ===
"button") {
578 if (($peer_review = $a_row[
"submission_obj"]->getPeerReview()) && $a_ass->
afterDeadlineStrict()) {
579 $counter = $peer_review->countGivenFeedback(
true, $a_user_id);
581 ?
" (" . $counter .
")" 583 $items[] = $this->ui_factory->button()->shy(
584 $this->
lng->txt(
"exc_tbl_action_peer_review_given") . $counter,
585 $ilCtrl->getLinkTargetByClass(
"ilexpeerreviewgui",
"showGivenPeerReview")
588 $counter = count($peer_review->getPeerReviewsByPeerId($a_user_id,
true));
589 $counter = $counter !== 0
590 ?
" (" . $counter .
")" 593 $items[] = $this->ui_factory->button()->shy(
594 $this->
lng->txt(
"exc_tbl_action_peer_review_received") . $counter,
595 $ilCtrl->getLinkTargetByClass(
"ilexpeerreviewgui",
"showReceivedPeerReview")
600 if ($has_no_team_yet) {
601 $items[] = $this->ui_factory->button()->shy(
602 $this->
lng->txt(
"exc_create_team"),
603 $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"createSingleMemberTeam")
606 $items[] = $this->ui_factory->button()->shy(
607 $this->
lng->txt(
"exc_tbl_action_team_log"),
608 $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"showTeamLog")
612 $actions = $this->ui_factory->dropdown()->standard($items);
614 $this->tpl->setVariable(
"ACTIONS", $this->ui_renderer->render($actions));
619 return parent::render() .
620 implode(
"\n", $this->comment_modals);
ilExerciseSubmissionFeedbackGUI $feedback_gui
getType()
Get type this will most probably become an non public function in the future (or become obsolete) ...
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)
setFormName(string $a_name="")
withOnLoadCode(Closure $binder)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
const DEADLINE_ABSOLUTE_INDIVIDUAL
setDefaultOrderField(string $a_defaultorderfield)
This is how the factory for UI elements looks.
__construct(object $a_parent_obj, string $a_parent_cmd, ilObjExercise $a_exc, int $a_item_id, ilExerciseSubmissionFeedbackGUI $feedback_gui)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setFilterCommand(string $a_val, string $a_caption="")
setDefaultOrderDirection(string $a_defaultorderdirection)
ILIAS Exercise InternalDomainService $domain
static getTeamId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
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
ilExAssignmentTypes $ass_types
ilExAssignmentTypeInterface $ass_type
__construct(Container $dic, ilPlugin $plugin)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
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)
isForwardingToFormDispatcher()
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...