ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilExPeerReviewGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilExPeerReviewGUI:

Public Member Functions

 __construct (ilExAssignment $a_ass, ?ilExSubmission $a_submission=null)
 
 executeCommand ()
 
 returnToParentObject ()
 
 buildSubmissionPropertiesAndActions (\ILIAS\Exercise\Assignment\PropertyAndActionBuilderUI $builder)
 
 showGivenPeerReviewObject ()
 
 showReceivedPeerReviewObject ()
 
 editPeerReviewObject ()
 
 editPeerReviewItemObject (?ilPropertyFormGUI $a_form=null)
 
 observeMessageAction (int $giver_id, int $peer_id, int $note_id, string $action)
 
 updateCritAjaxObject ()
 
 updatePeerReviewObject ()
 
 downloadPeerReviewObject ()
 
 showPeerReviewOverviewObject ()
 
 confirmResetPeerReviewObject ()
 
 resetPeerReviewObject ()
 

Static Public Member Functions

static getOverviewContent (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 

Protected Member Functions

 canGive ()
 
 canView ()
 
 getReceivedFeedbackPanel (array $a_peer_items, bool $a_by_peer=false)
 
 getSubPanel (string $title, array $props, ?ilMessageGUI $mess_gui=null)
 
 getLateSubmissionInfo (ilExSubmission $a_submission)
 
 getPeerReviewReceiverPanel (ilExAssignment $ass, int $user_id, array $peer_data)
 
 getMessagesGUI (int $giver_id, int $peer_id)
 
 isValidPeer (int $a_peer_id)
 
 getSubmissionContent (ilExSubmission $a_submission)
 
 initPeerReviewItemForm (int $a_peer_id)
 
 handlePeerReviewChange ()
 

Protected Attributes

ILIAS Exercise PeerReview Criteria CriteriaFileManager $criteria_file
 
ILIAS Exercise Submission SubmissionManager $subm
 
int $requested_giver_id
 
ILIAS Exercise Notification NotificationManager $notification
 
ILIAS Notes Service $notes
 
ILIAS Exercise InternalGUIService $gui
 
ILIAS Exercise InternalDomainService $domain
 
ilCtrl $ctrl
 
ilTabsGUI $tabs_gui
 
ilLanguage $lng
 
ilGlobalPageTemplate $tpl
 
ilObjUser $user
 
ilExAssignment $ass
 
ilExSubmission $submission
 
int $requested_review_giver_id = 0
 
int $requested_review_peer_id = 0
 
string $requested_review_crit_id = ""
 
int $requested_peer_id = 0
 
string $requested_crit_id = ""
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilExPeerReviewGUI

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de @ilCtrl_Calls ilExPeerReviewGUI: ilRatingGUI, ilExSubmissionTextGUI, ilInfoScreenGUI @ilCtrl_Calls ilExPeerReviewGUI: ilMessageGUI

Definition at line 27 of file class.ilExPeerReviewGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilExPeerReviewGUI::__construct ( ilExAssignment  $a_ass,
?ilExSubmission  $a_submission = null 
)

Definition at line 49 of file class.ilExPeerReviewGUI.php.

52 {
53 global $DIC;
54
55 $service = $DIC->exercise()->internal();
56 $this->domain = $service->domain();
57 $this->gui = $service->gui();
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();
63
64 $this->ass = $a_ass;
65 $this->submission = $a_submission;
66
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());
80 }
$service
Definition: ltiresult.php:36
global $DIC
Definition: shib_login.php:26

References $DIC, $service, ILIAS\Repository\ctrl(), ilExAssignment\getId(), ILIAS\Repository\lng(), ILIAS\UI\examples\Symbol\Glyph\Notification\notification(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildSubmissionPropertiesAndActions()

ilExPeerReviewGUI::buildSubmissionPropertiesAndActions ( \ILIAS\Exercise\Assignment\PropertyAndActionBuilderUI  $builder)

Definition at line 259 of file class.ilExPeerReviewGUI.php.

259 : void
260 {
261 $f = $this->gui->ui()->factory();
263 $ilCtrl = $this->ctrl;
266 $state = $this->domain->assignment()->state($ass->getId(), $submission->getUserId());
267
268 $view_pc = "";
269 $edit_pc = "";
270
271
272 //if($ass->afterDeadlineStrict() &&
273 // $ass->getPeerReview())
274 if ($state->hasSubmissionEndedForAllUsers() &&
275 $ass->getPeerReview()) {
276 $ilCtrl->setParameterByClass("ilExPeerReviewGUI", "ass_id", $submission->getAssignment()->getId());
277
278 $nr_missing_fb = $submission->getPeerReview()->getNumberOfMissingFeedbacksForReceived();
279
280 $builder->addAdditionalHeadProperty(
281 $this->lng->txt("exc_given_feedback"),
282 $submission->getPeerReview()->countGivenFeedback() . " " .
283 $this->lng->txt("exc_x_of_y") . " " .
284 $submission->getAssignment()->getPeerReviewMin()
285 );
286
287 $builder->addAdditionalHeadProperty(
288 $this->lng->txt("exc_received_feedback"),
289 $submission->getPeerReview()->countReceivedFeedbacks($submission->getUserid())
290 );
291
292 // before deadline (if any)
293 // if(!$ass->getPeerReviewDeadline() ||
294 // $ass->getPeerReviewDeadline() > time())
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"),
299 $url
300 );
301 $builder->addView(
302 "give_feedback",
303 $this->lng->txt("exc_given_feedback"),
304 $url
305 );
306 $builder->setMainAction(
307 $builder::SEC_PEER_FEEDBACK,
308 $button
309 );
311 $deadline = $state->getPeerReviewDeadlinePresentation();
312 } else {
313 $deadline = $lng->txt("exc_no_peer_feedback_deadline");
314 }
315 $builder->addProperty(
316 $builder::SEC_PEER_FEEDBACK,
317 $lng->txt("exc_peer_review_deadline"),
318 $deadline
319 );
320 } elseif ($ass->getPeerReviewDeadline()) {
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")
326 );
327 }
329 $builder->addProperty(
330 $builder::SEC_SCHEDULE,
331 $lng->txt("exc_peer_review_deadline"),
332 $state->getPeerReviewDeadlinePresentation()
333 );
334 }
335
336 // after deadline (if any)
337 if ((!$ass->getPeerReviewDeadline() ||
338 $ass->getPeerReviewDeadline() < time())) {
339 // given peer review should be accessible at all times (read-only when not editable - see above)
341 $submission->getPeerReview()->countGivenFeedback(false)) {
342 $url = $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExPeerReviewGUI"), "showGivenPeerReview");
343 $link = $f->link()->standard(
344 $lng->txt("exc_peer_review_given"),
345 $url
346 );
347 $builder->addAction(
348 $builder::SEC_PEER_FEEDBACK,
349 $link
350 );
351 $builder->addView(
352 "give_feedback",
353 $this->lng->txt("exc_given_feedback"),
354 $url
355 );
356 }
357
358 if ($nr_missing_fb <= 0) {
359 // received any?
360 $received = (bool) sizeof($submission->getPeerReview()->getPeerReviewsByPeerId($submission->getUserId(), true));
361 if ($received) {
362 $url = $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExPeerReviewGUI"), "showReceivedPeerReview");
363 $link = $f->link()->standard(
364 $lng->txt("exc_peer_review_show"),
365 $url
366 );
367 $builder->addAction(
368 $builder::SEC_PEER_FEEDBACK,
369 $link
370 );
371 $builder->addView(
372 "receive_feedback",
373 $this->lng->txt("exc_received_feedback"),
374 $url
375 );
376 }
377 // received none
378 else {
379 $builder->addProperty(
380 $builder::SEC_PEER_FEEDBACK,
381 $lng->txt("exc_received_peer_feedback"),
382 $lng->txt("exc_peer_review_show_received_none")
383 );
384 }
385 }
386 // did not give enough
387 else {
388 $builder->addProperty(
389 $builder::SEC_PEER_FEEDBACK,
390 $lng->txt("exc_peer_feedback_status"),
391 $lng->txt("exc_peer_review_show_missing")
392 );
393 }
394 }
395 $ilCtrl->setParameterByClass("ilExPeerReviewGUI", "ass_id", "");
396 }
397 }
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...
$url
Definition: shib_logout.php:68

