29 protected \ILIAS\Exercise\PeerReview\Criteria\CriteriaFileManager
$criteria_file;
30 protected \ILIAS\Exercise\Submission\SubmissionManager
$subm;
32 protected \ILIAS\Exercise\Notification\NotificationManager
$notification;
33 protected \ILIAS\Notes\Service
$notes;
34 protected \ILIAS\Exercise\InternalGUIService
$gui;
35 protected \ILIAS\Exercise\InternalDomainService
$domain;
58 $this->
user = $this->domain->user();
59 $this->
ctrl = $this->gui->ctrl();
60 $this->tabs_gui = $this->gui->tabs();
61 $this->
lng = $this->domain->lng();
62 $this->tpl = $this->gui->ui()->mainTemplate();
65 $this->submission = $a_submission;
67 $request =
$DIC->exercise()->internal()->gui()->request();
68 $this->requested_review_giver_id = $request->getReviewGiverId();
69 $this->requested_review_peer_id = $request->getReviewPeerId();
70 $this->requested_review_crit_id = $request->getReviewCritId();
71 $this->requested_peer_id = $request->getPeerId();
72 $this->requested_giver_id = $request->getGiverId();
73 $this->requested_crit_id = $request->getCritId();
74 $this->gui =
$DIC->exercise()->internal()->gui();
75 $this->notes =
$DIC->notes();
76 $this->
ctrl->saveParameter($this, array(
"peer_id"));
77 $this->
notification = $this->domain->notification($request->getRefId());
78 $this->subm = $this->domain->submission($a_ass->
getId());
79 $this->criteria_file = $this->domain->peerReview()->criteriaFile($a_ass->
getId());
91 if (!$this->ass->getPeerReview()) {
95 $class = $ilCtrl->getNextClass($this);
96 $cmd = $ilCtrl->getCmd(
"showpeerreviewoverview");
102 $peer_review->updatePeerReviewTimestamp($this->requested_peer_id);
105 $rating_gui->setObject(
108 $this->requested_peer_id,
111 $this->
ctrl->forwardCommand($rating_gui);
112 $ilCtrl->redirect($this,
"editPeerReview");
115 case "ilexsubmissiontextgui":
116 $ilTabs->clearTargets();
117 if (!$this->submission->isTutor()) {
118 $ilTabs->setBackTarget(
120 $ilCtrl->getLinkTarget($this,
"editPeerReview")
122 $this->
ctrl->setReturn($this,
"editPeerReview");
124 $ilTabs->setBackTarget(
126 $ilCtrl->getLinkTarget($this,
"showGivenPeerReview")
128 $this->
ctrl->setReturn($this,
"showGivenPeerReview");
131 $ilCtrl->forwardCommand(
$gui);
136 $this->requested_giver_id,
137 $this->requested_peer_id
139 $ilCtrl->forwardCommand(
$gui);
143 $this->{$cmd .
"Object"}();
150 $this->
ctrl->returnToParent($this);
163 $ilCtrl =
$DIC->ctrl();
178 if ($state->hasSubmissionEndedForAllUsers() &&
180 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"ass_id", $a_submission->
getAssignment()->getId());
182 $nr_missing_fb = $a_submission->
getPeerReview()->getNumberOfMissingFeedbacksForReceived();
187 if ($state->isPeerReviewAllowed()) {
190 $dl_info =
" (" . sprintf(
191 $lng->
txt(
"exc_peer_review_deadline_info_button"),
192 $state->getPeerReviewDeadlinePresentation()
197 $lng->
txt(
"exc_peer_review_give"),
198 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
"ilExSubmissionGUI",
"ilExPeerReviewGUI"),
"editPeerReview")
200 if ($nr_missing_fb) {
203 $edit_pc =
$b->render();
205 $edit_pc =
$lng->
txt(
"exc_peer_review_deadline_reached");
215 $lng->
txt(
"exc_peer_review_given"),
216 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
"ilExSubmissionGUI",
"ilExPeerReviewGUI"),
"showGivenPeerReview")
218 $view_pc =
$b->render() .
" ";
222 if (!$nr_missing_fb) {
224 $received = (bool)
sizeof($a_submission->
getPeerReview()->getPeerReviewsByPeerId($a_submission->
getUserId(),
true));
227 $lng->
txt(
"exc_peer_review_show"),
228 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
"ilExSubmissionGUI",
"ilExPeerReviewGUI"),
"showReceivedPeerReview")
230 $view_pc .=
$b->render();
234 $view_pc .=
$lng->
txt(
"exc_peer_review_show_received_none");
239 $view_pc .=
$lng->
txt(
"exc_peer_review_show_missing");
249 $sep = ($edit_pc !=
"" && $view_pc !=
"")
255 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"ass_id",
"");
261 $f = $this->gui->ui()->factory();
263 $ilCtrl = $this->ctrl;
264 $submission = $this->submission;
266 $state = $this->domain->assignment()->state($ass->
getId(), $submission->
getUserId());
274 if ($state->hasSubmissionEndedForAllUsers() &&
276 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"ass_id", $submission->
getAssignment()->getId());
278 $nr_missing_fb = $submission->
getPeerReview()->getNumberOfMissingFeedbacksForReceived();
280 $builder->addAdditionalHeadProperty(
281 $this->
lng->txt(
"exc_given_feedback"),
283 $this->lng->txt(
"exc_x_of_y") .
" " .
287 $builder->addAdditionalHeadProperty(
288 $this->
lng->txt(
"exc_received_feedback"),
289 $submission->
getPeerReview()->countReceivedFeedbacks($submission->getUserid())
295 if ($state->isPeerReviewAllowed()) {
296 $url = $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
"ilExSubmissionGUI",
"ilExPeerReviewGUI"),
"editPeerReview");
297 $button =
$f->button()->primary(
298 $lng->txt(
"exc_peer_review_give"),
303 $this->
lng->txt(
"exc_given_feedback"),
306 $builder->setMainAction(
307 $builder::SEC_PEER_FEEDBACK,
311 $deadline = $state->getPeerReviewDeadlinePresentation();
313 $deadline =
$lng->txt(
"exc_no_peer_feedback_deadline");
315 $builder->addProperty(
316 $builder::SEC_PEER_FEEDBACK,
317 $lng->txt(
"exc_peer_review_deadline"),
321 $edit_pc =
$lng->txt(
"exc_peer_review_deadline_reached");
322 $builder->addProperty(
323 $builder::SEC_PEER_FEEDBACK,
324 $lng->txt(
"exc_peer_review_deadline"),
325 $lng->txt(
"exc_peer_review_deadline_reached")
329 $builder->addProperty(
330 $builder::SEC_SCHEDULE,
331 $lng->txt(
"exc_peer_review_deadline"),
332 $state->getPeerReviewDeadlinePresentation()
342 $url = $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
"ilExSubmissionGUI",
"ilExPeerReviewGUI"),
"showGivenPeerReview");
343 $link =
$f->link()->standard(
344 $lng->txt(
"exc_peer_review_given"),
348 $builder::SEC_PEER_FEEDBACK,
353 $this->
lng->txt(
"exc_given_feedback"),
358 if ($nr_missing_fb <= 0) {
360 $received = (bool)
sizeof($submission->
getPeerReview()->getPeerReviewsByPeerId($submission->
getUserId(),
true));
362 $url = $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
"ilExSubmissionGUI",
"ilExPeerReviewGUI"),
"showReceivedPeerReview");
363 $link =
$f->link()->standard(
364 $lng->txt(
"exc_peer_review_show"),
368 $builder::SEC_PEER_FEEDBACK,
373 $this->
lng->txt(
"exc_received_feedback"),
379 $builder->addProperty(
380 $builder::SEC_PEER_FEEDBACK,
381 $lng->txt(
"exc_received_peer_feedback"),
382 $lng->txt(
"exc_peer_review_show_received_none")
388 $builder->addProperty(
389 $builder::SEC_PEER_FEEDBACK,
390 $lng->txt(
"exc_peer_feedback_status"),
391 $lng->txt(
"exc_peer_review_show_missing")
395 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"ass_id",
"");
401 return ($this->submission->isOwner() &&
402 $this->ass->afterDeadlineStrict() &&
403 (!$this->ass->getPeerReviewDeadline() ||
404 $this->ass->getPeerReviewDeadline() > time()));
409 return ($this->submission->isTutor() ||
410 ($this->submission->isOwner() &&
411 $this->ass->afterDeadlineStrict() &&
412 (!$this->ass->getPeerReviewDeadline() ||
413 $this->ass->getPeerReviewDeadline() < time())));
427 $this->tabs_gui->activateTab(
"give_feedback");
429 if (!$this->canView()) {
430 $this->returnToParentObject();
433 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
434 if ($peer_items === []) {
435 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"exc_peer_review_no_peers"),
true);
436 $this->returnToParentObject();
439 $tpl->
setTitle($this->ass->getTitle() .
": " .
$lng->txt(
"exc_peer_review_given"));
441 $this->gui->permanentLink()->setGivenFeedbackPermanentLink();
443 $panel = $this->getReceivedFeedbackPanel($peer_items);
445 $tpl->
setContent($this->gui->ui()->renderer()->render($panel));
456 $ilCtrl = $this->ctrl;
459 $this->tabs_gui->activateTab(
"receive_feedback");
461 if (!$this->canView() ||
462 (!$this->submission->isTutor() &&
463 $this->submission->getPeerReview()->getNumberOfMissingFeedbacksForReceived())) {
464 $this->returnToParentObject();
467 $this->gui->permanentLink()->setReceivedFeedbackPermanentLink();
473 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByPeerId($this->submission->getUserId(), !$this->submission->isTutor());
474 if ($peer_items === []) {
476 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"exc_peer_review_no_peers_reviewed_yet"),
true);
477 $ilCtrl->redirect($this,
"returnToParent");
480 $tpl->
setTitle($this->ass->getTitle() .
": " .
$lng->txt(
"exc_peer_review_show"));
484 $panel = $this->getReceivedFeedbackPanel($peer_items,
true);
486 $tpl->
setContent($this->gui->ui()->renderer()->render($panel));
491 bool $a_by_peer =
false
496 if ($this->submission->isTutor()) {
498 $user_title = $a_by_peer
499 ?
$lng->txt(
"exc_peer_review_recipient")
500 :
$lng->txt(
"exc_peer_review_giver");
502 "prop" =>
$lng->txt(
"name"),
505 $sub_panels[] = $this->getSubPanel(
517 $submission =
new ilExSubmission($this->ass, $this->submission->getUserId());
518 $file_info = $submission->getDownloadedFilesInfoForTableGUIS();
521 "prop" => $file_info[
"last_submission"][
"txt"],
522 "value" => $file_info[
"last_submission"][
"value"] .
523 $this->getLateSubmissionInfo($submission)
526 $sub_data = $this->getSubmissionContent($submission);
527 if ($sub_data ===
'' || $sub_data ===
'0') {
528 $sub_data =
'<a href="' . $file_info[
"files"][
"download_url"] .
'">' .
$lng->txt(
"download") .
'</a>';
530 $sub_data = $this->gui->html()->escapeCurly($sub_data);
533 "prop" =>
$lng->txt(
"exc_submission"),
537 $sub_panels[] = $this->getSubPanel(
538 $lng->txt(
"exc_your_submission"),
543 foreach ($a_peer_items as $peer) {
546 $giver_id = $this->submission->getUserId();
547 $peer_id = $peer[
"peer_id"];
548 $id_title =
$lng->txt(
"exc_peer_review_recipient");
554 $giver_id = $peer[
"giver_id"];
555 $peer_id = $this->submission->getUserId();
556 $id_title =
$lng->txt(
"exc_peer_review_giver");
561 if ($this->submission->isTutor()) {
563 } elseif (!$this->ass->hasPeerReviewPersonalized()) {
564 $id_value = $peer[
"seq"];
569 $mess_gui = $this->getMessagesGUI(
578 $file_info = $submission->getDownloadedFilesInfoForTableGUIS();
581 "prop" => $file_info[
"last_submission"][
"txt"],
582 "value" => $file_info[
"last_submission"][
"value"] .
583 $this->getLateSubmissionInfo($submission)
586 $sub_data = $this->getSubmissionContent($submission);
587 if ($sub_data ===
'' || $sub_data ===
'0') {
588 if (isset($file_info[
"files"][
"download_url"])) {
589 $sub_data =
'<a href="' . $file_info[
"files"][
"download_url"] .
'">' .
$lng->txt(
"download") .
'</a>';
592 $sub_data = $this->gui->html()->escapeCurly($sub_data);
595 "prop" =>
$lng->txt(
"exc_submission"),
603 $values = $this->submission->getPeerReview()->getPeerReviewValues($giver_id, $peer_id);
605 foreach ($this->ass->getPeerReviewCriteriaCatalogueItems() as $item) {
606 $crit_id = $item->getId()
610 $item->setPeerReviewContext(
616 $title = $item->getTitle();
617 $html = $item->getHTML($values[$crit_id] ??
null);
619 "prop" => $title ?:
" ",
620 "value" => $html ?:
" "
623 $sub_panels[] = $this->getSubPanel(
624 $id_title .
": " . $id_value,
629 return $this->gui->ui()->factory()->panel()->standard(
631 ? $this->
lng->txt(
"exc_received_feedback")
632 : $this->lng->txt(
"exc_given_feedback"),
643 $r = $this->gui->ui()->renderer();
644 $tpl = new \ilTemplate(
"tpl.panel_items.html",
true,
true,
"components/ILIAS/Exercise/PeerReview");
645 foreach ($props as $prop) {
653 $mess_html = $r->render(
$f->divider()->horizontal()) .
654 $mess_gui->getWidget();
657 return $f->panel()->sub(
659 $f->legacy()->content($tpl->
get() . $mess_html)
669 foreach ($this->subm->getSubmissionsOfUser($a_submission->
getUserId()) as $sub) {
670 if ($sub->getLate()) {
671 return '<div class="warning">' .
$lng->txt(
"exc_late_submission") .
'</div>';
684 $this->tabs_gui->activateTab(
"give_feedback");
685 if (!$this->canGive()) {
686 $this->returnToParentObject();
689 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
690 if ($peer_items === []) {
691 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"exc_peer_review_no_peers"),
true);
692 $this->returnToParentObject();
695 $missing = $this->submission->getPeerReview()->getNumberOfMissingFeedbacksForReceived();
696 if ($missing !== 0) {
697 $dl = $this->ass->getPeerReviewDeadline();
698 if (!$dl || $dl < time()) {
699 $this->tpl->setOnScreenMessage(
'info', sprintf($this->
lng->txt(
"exc_peer_review_missing_info"), $missing));
701 $this->tpl->setOnScreenMessage(
'info', sprintf(
702 $this->
lng->txt(
"exc_peer_review_missing_info_deadline"),
709 $panel = $this->getPeerReviewReceiverPanel(
711 $this->submission->getUserId(),
714 $tpl->
setContent($this->gui->ui()->renderer()->render($panel));
722 $personal = $ass->hasPeerReviewPersonalized();
723 $f = $this->gui->ui()->factory();
726 foreach ($peer_data as $item) {
733 $row[
"giver_id"] = $item[
"giver_id"];
734 $row[
"peer_id"] = $item[
"peer_id"];
735 $row[
"tstamp"] = $item[
"tstamp"];
738 $row[
"seq"] = $item[
"seq"];
744 $row[
"valid"] = $all_empty =
true;
746 $values = $submission->
getPeerReview()->getPeerReviewValues($item[
"giver_id"], $item[
"peer_id"]);
747 foreach ($this->ass->getPeerReviewCriteriaCatalogueItems() as $crit) {
748 $crit_id = $crit->getId()
751 $crit->setPeerReviewContext(
756 if (!$crit->validate($values[$crit_id] ??
null)) {
757 $row[
"valid"] =
false;
759 if ($crit->hasValue($values[$crit_id] ??
null)) {
764 $row[
"valid"] =
false;
766 if (!$row[
"valid"]) {
770 $ilCtrl = $this->ctrl;
772 if (isset($row[
"seq"])) {
773 $title = $this->
lng->txt(
"exc_peer_review_recipient") .
" " . $row[
"seq"];
775 $title = $row[
"name"];
778 if ($row[
"tstamp"]) {
782 $props[
$lng->txt(
"last_update")] = $row[
"tstamp"];
784 $props[
$lng->txt(
"valid")] = $row[
"valid"]
785 ? $this->
lng->txt(
"yes")
786 : $this->
lng->txt(
"no");
788 $ilCtrl->setParameter($this,
"peer_id", $row[
"peer_id"]);
791 $this->
lng->txt(
"edit"),
792 $ilCtrl->getLinkTarget($this,
"editPeerReviewItem")
795 $ilCtrl->setParameter($this,
"pid",
"");
797 $items[] =
$f->item()->standard(
799 )->withProperties($props)
800 ->withActions(
$f->dropdown()->standard($actions));
803 $group =
$f->item()->group(
"", $items);
804 return $f->panel()->listing()->standard(
805 $this->
lng->txt(
"exc_peer_review_give"),
815 $this->tabs_gui->activateTab(
"give_feedback");
817 if (!$this->canGive() && $this->canView()) {
818 $this->
ctrl->redirectByClass(self::class,
"showGivenPeerReview");
821 if (!$this->canGive() ||
822 !$this->isValidPeer($this->requested_peer_id)) {
823 $this->returnToParentObject();
826 if ($a_form ===
null) {
827 $a_form = $this->initPeerReviewItemForm($this->requested_peer_id);
830 $sep = $this->gui->ui()->renderer()->render($this->gui->ui()->factory()->divider()->horizontal());
835 if ($peer_state->isReceivedFeedbackAccessible()) {
836 $message_gui = $this->getMessagesGUI(
837 $this->
user->getId(),
838 $this->requested_peer_id
840 $message_html = $sep . $message_gui->getListHTML();
843 $this->gui->permanentLink()->setGivenFeedbackPermanentLink();
845 $tpl->
setContent($a_form->getHTML() . $message_html);
850 $this->
ctrl->setParameter($this,
"giver_id", $giver_id);
851 $this->
ctrl->setParameter($this,
"peer_id", $peer_id);
852 $pr = $this->domain->peerReview()->exPeerReview($this->ass);
853 $gui = $this->notes->gui()->getMessagesGUI(
855 $this->ass->getExerciseId(),
856 $pr->getReviewId($giver_id, $peer_id),
859 if (!$this->ass->hasPeerReviewPersonalized()) {
860 if ($giver_id === $this->
user->getId()) {
861 $counterpart_name = $this->
lng->txt(
"exc_peer_review_recipient");
863 $counterpart_name = $this->
lng->txt(
"exc_peer_review_giver");
865 $gui->setAnonymised(
true, $counterpart_name);
868 $gui->addObserver(
function (
874 ) use ($giver_id, $peer_id) {
875 $this->observeMessageAction(
892 if ($action !==
"new") {
895 $note = $this->notes->domain()->getById($note_id);
896 $text = $note->getText();
898 if ($note->getAuthor() === $giver_id) {
899 $this->
notification->sendMessageFromPeerfeedbackGiverNotification(
905 $this->
notification->sendMessageFromPeerfeedbackRecipientNotification(
917 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
918 foreach ($peer_items as $item) {
919 if ($item[
"peer_id"] == $a_peer_id) {
933 $sub = $this->subm->getSubmissionsOfUser($a_submission->
getUserId())->current();
935 if (trim($sub->getText()) !==
'' && trim($sub->getText()) !==
'0') {
949 $ilCtrl = $this->
ctrl;
953 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
955 foreach ($peer_items as $item) {
956 if ($item[
"peer_id"] == $a_peer_id) {
962 $ilCtrl->saveParameter($this,
"peer_id");
965 $form->setFormAction($ilCtrl->getFormAction($this,
"updatePeerReview"));
967 $form->setTitle($this->ass->getTitle() .
": " .
$lng->txt(
"exc_peer_review_give"));
970 if (!$this->ass->hasPeerReviewPersonalized()) {
971 $id_title =
$lng->txt(
"id");
972 $id_value = $peer[
"seq"];
974 $id_title =
$lng->txt(
"exc_peer_review_recipient");
978 $id->setValue($id_value);
984 $file_info = $submission->getDownloadedFilesInfoForTableGUIS();
987 $last_sub->setValue($file_info[
"last_submission"][
"value"] .
988 $this->getLateSubmissionInfo($submission));
989 $form->addItem($last_sub);
991 $sub_data = $this->getSubmissionContent($submission);
992 if (($sub_data ===
'' || $sub_data ===
'0') && isset($file_info[
"files"][
"download_url"])) {
993 $sub_data =
'<a href="' . $file_info[
"files"][
"download_url"] .
'">' .
$lng->txt(
"download") .
'</a>';
995 $sub_data = $this->gui->html()->escapeCurly($sub_data);
999 $sub->setValue($sub_data);
1000 $form->addItem($sub);
1005 $input->setTitle(
$lng->txt(
"exc_peer_review"));
1006 $form->addItem($input);
1008 $values = $this->submission->getPeerReview()->getPeerReviewValues($this->submission->getUserId(), $a_peer_id);
1011 foreach ($this->ass->getPeerReviewCriteriaCatalogueItems() as $item) {
1012 $crit_id = $item->getId()
1016 $item->setPeerReviewContext(
1018 $this->submission->getUserId(),
1022 $item->addToPeerReviewForm($values[$crit_id] ??
null);
1025 $form->addCommandButton(
"updatePeerReview",
$lng->txt(
"save"));
1026 $form->addCommandButton(
"editPeerReview",
$lng->txt(
"cancel"));
1033 $ilCtrl = $this->ctrl;
1034 $ilUser = $this->user;
1037 if (!$this->canGive() ||
1038 !$this->requested_peer_id ||
1039 !$this->requested_crit_id ||
1040 !$ilCtrl->isAsynch()) {
1044 $peer_id = $this->requested_peer_id;
1045 $crit_id = $this->requested_crit_id;
1046 $giver_id = $ilUser->getId();
1048 if (!is_numeric($crit_id)) {
1053 $crit->setPeerReviewContext($this->ass, $giver_id, $peer_id);
1054 $html = $crit->updateFromAjax();
1056 $this->handlePeerReviewChange();
1066 $ilCtrl = $this->ctrl;
1068 if (!$this->canGive() ||
1069 !$this->isValidPeer($this->requested_peer_id)) {
1070 $this->returnToParentObject();
1073 $peer_id = $this->requested_peer_id;
1075 $form = $this->initPeerReviewItemForm($peer_id);
1076 if ($form->checkInput()) {
1080 foreach ($this->ass->getPeerReviewCriteriaCatalogueItems() as $item) {
1081 $item->setPeerReviewContext(
1083 $this->submission->getUserId(),
1087 $value = $item->importFromPeerReviewForm();
1088 if ($value !==
null) {
1089 $crit_id = $item->getId()
1092 $values[$crit_id] = $value;
1094 if (!$item->validate($value)) {
1100 $this->submission->getPeerReview()->updatePeerReview($peer_id, $values);
1102 $this->handlePeerReviewChange();
1104 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"exc_peer_review_updated"),
true);
1105 $ilCtrl->redirect($this,
"editPeerReview");
1107 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"form_input_not_valid"));
1111 $form->setValuesByPost();
1112 $this->editPeerReviewItemObject($form);
1121 $this->submission->getUserIds(),
1122 $this->submission->hasSubmitted(),
1123 $this->submission->validatePeerReviews()
1129 $ilCtrl = $this->ctrl;
1131 if (!$this->canView() &&
1132 !$this->canGive()) {
1133 $this->returnToParentObject();
1136 $giver_id = $this->requested_review_giver_id;
1137 $peer_id = $this->requested_review_peer_id;
1138 $crit_id = $this->requested_review_crit_id;
1139 if (!is_numeric($crit_id)) {
1144 $file_crit_id = $crit_id;
1147 $crit->setPeerReviewContext($this->ass, $giver_id, $peer_id);
1148 $file = $crit->getFileByHash();
1150 $this->criteria_file->deliverFileOfReview(
1157 $ilCtrl->redirect($this,
"returnToParent");
1171 !$this->ass->getPeerReview()) {
1172 $this->returnToParentObject();
1177 "showPeerReviewOverview",
1182 $panel_data = $tbl->getPanelInfo();
1183 if (is_array($panel_data) && count($panel_data) > 0) {
1184 $ptpl =
new ilTemplate(
"tpl.exc_peer_review_overview_panel.html",
true,
true,
"components/ILIAS/Exercise");
1185 foreach ($panel_data as $item) {
1186 $ptpl->setCurrentBlock(
"user_bl");
1187 foreach ($item[
"value"] as $user) {
1188 $ptpl->setVariable(
"USER", $user);
1189 $ptpl->parseCurrentBlock();
1192 $ptpl->setCurrentBlock(
"item_bl");
1193 $ptpl->setVariable(
"TITLE", $item[
"title"]);
1194 $ptpl->parseCurrentBlock();
1197 $f = $this->gui->ui()->factory();
1198 $r = $this->gui->ui()->renderer();
1199 $p =
$f->panel()->standard(
1200 $this->
lng->txt(
"exc_peer_review_overview_invalid_users"),
1201 $f->legacy()->content($ptpl->get())
1204 $panel = $r->render($p);
1212 $ilCtrl = $this->ctrl;
1214 $ilTabs = $this->tabs_gui;
1217 !$this->ass->getPeerReview()) {
1218 $this->returnToParentObject();
1221 $ilTabs->clearTargets();
1224 $cgui->setFormAction($ilCtrl->getFormAction($this));
1225 $cgui->setHeaderText(sprintf($this->
lng->txt(
"exc_peer_review_reset_sure"), $this->ass->getTitle()));
1226 $cgui->setCancel($this->
lng->txt(
"cancel"),
"showPeerReviewOverview");
1227 $cgui->setConfirm($this->
lng->txt(
"delete"),
"resetPeerReview");
1234 $ilCtrl = $this->ctrl;
1237 !$this->ass->getPeerReview()) {
1238 $this->returnToParentObject();
1242 $all_giver_ids = $peer_review->resetPeerReviews();
1244 if (is_array($all_giver_ids)) {
1247 if (
$exercise->isCompletionBySubmissionEnabled() &&
1249 foreach ($all_giver_ids as
$user_id) {
1251 $pgui =
new self($this->ass, $submission);
1252 $pgui->handlePeerReviewChange();
1257 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"exc_peer_review_reset_done"),
true);
1258 $ilCtrl->redirect($this,
"showPeerReviewOverview");
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const PEER_REVIEW_VALID_NONE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
downloadPeerReviewObject()
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
isValidPeer(int $a_peer_id)
confirmResetPeerReviewObject()
showReceivedPeerReviewObject()
string $requested_crit_id
ILIAS Notes Service $notes
showGivenPeerReviewObject()
ILIAS Exercise InternalDomainService $domain
__construct(ilExAssignment $a_ass, ?ilExSubmission $a_submission=null)
ILIAS Exercise Submission SubmissionManager $subm
observeMessageAction(int $giver_id, int $peer_id, int $note_id, string $action)
buildSubmissionPropertiesAndActions(\ILIAS\Exercise\Assignment\PropertyAndActionBuilderUI $builder)
initPeerReviewItemForm(int $a_peer_id)
getSubmissionContent(ilExSubmission $a_submission)
getSubPanel(string $title, array $props, ?ilMessageGUI $mess_gui=null)
ILIAS Exercise Notification NotificationManager $notification
showPeerReviewOverviewObject()
getPeerReviewReceiverPanel(ilExAssignment $ass, int $user_id, array $peer_data)
getMessagesGUI(int $giver_id, int $peer_id)
getReceivedFeedbackPanel(array $a_peer_items, bool $a_by_peer=false)
int $requested_review_peer_id
ilExSubmission $submission
ILIAS Exercise PeerReview Criteria CriteriaFileManager $criteria_file
int $requested_review_giver_id
ILIAS Exercise InternalGUIService $gui
ilGlobalPageTemplate $tpl
string $requested_review_crit_id
getLateSubmissionInfo(ilExSubmission $a_submission)
editPeerReviewItemObject(?ilPropertyFormGUI $a_form=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Exercise submission //TODO: This class has many static methods related to delivered "files".
static getInstanceByIds(int $a_ass_id, int $a_user_id=0)
static getInstanceById(int $a_id)
static getInstanceByType(string $a_type)
setContent(string $a_html)
Sets content for standard template.
setCurrentBlock(string $blockname=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $blockname=self::DEFAULT_BLOCK)
Parses the given block.
getOnLoadCodeForAsynch()
Get js onload code for ajax calls.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This class represents a non editable value in a property form.
static _lookupType(int $id, bool $reference=false)
static _replaceMediaObjectImageSrc(string $a_text, int $a_direction=0, string $nic='')
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
if(!file_exists('../ilias.ini.php'))