References Vendor\Package\$f, $lng, $url, ilExSubmission\getAssignment(), ilExAssignment\getId(), ilExAssignment\getPeerReview(), ilExSubmission\getPeerReview(), ilExAssignment\getPeerReviewDeadline(), ilExSubmission\getUserId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ canGive()

ilExPeerReviewGUI::canGive ( )
protected

Definition at line 399 of file class.ilExPeerReviewGUI.php.

399 : bool
400 {
401 return ($this->submission->isOwner() &&
402 $this->ass->afterDeadlineStrict() &&
403 (!$this->ass->getPeerReviewDeadline() ||
404 $this->ass->getPeerReviewDeadline() > time()));
405 }

◆ canView()

ilExPeerReviewGUI::canView ( )
protected

Definition at line 407 of file class.ilExPeerReviewGUI.php.

407 : bool
408 {
409 return ($this->submission->isTutor() ||
410 ($this->submission->isOwner() &&
411 $this->ass->afterDeadlineStrict() &&
412 (!$this->ass->getPeerReviewDeadline() ||
413 $this->ass->getPeerReviewDeadline() < time())));
414 }

◆ confirmResetPeerReviewObject()

ilExPeerReviewGUI::confirmResetPeerReviewObject ( )

Definition at line 1210 of file class.ilExPeerReviewGUI.php.

1210 : void
1211 {
1212 $ilCtrl = $this->ctrl;
1213 $tpl = $this->tpl;
1214 $ilTabs = $this->tabs_gui;
1215
1216 if (!$this->ass ||
1217 !$this->ass->getPeerReview()) {
1218 $this->returnToParentObject();
1219 }
1220
1221 $ilTabs->clearTargets();
1222
1223 $cgui = new ilConfirmationGUI();
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");
1228
1229 $tpl->setContent($cgui->getHTML());
1230 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalPageTemplate $tpl
setContent(string $a_html)
Sets content for standard template.

References ILIAS\Repository\lng(), and ilGlobalPageTemplate\setContent().

+ Here is the call graph for this function:

◆ downloadPeerReviewObject()

ilExPeerReviewGUI::downloadPeerReviewObject ( )

Definition at line 1127 of file class.ilExPeerReviewGUI.php.

1127 : void
1128 {
1129 $ilCtrl = $this->ctrl;
1130
1131 if (!$this->canView() &&
1132 !$this->canGive()) {
1133 $this->returnToParentObject();
1134 }
1135
1139 if (!is_numeric($crit_id)) {
1140 $crit = ilExcCriteria::getInstanceByType($crit_id);
1141 $file_crit_id = 0;
1142 } else {
1143 $crit = ilExcCriteria::getInstanceById($crit_id);
1144 $file_crit_id = $crit_id;
1145 }
1146
1147 $crit->setPeerReviewContext($this->ass, $giver_id, $peer_id);
1148 $file = $crit->getFileByHash();
1149 if ($file) {
1150 $this->criteria_file->deliverFileOfReview(
1151 $giver_id,
1152 $peer_id,
1153 $file_crit_id
1154 );
1155 }
1156
1157 $ilCtrl->redirect($this, "returnToParent");
1158 }
static getInstanceById(int $a_id)
static getInstanceByType(string $a_type)

References ilExcCriteria\getInstanceById(), and ilExcCriteria\getInstanceByType().

+ Here is the call graph for this function:

◆ editPeerReviewItemObject()

ilExPeerReviewGUI::editPeerReviewItemObject ( ?ilPropertyFormGUI  $a_form = null)

Definition at line 810 of file class.ilExPeerReviewGUI.php.

812 : void {
814
815 $this->tabs_gui->activateTab("give_feedback");
816
817 if (!$this->canGive() && $this->canView()) {
818 $this->ctrl->redirectByClass(self::class, "showGivenPeerReview");
819 }
820
821 if (!$this->canGive() ||
822 !$this->isValidPeer($this->requested_peer_id)) {
823 $this->returnToParentObject();
824 }
825
826 if ($a_form === null) {
827 $a_form = $this->initPeerReviewItemForm($this->requested_peer_id);
828 }
829
830 $sep = $this->gui->ui()->renderer()->render($this->gui->ui()->factory()->divider()->horizontal());
831 $peer_state = ilExcAssMemberState::getInstanceByIds($this->ass->getId(), $this->requested_peer_id);
832 $message_html = "";
833
834 // show only message gui, if peer is able to access received feedback
835 if ($peer_state->isReceivedFeedbackAccessible()) {
836 $message_gui = $this->getMessagesGUI(
837 $this->user->getId(),
838 $this->requested_peer_id
839 );
840 $message_html = $sep . $message_gui->getListHTML();
841 }
842
843 $this->gui->permanentLink()->setGivenFeedbackPermanentLink();
844
845 $tpl->setContent($a_form->getHTML() . $message_html);
846 }
initPeerReviewItemForm(int $a_peer_id)
getMessagesGUI(int $giver_id, int $peer_id)
static getInstanceByIds(int $a_ass_id, int $a_user_id=0)

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ editPeerReviewObject()

ilExPeerReviewGUI::editPeerReviewObject ( )
Exceptions
ilDateTimeException

Definition at line 680 of file class.ilExPeerReviewGUI.php.

680 : void
681 {
683
684 $this->tabs_gui->activateTab("give_feedback");
685 if (!$this->canGive()) {
686 $this->returnToParentObject();
687 }
688
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();
693 }
694
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));
700 } else {
701 $this->tpl->setOnScreenMessage('info', sprintf(
702 $this->lng->txt("exc_peer_review_missing_info_deadline"),
703 $missing,
705 ));
706 }
707 }
708
709 $panel = $this->getPeerReviewReceiverPanel(
710 $this->ass,
711 $this->submission->getUserId(),
712 $peer_items
713 );
714 $tpl->setContent($this->gui->ui()->renderer()->render($panel));
715 }
const IL_CAL_UNIX
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
getPeerReviewReceiverPanel(ilExAssignment $ass, int $user_id, array $peer_data)

References ilDatePresentation\formatDate(), IL_CAL_UNIX, ILIAS\Repository\lng(), and ilGlobalPageTemplate\setContent().

+ Here is the call graph for this function:

◆ executeCommand()

ilExPeerReviewGUI::executeCommand ( )
Exceptions
ilCtrlException

Definition at line 85 of file class.ilExPeerReviewGUI.php.

85 : void
86 {
87 $ilCtrl = $this->ctrl;
89 $ilTabs = $this->tabs_gui;
90
91 if (!$this->ass->getPeerReview()) {
92 $this->returnToParentObject();
93 }
94
95 $class = $ilCtrl->getNextClass($this);
96 $cmd = $ilCtrl->getCmd("showpeerreviewoverview");
97
98 switch ($class) {
99
100 case "ilratinggui":
101 $peer_review = new ilExPeerReview($this->ass);
102 $peer_review->updatePeerReviewTimestamp($this->requested_peer_id);
103
104 $rating_gui = new ilRatingGUI();
105 $rating_gui->setObject(
106 $this->ass->getId(),
107 "ass",
108 $this->requested_peer_id,
109 "peer"
110 );
111 $this->ctrl->forwardCommand($rating_gui);
112 $ilCtrl->redirect($this, "editPeerReview");
113 break;
114
115 case "ilexsubmissiontextgui":
116 $ilTabs->clearTargets();
117 if (!$this->submission->isTutor()) {
118 $ilTabs->setBackTarget(
119 $lng->txt("back"),
120 $ilCtrl->getLinkTarget($this, "editPeerReview")
121 );
122 $this->ctrl->setReturn($this, "editPeerReview");
123 } else {
124 $ilTabs->setBackTarget(
125 $lng->txt("back"),
126 $ilCtrl->getLinkTarget($this, "showGivenPeerReview")
127 );
128 $this->ctrl->setReturn($this, "showGivenPeerReview");
129 }
130 $gui = new ilExSubmissionTextGUI(new ilObjExercise($this->ass->getExerciseId(), false), $this->submission);
131 $ilCtrl->forwardCommand($gui);
132 break;
133
134 case "ilmessagegui":
135 $gui = $this->getMessagesGUI(
136 $this->requested_giver_id,
137 $this->requested_peer_id
138 );
139 $ilCtrl->forwardCommand($gui);
140 break;
141
142 default:
143 $this->{$cmd . "Object"}();
144 break;
145 }
146 }
ILIAS Exercise InternalGUIService $gui
Exercise peer review.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjExercise.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $ctrl, $gui, $lng, $tabs_gui, ILIAS\Repository\ctrl(), getMessagesGUI(), returnToParentObject(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getLateSubmissionInfo()

ilExPeerReviewGUI::getLateSubmissionInfo ( ilExSubmission  $a_submission)
protected

Definition at line 663 of file class.ilExPeerReviewGUI.php.

665 : string {
667
668 // #18966 - late files info
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>';
672 }
673 }
674 return "";
675 }

References $lng.

◆ getMessagesGUI()

ilExPeerReviewGUI::getMessagesGUI ( int  $giver_id,
int  $peer_id 
)
protected

Definition at line 848 of file class.ilExPeerReviewGUI.php.

849 {
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(
854 $peer_id,
855 $this->ass->getExerciseId(),
856 $pr->getReviewId($giver_id, $peer_id),
857 "excpf"
858 );
859 if (!$this->ass->hasPeerReviewPersonalized()) {
860 if ($giver_id === $this->user->getId()) {
861 $counterpart_name = $this->lng->txt("exc_peer_review_recipient");
862 } else {
863 $counterpart_name = $this->lng->txt("exc_peer_review_giver");
864 }
865 $gui->setAnonymised(true, $counterpart_name);
866 }
867
868 $gui->addObserver(function (
869 int $exc_id,
870 int $pf_id,
871 string $type,
872 string $action,
873 int $note_id
874 ) use ($giver_id, $peer_id) {
876 $giver_id,
877 $peer_id,
878 $note_id,
879 $action
880 );
881 });
882
883 return $gui;
884 }
observeMessageAction(int $giver_id, int $peer_id, int $note_id, string $action)

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOverviewContent()

static ilExPeerReviewGUI::getOverviewContent ( ilInfoScreenGUI  $a_info,
ilExSubmission  $a_submission 
)
static
Exceptions
ilDateTimeException

Definition at line 156 of file class.ilExPeerReviewGUI.php.

159 : void {
160 global $DIC;
161
162 $lng = $DIC->language();
163 $ilCtrl = $DIC->ctrl();
164 $gui = $DIC->exercise()
165 ->internal()
166 ->gui();
167
168 $state = ilExcAssMemberState::getInstanceByIds($a_submission->getAssignment()->getId(), $a_submission->getUserId());
169
170 $ass = $a_submission->getAssignment();
171
172 $view_pc = "";
173 $edit_pc = "";
174
175
176 //if($ass->afterDeadlineStrict() &&
177 // $ass->getPeerReview())
178 if ($state->hasSubmissionEndedForAllUsers() &&
179 $ass->getPeerReview()) {
180 $ilCtrl->setParameterByClass("ilExPeerReviewGUI", "ass_id", $a_submission->getAssignment()->getId());
181
182 $nr_missing_fb = $a_submission->getPeerReview()->getNumberOfMissingFeedbacksForReceived();
183
184 // before deadline (if any)
185 // if(!$ass->getPeerReviewDeadline() ||
186 // $ass->getPeerReviewDeadline() > time())
187 if ($state->isPeerReviewAllowed()) {
188 $dl_info = "";
190 $dl_info = " (" . sprintf(
191 $lng->txt("exc_peer_review_deadline_info_button"),
192 $state->getPeerReviewDeadlinePresentation()
193 ) . ")";
194 }
195
196 $b = $gui->link(
197 $lng->txt("exc_peer_review_give"),
198 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExPeerReviewGUI"), "editPeerReview")
199 )->emphasised();
200 if ($nr_missing_fb) {
201 $b = $b->primary();
202 }
203 $edit_pc = $b->render();
204 } elseif ($ass->getPeerReviewDeadline()) {
205 $edit_pc = $lng->txt("exc_peer_review_deadline_reached");
206 }
207
208 // after deadline (if any)
209 if ((!$ass->getPeerReviewDeadline() ||
210 $ass->getPeerReviewDeadline() < time())) {
211 // given peer review should be accessible at all times (read-only when not editable - see above)
213 $a_submission->getPeerReview()->countGivenFeedback(false)) {
214 $b = $gui->link(
215 $lng->txt("exc_peer_review_given"),
216 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExPeerReviewGUI"), "showGivenPeerReview")
217 )->emphasised();
218 $view_pc = $b->render() . " ";
219 }
220
221 // did give enough feedback
222 if (!$nr_missing_fb) {
223 // received any?
224 $received = (bool) sizeof($a_submission->getPeerReview()->getPeerReviewsByPeerId($a_submission->getUserId(), true));
225 if ($received) {
226 $b = $gui->link(
227 $lng->txt("exc_peer_review_show"),
228 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExPeerReviewGUI"), "showReceivedPeerReview")
229 )->emphasised();
230 $view_pc .= $b->render();
231 }
232 // received none
233 else {
234 $view_pc .= $lng->txt("exc_peer_review_show_received_none");
235 }
236 }
237 // did not give enough
238 else {
239 $view_pc .= $lng->txt("exc_peer_review_show_missing");
240 }
241 }
242 /* must give before showing received
243 else
244 {
245 $view_pc = $lng->txt("exc_peer_review_show_not_rated_yet");
246 }
247 */
248
249 $sep = ($edit_pc != "" && $view_pc != "")
250 ? "<br><br>"
251 : "";
252
253 $a_info->addProperty($lng->txt("exc_peer_review"), $edit_pc . $sep . $view_pc);
254
255 $ilCtrl->setParameterByClass("ilExPeerReviewGUI", "ass_id", "");
256 }
257 }
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section

◆ getPeerReviewReceiverPanel()

ilExPeerReviewGUI::getPeerReviewReceiverPanel ( ilExAssignment  $ass,
int  $user_id,
array  $peer_data 
)
protected

Definition at line 717 of file class.ilExPeerReviewGUI.php.

722 $personal = $ass->hasPeerReviewPersonalized();
723 $f = $this->gui->ui()->factory();
725 $items = [];
726 foreach ($peer_data as $item) {
727 $row = array();
728
729 if (\ilObject::_lookupType($item["peer_id"]) !== "usr") {
730 continue;
731 }
732
733 $row["giver_id"] = $item["giver_id"];
734 $row["peer_id"] = $item["peer_id"];
735 $row["tstamp"] = $item["tstamp"];
736
737 if (!$personal) {
738 $row["seq"] = $item["seq"];
739 } else {
740 $row["name"] = ilUserUtil::getNamePresentation($item["peer_id"]);
741 }
742
743 // validate
744 $row["valid"] = $all_empty = true;
745 $submission = new ilExSubmission($ass, $item["peer_id"]);
746 $values = $submission->getPeerReview()->getPeerReviewValues($item["giver_id"], $item["peer_id"]);
747 foreach ($this->ass->getPeerReviewCriteriaCatalogueItems() as $crit) {
748 $crit_id = $crit->getId()
749 ? $crit->getId()
750 : $crit->getType();
751 $crit->setPeerReviewContext(
752 $this->ass,
753 $item["giver_id"],
754 $item["peer_id"]
755 );
756 if (!$crit->validate($values[$crit_id] ?? null)) {
757 $row["valid"] = false;
758 }
759 if ($crit->hasValue($values[$crit_id] ?? null)) {
760 $all_empty = false;
761 }
762 }
763 if ($all_empty) {
764 $row["valid"] = false;
765 }
766 if (!$row["valid"]) {
767 // $this->invalid++;
768 }
769
770 $ilCtrl = $this->ctrl;
771
772 if (isset($row["seq"])) {
773 $title = $this->lng->txt("exc_peer_review_recipient") . " " . $row["seq"];
774 } else {
775 $title = $row["name"];
776 }
777
778 if ($row["tstamp"]) {
779 $row["tstamp"] = ilDatePresentation::formatDate(new ilDateTime($row["tstamp"], IL_CAL_DATETIME));
780 }
781 $props = [];
782 $props[$lng->txt("last_update")] = $row["tstamp"];
783
784 $props[$lng->txt("valid")] = $row["valid"]
785 ? $this->lng->txt("yes")
786 : $this->lng->txt("no");
787
788 $ilCtrl->setParameter($this, "peer_id", $row["peer_id"]);
789 $actions = [
790 $f->button()->shy(
791 $this->lng->txt("edit"),
792 $ilCtrl->getLinkTarget($this, "editPeerReviewItem")
793 )
794 ];
795 $ilCtrl->setParameter($this, "pid", "");
796
797 $items[] = $f->item()->standard(
798 $title
799 )->withProperties($props)
800 ->withActions($f->dropdown()->standard($actions));
801 }
802
803 $group = $f->item()->group("", $items);
804 return $f->panel()->listing()->standard(
805 $this->lng->txt("exc_peer_review_give"),
806 [$group]
807 );
808 }
const IL_CAL_DATETIME
Exercise submission //TODO: This class has many static methods related to delivered "files".
static _lookupType(int $id, bool $reference=false)
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:
This describes a Standard Dropdown.
Definition: Standard.php:27

References Vendor\Package\$f, $lng, ilObject\_lookupType(), ilDatePresentation\formatDate(), ilUserUtil\getNamePresentation(), ilExSubmission\getPeerReview(), IL_CAL_DATETIME, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getReceivedFeedbackPanel()

ilExPeerReviewGUI::getReceivedFeedbackPanel ( array  $a_peer_items,
bool  $a_by_peer = false 
)
protected

Definition at line 489 of file class.ilExPeerReviewGUI.php.

494
495 $sub_panels = [];
496 if ($this->submission->isTutor()) {
497 $props = [];
498 $user_title = $a_by_peer
499 ? $lng->txt("exc_peer_review_recipient")
500 : $lng->txt("exc_peer_review_giver");
501 $props[] = [
502 "prop" => $lng->txt("name"),
503 "value" => ilUserUtil::getNamePresentation($this->submission->getUserId(), false, false, "", true)
504 ];
505 $sub_panels[] = $this->getSubPanel(
506 $user_title,
507 $props
508 );
509 }
510
511 if ($a_by_peer) {
512
513 // list received feedbacks
514
515 // submission
516 $props = [];
517 $submission = new ilExSubmission($this->ass, $this->submission->getUserId());
518 $file_info = $submission->getDownloadedFilesInfoForTableGUIS();
519
520 $props[] = [
521 "prop" => $file_info["last_submission"]["txt"],
522 "value" => $file_info["last_submission"]["value"] .
524 ];
525
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>';
529 } else {
530 $sub_data = $this->gui->html()->escapeCurly($sub_data);
531 }
532 $props[] = [
533 "prop" => $lng->txt("exc_submission"),
534 "value" => $sub_data
535 ];
536
537 $sub_panels[] = $this->getSubPanel(
538 $lng->txt("exc_your_submission"),
539 $props
540 );
541 }
542
543 foreach ($a_peer_items as $peer) {
544 $props = [];
545 if (!$a_by_peer) {
546 $giver_id = $this->submission->getUserId();
547 $peer_id = $peer["peer_id"];
548 $id_title = $lng->txt("exc_peer_review_recipient");
549 $user_id = $peer_id;
550 } else {
551
552 // list received feedbacks
553
554 $giver_id = $peer["giver_id"];
555 $peer_id = $this->submission->getUserId();
556 $id_title = $lng->txt("exc_peer_review_giver");
557 $user_id = $giver_id;
558 }
559
560 // peer info
561 if ($this->submission->isTutor()) {
562 $id_value = ilUserUtil::getNamePresentation($user_id, "", "", false, true);
563 } elseif (!$this->ass->hasPeerReviewPersonalized()) {
564 $id_value = $peer["seq"];
565 } else {
567 }
568
569 $mess_gui = $this->getMessagesGUI(
570 $giver_id,
571 $peer_id
572 );
573
574 // submission info
575
576 if (!$a_by_peer) {
577 $submission = new ilExSubmission($this->ass, $peer_id);
578 $file_info = $submission->getDownloadedFilesInfoForTableGUIS();
579
580 $props[] = [
581 "prop" => $file_info["last_submission"]["txt"],
582 "value" => $file_info["last_submission"]["value"] .
584 ];
585
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>';
590 }
591 } else {
592 $sub_data = $this->gui->html()->escapeCurly($sub_data);
593 }
594 $props[] = [
595 "prop" => $lng->txt("exc_submission"),
596 "value" => $sub_data
597 ];
598 }
599
600
601 // peer review items
602
603 $values = $this->submission->getPeerReview()->getPeerReviewValues($giver_id, $peer_id);
604
605 foreach ($this->ass->getPeerReviewCriteriaCatalogueItems() as $item) {
606 $crit_id = $item->getId()
607 ? $item->getId()
608 : $item->getType();
609
610 $item->setPeerReviewContext(
611 $this->ass,
612 $giver_id,
613 $peer_id
614 );
615
616 $title = $item->getTitle();
617 $html = $item->getHTML($values[$crit_id] ?? null);
618 $props[] = [
619 "prop" => $title ?: "&nbsp;",
620 "value" => $html ?: "&nbsp;"
621 ];
622 }
623 $sub_panels[] = $this->getSubPanel(
624 $id_title . ": " . $id_value,
625 $props,
626 $mess_gui
627 );
628 }
629 return $this->gui->ui()->factory()->panel()->standard(
630 $a_by_peer
631 ? $this->lng->txt("exc_received_feedback")
632 : $this->lng->txt("exc_given_feedback"),
633 $sub_panels
634 );
635 }
getSubmissionContent(ilExSubmission $a_submission)
getSubPanel(string $title, array $props, ?ilMessageGUI $mess_gui=null)
getLateSubmissionInfo(ilExSubmission $a_submission)

References $lng, and ilUserUtil\getNamePresentation().

+ Here is the call graph for this function:

◆ getSubmissionContent()

ilExPeerReviewGUI::getSubmissionContent ( ilExSubmission  $a_submission)
protected

Definition at line 926 of file class.ilExPeerReviewGUI.php.

928 : string {
929 if ($this->ass->getType() != ilExAssignment::TYPE_TEXT) {
930 return "";
931 }
932
933 $sub = $this->subm->getSubmissionsOfUser($a_submission->getUserId())->current();
934 if ($sub) {
935 if (trim($sub->getText()) !== '' && trim($sub->getText()) !== '0') {
936 // mob id to mob src
937 return nl2br(ilRTE::_replaceMediaObjectImageSrc($sub->getText(), 1));
938 }
939 }
940 return "";
941 }
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...

◆ getSubPanel()

ilExPeerReviewGUI::getSubPanel ( string  $title,
array  $props,
?ilMessageGUI  $mess_gui = null 
)
protected

Definition at line 637 of file class.ilExPeerReviewGUI.php.

642 $f = $this->gui->ui()->factory();
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) {
646 $tpl->setCurrentBlock("entry");
647 $tpl->setVariable("LABEL", $prop["prop"]);
648 $tpl->setVariable("VALUE", $prop["value"]);
650 }
651 $mess_html = "";
652 if ($mess_gui) {
653 $mess_html = $r->render($f->divider()->horizontal()) .
654 $mess_gui->getWidget();
655 }
656
657 return $f->panel()->sub(
658 $title,
659 $f->legacy()->content($tpl->get() . $mess_html)
660 );
661 }
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.
This describes a Sub Panel.
Definition: Sub.php:30

◆ handlePeerReviewChange()

ilExPeerReviewGUI::handlePeerReviewChange ( )
protected

Definition at line 1115 of file class.ilExPeerReviewGUI.php.

1115 : void
1116 {
1117 // (in)valid peer reviews could change assignment status
1118 $exercise = new ilObjExercise($this->ass->getExerciseId(), false);
1119 $exercise->processExerciseStatus(
1120 $this->ass,
1121 $this->submission->getUserIds(),
1122 $this->submission->hasSubmitted(),
1123 $this->submission->validatePeerReviews()
1124 );
1125 }

References $exercise.

◆ initPeerReviewItemForm()

ilExPeerReviewGUI::initPeerReviewItemForm ( int  $a_peer_id)
protected
Exceptions
ilDateTimeException

Definition at line 946 of file class.ilExPeerReviewGUI.php.

949 $ilCtrl = $this->ctrl;
951
952 // get peer data
953 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
954 $peer = [];
955 foreach ($peer_items as $item) {
956 if ($item["peer_id"] == $a_peer_id) {
957 $peer = $item;
958 break;
959 }
960 }
961
962 $ilCtrl->saveParameter($this, "peer_id");
963
964 $form = new ilPropertyFormGUI();
965 $form->setFormAction($ilCtrl->getFormAction($this, "updatePeerReview"));
966
967 $form->setTitle($this->ass->getTitle() . ": " . $lng->txt("exc_peer_review_give"));
968
969 // peer info
970 if (!$this->ass->hasPeerReviewPersonalized()) {
971 $id_title = $lng->txt("id");
972 $id_value = $peer["seq"];
973 } else {
974 $id_title = $lng->txt("exc_peer_review_recipient");
975 $id_value = ilUserUtil::getNamePresentation($peer["peer_id"]);
976 }
977 $id = new ilNonEditableValueGUI($id_title);
978 $id->setValue($id_value);
979 $form->addItem($id);
980
981 // submission info
982
983 $submission = new ilExSubmission($this->ass, $peer["peer_id"]);
984 $file_info = $submission->getDownloadedFilesInfoForTableGUIS();
985
986 $last_sub = new ilNonEditableValueGUI($file_info["last_submission"]["txt"], "", true);
987 $last_sub->setValue($file_info["last_submission"]["value"] .
989 $form->addItem($last_sub);
990
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>';
994 } else {
995 $sub_data = $this->gui->html()->escapeCurly($sub_data);
996 }
997
998 $sub = new ilNonEditableValueGUI($lng->txt("exc_submission"), "", true);
999 $sub->setValue($sub_data);
1000 $form->addItem($sub);
1001
1002 // peer review items
1003
1004 $input = new ilFormSectionHeaderGUI();
1005 $input->setTitle($lng->txt("exc_peer_review"));
1006 $form->addItem($input);
1007
1008 $values = $this->submission->getPeerReview()->getPeerReviewValues($this->submission->getUserId(), $a_peer_id);
1009 // the values only contain text/selection values not files
1010
1011 foreach ($this->ass->getPeerReviewCriteriaCatalogueItems() as $item) {
1012 $crit_id = $item->getId()
1013 ? $item->getId()
1014 : $item->getType();
1015
1016 $item->setPeerReviewContext(
1017 $this->ass,
1018 $this->submission->getUserId(),
1019 $peer["peer_id"],
1020 $form
1021 );
1022 $item->addToPeerReviewForm($values[$crit_id] ?? null);
1023 }
1024
1025 $form->addCommandButton("updatePeerReview", $lng->txt("save"));
1026 $form->addCommandButton("editPeerReview", $lng->txt("cancel"));
1027
1028 return $form;
1029 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This class represents a section header in a property form.
This class represents a non editable value in a property form.
This class represents a property form user interface.

◆ isValidPeer()

ilExPeerReviewGUI::isValidPeer ( int  $a_peer_id)
protected

Definition at line 915 of file class.ilExPeerReviewGUI.php.

915 : bool
916 {
917 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
918 foreach ($peer_items as $item) {
919 if ($item["peer_id"] == $a_peer_id) {
920 return true;
921 }
922 }
923 return false;
924 }

◆ observeMessageAction()

ilExPeerReviewGUI::observeMessageAction ( int  $giver_id,
int  $peer_id,
int  $note_id,
string  $action 
)

Definition at line 886 of file class.ilExPeerReviewGUI.php.

891 : void {
892 if ($action !== "new") {
893 return;
894 }
895 $note = $this->notes->domain()->getById($note_id);
896 $text = $note->getText();
897
898 if ($note->getAuthor() === $giver_id) {
899 $this->notification->sendMessageFromPeerfeedbackGiverNotification(
900 $this->ass->getId(),
901 $peer_id,
902 $text
903 );
904 } else {
905 $this->notification->sendMessageFromPeerfeedbackRecipientNotification(
906 $this->ass->getId(),
907 $peer_id,
908 $giver_id,
909 $text
910 );
911 }
912 }

◆ resetPeerReviewObject()

ilExPeerReviewGUI::resetPeerReviewObject ( )

Definition at line 1232 of file class.ilExPeerReviewGUI.php.

1232 : void
1233 {
1234 $ilCtrl = $this->ctrl;
1235
1236 if (!$this->ass ||
1237 !$this->ass->getPeerReview()) {
1238 $this->returnToParentObject();
1239 }
1240
1241 $peer_review = new ilExPeerReview($this->ass);
1242 $all_giver_ids = $peer_review->resetPeerReviews();
1243
1244 if (is_array($all_giver_ids)) {
1245 // if peer review is valid for completion, we have to re-calculate all assignment members
1246 $exercise = new ilObjExercise($this->ass->getExerciseId(), false);
1247 if ($exercise->isCompletionBySubmissionEnabled() &&
1248 $this->ass->getPeerReviewValid() != ilExAssignment::PEER_REVIEW_VALID_NONE) {
1249 foreach ($all_giver_ids as $user_id) {
1250 $submission = new ilExSubmission($this->ass, $user_id);
1251 $pgui = new self($this->ass, $submission);
1252 $pgui->handlePeerReviewChange();
1253 }
1254 }
1255 }
1256
1257 $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_peer_review_reset_done"), true);
1258 $ilCtrl->redirect($this, "showPeerReviewOverview");
1259 }

References $exercise, $user_id, ILIAS\Repository\lng(), and ilExAssignment\PEER_REVIEW_VALID_NONE.

+ Here is the call graph for this function:

◆ returnToParentObject()

ilExPeerReviewGUI::returnToParentObject ( )

Definition at line 148 of file class.ilExPeerReviewGUI.php.

148 : void
149 {
150 $this->ctrl->returnToParent($this);
151 }

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showGivenPeerReviewObject()

ilExPeerReviewGUI::showGivenPeerReviewObject ( )
Exceptions
ilObjectNotFoundException
ilCtrlException
ilDatabaseException
ilDateTimeException

Definition at line 422 of file class.ilExPeerReviewGUI.php.

422 : void
423 {
426
427 $this->tabs_gui->activateTab("give_feedback");
428
429 if (!$this->canView()) {
430 $this->returnToParentObject();
431 }
432
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();
437 }
438
439 $tpl->setTitle($this->ass->getTitle() . ": " . $lng->txt("exc_peer_review_given"));
440
441 $this->gui->permanentLink()->setGivenFeedbackPermanentLink();
442
443 $panel = $this->getReceivedFeedbackPanel($peer_items);
444
445 $tpl->setContent($this->gui->ui()->renderer()->render($panel));
446 }
getReceivedFeedbackPanel(array $a_peer_items, bool $a_by_peer=false)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.

References $lng, ILIAS\Repository\lng(), ilGlobalPageTemplate\setContent(), and ilGlobalPageTemplate\setTitle().

+ Here is the call graph for this function:

◆ showPeerReviewOverviewObject()

ilExPeerReviewGUI::showPeerReviewOverviewObject ( )

Definition at line 1166 of file class.ilExPeerReviewGUI.php.

1166 : void
1167 {
1168 $tpl = $this->tpl;
1169
1170 if (!$this->ass ||
1171 !$this->ass->getPeerReview()) {
1172 $this->returnToParentObject();
1173 }
1174
1176 $this,
1177 "showPeerReviewOverview",
1178 $this->ass
1179 );
1180
1181 $panel = "";
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();
1190 }
1191
1192 $ptpl->setCurrentBlock("item_bl");
1193 $ptpl->setVariable("TITLE", $item["title"]);
1194 $ptpl->parseCurrentBlock();
1195 }
1196
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())
1202 );
1203
1204 $panel = $r->render($p);
1205 }
1206
1207 $tpl->setContent($tbl->getHTML() . $panel);
1208 }
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

References Vendor\Package\$f, ILIAS\Repository\lng(), and ilGlobalPageTemplate\setContent().

+ Here is the call graph for this function:

◆ showReceivedPeerReviewObject()

ilExPeerReviewGUI::showReceivedPeerReviewObject ( )
Exceptions
ilObjectNotFoundException
ilCtrlException
ilDatabaseException
ilDateTimeException

Definition at line 454 of file class.ilExPeerReviewGUI.php.

454 : void
455 {
456 $ilCtrl = $this->ctrl;
459 $this->tabs_gui->activateTab("receive_feedback");
460
461 if (!$this->canView() ||
462 (!$this->submission->isTutor() &&
463 $this->submission->getPeerReview()->getNumberOfMissingFeedbacksForReceived())) {
464 $this->returnToParentObject();
465 }
466
467 $this->gui->permanentLink()->setReceivedFeedbackPermanentLink();
468
469 /*
470 $this->tabs_gui->clearTargets();
471 $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, "returnToParent"));*/
472
473 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByPeerId($this->submission->getUserId(), !$this->submission->isTutor());
474 if ($peer_items === []) {
475 // #11373
476 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("exc_peer_review_no_peers_reviewed_yet"), true);
477 $ilCtrl->redirect($this, "returnToParent");
478 }
479
480 $tpl->setTitle($this->ass->getTitle() . ": " . $lng->txt("exc_peer_review_show"));
481
482 $info_widget = new ilInfoScreenGUI($this);
483
484 $panel = $this->getReceivedFeedbackPanel($peer_items, true);
485
486 $tpl->setContent($this->gui->ui()->renderer()->render($panel));
487 }
Class ilInfoScreenGUI.

References $lng, ILIAS\Repository\lng(), ilGlobalPageTemplate\setContent(), and ilGlobalPageTemplate\setTitle().

+ Here is the call graph for this function:

◆ updateCritAjaxObject()

ilExPeerReviewGUI::updateCritAjaxObject ( )

Definition at line 1031 of file class.ilExPeerReviewGUI.php.

1031 : void
1032 {
1033 $ilCtrl = $this->ctrl;
1034 $ilUser = $this->user;
1035 $tpl = $this->tpl;
1036
1037 if (!$this->canGive() ||
1038 !$this->requested_peer_id ||
1039 !$this->requested_crit_id ||
1040 !$ilCtrl->isAsynch()) {
1041 exit();
1042 }
1043
1044 $peer_id = $this->requested_peer_id;
1045 $crit_id = $this->requested_crit_id;
1046 $giver_id = $ilUser->getId();
1047
1048 if (!is_numeric($crit_id)) {
1049 $crit = ilExcCriteria::getInstanceByType($crit_id);
1050 } else {
1051 $crit = ilExcCriteria::getInstanceById($crit_id);
1052 }
1053 $crit->setPeerReviewContext($this->ass, $giver_id, $peer_id);
1054 $html = $crit->updateFromAjax();
1055
1056 $this->handlePeerReviewChange();
1057
1058 echo $html;
1060 exit();
1061 }
getOnLoadCodeForAsynch()
Get js onload code for ajax calls.
exit

References exit, ilExcCriteria\getInstanceById(), ilExcCriteria\getInstanceByType(), and ilGlobalPageTemplate\getOnLoadCodeForAsynch().

+ Here is the call graph for this function:

◆ updatePeerReviewObject()

ilExPeerReviewGUI::updatePeerReviewObject ( )

Definition at line 1063 of file class.ilExPeerReviewGUI.php.

1063 : void
1064 {
1065 $lng = $this->lng;
1066 $ilCtrl = $this->ctrl;
1067
1068 if (!$this->canGive() ||
1069 !$this->isValidPeer($this->requested_peer_id)) {
1070 $this->returnToParentObject();
1071 }
1072
1073 $peer_id = $this->requested_peer_id;
1074
1075 $form = $this->initPeerReviewItemForm($peer_id);
1076 if ($form->checkInput()) {
1077 $valid = true;
1078
1079 $values = array();
1080 foreach ($this->ass->getPeerReviewCriteriaCatalogueItems() as $item) {
1081 $item->setPeerReviewContext(
1082 $this->ass,
1083 $this->submission->getUserId(),
1084 $peer_id,
1085 $form
1086 );
1087 $value = $item->importFromPeerReviewForm();
1088 if ($value !== null) {
1089 $crit_id = $item->getId()
1090 ? $item->getId()
1091 : $item->getType();
1092 $values[$crit_id] = $value;
1093 }
1094 if (!$item->validate($value)) {
1095 $valid = false;
1096 }
1097 }
1098
1099 if ($valid) {
1100 $this->submission->getPeerReview()->updatePeerReview($peer_id, $values);
1101
1102 $this->handlePeerReviewChange();
1103
1104 $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_peer_review_updated"), true);
1105 $ilCtrl->redirect($this, "editPeerReview");
1106 } else {
1107 $this->tpl->setOnScreenMessage('failure', $lng->txt("form_input_not_valid"));
1108 }
1109 }
1110
1111 $form->setValuesByPost();
1112 $this->editPeerReviewItemObject($form);
1113 }
editPeerReviewItemObject(?ilPropertyFormGUI $a_form=null)
$valid

References $lng, $valid, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Field Documentation

◆ $ass

ilExAssignment ilExPeerReviewGUI::$ass
protected

Definition at line 41 of file class.ilExPeerReviewGUI.php.

◆ $criteria_file

ILIAS Exercise PeerReview Criteria CriteriaFileManager ilExPeerReviewGUI::$criteria_file
protected

Definition at line 29 of file class.ilExPeerReviewGUI.php.

◆ $ctrl

ilCtrl ilExPeerReviewGUI::$ctrl
protected

Definition at line 36 of file class.ilExPeerReviewGUI.php.

Referenced by executeCommand().

◆ $domain

ILIAS Exercise InternalDomainService ilExPeerReviewGUI::$domain
protected

Definition at line 35 of file class.ilExPeerReviewGUI.php.

◆ $gui

ILIAS Exercise InternalGUIService ilExPeerReviewGUI::$gui
protected

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

Referenced by executeCommand().

◆ $lng

ilLanguage ilExPeerReviewGUI::$lng
protected

Definition at line 38 of file class.ilExPeerReviewGUI.php.

Referenced by executeCommand().

◆ $notes

ILIAS Notes Service ilExPeerReviewGUI::$notes
protected

Definition at line 33 of file class.ilExPeerReviewGUI.php.

◆ $notification

ILIAS Exercise Notification NotificationManager ilExPeerReviewGUI::$notification
protected

Definition at line 32 of file class.ilExPeerReviewGUI.php.

◆ $requested_crit_id

string ilExPeerReviewGUI::$requested_crit_id = ""
protected

Definition at line 47 of file class.ilExPeerReviewGUI.php.

◆ $requested_giver_id

int ilExPeerReviewGUI::$requested_giver_id
protected

Definition at line 31 of file class.ilExPeerReviewGUI.php.

◆ $requested_peer_id

int ilExPeerReviewGUI::$requested_peer_id = 0
protected

Definition at line 46 of file class.ilExPeerReviewGUI.php.

◆ $requested_review_crit_id

string ilExPeerReviewGUI::$requested_review_crit_id = ""
protected

Definition at line 45 of file class.ilExPeerReviewGUI.php.

◆ $requested_review_giver_id

int ilExPeerReviewGUI::$requested_review_giver_id = 0
protected

Definition at line 43 of file class.ilExPeerReviewGUI.php.

◆ $requested_review_peer_id

int ilExPeerReviewGUI::$requested_review_peer_id = 0
protected

Definition at line 44 of file class.ilExPeerReviewGUI.php.

◆ $subm

ILIAS Exercise Submission SubmissionManager ilExPeerReviewGUI::$subm
protected

Definition at line 30 of file class.ilExPeerReviewGUI.php.

◆ $submission

ilExSubmission ilExPeerReviewGUI::$submission
protected

Definition at line 42 of file class.ilExPeerReviewGUI.php.

◆ $tabs_gui

ilTabsGUI ilExPeerReviewGUI::$tabs_gui
protected

Definition at line 37 of file class.ilExPeerReviewGUI.php.

Referenced by executeCommand().

◆ $tpl

ilGlobalPageTemplate ilExPeerReviewGUI::$tpl
protected

Definition at line 39 of file class.ilExPeerReviewGUI.php.

◆ $user

ilObjUser ilExPeerReviewGUI::$user
protected

Definition at line 40 of file class.ilExPeerReviewGUI.php.


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