ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ilExPeerReviewGUI: ilRatingGUI, ilExSubmissionTextGUI, ilInfoScreenGUI 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.

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

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  }
notification()
description: > Example for rendring a notification glyph.
global $DIC
Definition: shib_login.php:22
$service
Definition: ltiservices.php:40
+ 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.

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

259  : void
260  {
261  $f = $this->gui->ui()->factory();
262  $lng = $this->lng;
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  );
310  if ($ass->getPeerReviewDeadline()) {
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  }
328  if ($ass->getPeerReviewDeadline()) {
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)
340  if ($ass->getPeerReviewDeadline() &&
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:66
+ Here is the call graph for this function:

◆ canGive()

ilExPeerReviewGUI::canGive ( )
protected

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

Referenced by downloadPeerReviewObject(), editPeerReviewItemObject(), editPeerReviewObject(), updateCritAjaxObject(), and updatePeerReviewObject().

399  : bool
400  {
401  return ($this->submission->isOwner() &&
402  $this->ass->afterDeadlineStrict() &&
403  (!$this->ass->getPeerReviewDeadline() ||
404  $this->ass->getPeerReviewDeadline() > time()));
405  }
+ Here is the caller graph for this function:

◆ canView()

ilExPeerReviewGUI::canView ( )
protected

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

Referenced by downloadPeerReviewObject(), editPeerReviewItemObject(), showGivenPeerReviewObject(), and showReceivedPeerReviewObject().

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  }
+ Here is the caller graph for this function:

◆ confirmResetPeerReviewObject()

ilExPeerReviewGUI::confirmResetPeerReviewObject ( )

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

References $ctrl, $tabs_gui, $tpl, ILIAS\Repository\lng(), returnToParentObject(), and ilGlobalPageTemplate\setContent().

1204  : void
1205  {
1206  $ilCtrl = $this->ctrl;
1207  $tpl = $this->tpl;
1208  $ilTabs = $this->tabs_gui;
1209 
1210  if (!$this->ass ||
1211  !$this->ass->getPeerReview()) {
1212  $this->returnToParentObject();
1213  }
1214 
1215  $ilTabs->clearTargets();
1216 
1217  $cgui = new ilConfirmationGUI();
1218  $cgui->setFormAction($ilCtrl->getFormAction($this));
1219  $cgui->setHeaderText(sprintf($this->lng->txt("exc_peer_review_reset_sure"), $this->ass->getTitle()));
1220  $cgui->setCancel($this->lng->txt("cancel"), "showPeerReviewOverview");
1221  $cgui->setConfirm($this->lng->txt("delete"), "resetPeerReview");
1222 
1223  $tpl->setContent($cgui->getHTML());
1224  }
ilGlobalPageTemplate $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ downloadPeerReviewObject()

ilExPeerReviewGUI::downloadPeerReviewObject ( )

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

References $ctrl, $requested_review_crit_id, $requested_review_giver_id, $requested_review_peer_id, canGive(), canView(), ilExcCriteria\getInstanceById(), ilExcCriteria\getInstanceByType(), and returnToParentObject().

1121  : void
1122  {
1123  $ilCtrl = $this->ctrl;
1124 
1125  if (!$this->canView() &&
1126  !$this->canGive()) {
1127  $this->returnToParentObject();
1128  }
1129 
1133  if (!is_numeric($crit_id)) {
1134  $crit = ilExcCriteria::getInstanceByType($crit_id);
1135  $file_crit_id = 0;
1136  } else {
1137  $crit = ilExcCriteria::getInstanceById($crit_id);
1138  $file_crit_id = $crit_id;
1139  }
1140 
1141  $crit->setPeerReviewContext($this->ass, $giver_id, $peer_id);
1142  $file = $crit->getFileByHash();
1143  if ($file) {
1144  $this->criteria_file->deliverFileOfReview(
1145  $giver_id,
1146  $peer_id,
1147  $file_crit_id
1148  );
1149  }
1150 
1151  $ilCtrl->redirect($this, "returnToParent");
1152  }
static getInstanceByType(string $a_type)
static getInstanceById(int $a_id)
+ Here is the call graph for this function:

◆ editPeerReviewItemObject()

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

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

References $requested_peer_id, $tpl, canGive(), canView(), ILIAS\Repository\ctrl(), ilExcAssMemberState\getInstanceByIds(), getMessagesGUI(), initPeerReviewItemForm(), isValidPeer(), null, returnToParentObject(), ilGlobalPageTemplate\setContent(), and ILIAS\Repository\user().

Referenced by updatePeerReviewObject().

808  : void {
809  $tpl = $this->tpl;
810 
811  $this->tabs_gui->activateTab("give_feedback");
812 
813  if (!$this->canGive() && $this->canView()) {
814  $this->ctrl->redirectByClass(self::class, "showGivenPeerReview");
815  }
816 
817  if (!$this->canGive() ||
818  !$this->isValidPeer($this->requested_peer_id)) {
819  $this->returnToParentObject();
820  }
821 
822  if ($a_form === null) {
823  $a_form = $this->initPeerReviewItemForm($this->requested_peer_id);
824  }
825 
826  $sep = $this->gui->ui()->renderer()->render($this->gui->ui()->factory()->divider()->horizontal());
827  $peer_state = ilExcAssMemberState::getInstanceByIds($this->ass->getId(), $this->requested_peer_id);
828  $message_html = "";
829 
830  // show only message gui, if peer is able to access received feedback
831  if ($peer_state->isReceivedFeedbackAccessible()) {
832  $message_gui = $this->getMessagesGUI(
833  $this->user->getId(),
835  );
836  $message_html = $sep . $message_gui->getListHTML();
837  }
838 
839  $this->gui->permanentLink()->setGivenFeedbackPermanentLink();
840 
841  $tpl->setContent($a_form->getHTML() . $message_html);
842  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getMessagesGUI(int $giver_id, int $peer_id)
static getInstanceByIds(int $a_ass_id, int $a_user_id=0)
ilGlobalPageTemplate $tpl
setContent(string $a_html)
Sets content for standard template.
initPeerReviewItemForm(int $a_peer_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editPeerReviewObject()

ilExPeerReviewGUI::editPeerReviewObject ( )
Exceptions
ilDateTimeException

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

References $tpl, canGive(), ilDatePresentation\formatDate(), getPeerReviewReceiverPanel(), IL_CAL_UNIX, ILIAS\Repository\lng(), returnToParentObject(), and ilGlobalPageTemplate\setContent().

676  : void
677  {
678  $tpl = $this->tpl;
679 
680  $this->tabs_gui->activateTab("give_feedback");
681  if (!$this->canGive()) {
682  $this->returnToParentObject();
683  }
684 
685  $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
686  if ($peer_items === []) {
687  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("exc_peer_review_no_peers"), true);
688  $this->returnToParentObject();
689  }
690 
691  $missing = $this->submission->getPeerReview()->getNumberOfMissingFeedbacksForReceived();
692  if ($missing !== 0) {
693  $dl = $this->ass->getPeerReviewDeadline();
694  if (!$dl || $dl < time()) {
695  $this->tpl->setOnScreenMessage('info', sprintf($this->lng->txt("exc_peer_review_missing_info"), $missing));
696  } else {
697  $this->tpl->setOnScreenMessage('info', sprintf(
698  $this->lng->txt("exc_peer_review_missing_info_deadline"),
699  $missing,
701  ));
702  }
703  }
704 
705  $panel = $this->getPeerReviewReceiverPanel(
706  $this->ass,
707  $this->submission->getUserId(),
708  $peer_items
709  );
710  $tpl->setContent($this->gui->ui()->renderer()->render($panel));
711  }
const IL_CAL_UNIX
getPeerReviewReceiverPanel(ilExAssignment $ass, int $user_id, array $peer_data)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
ilGlobalPageTemplate $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ executeCommand()

ilExPeerReviewGUI::executeCommand ( )
Exceptions
ilCtrlException

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

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

85  : void
86  {
87  $ilCtrl = $this->ctrl;
88  $lng = $this->lng;
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",
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
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...
getMessagesGUI(int $giver_id, int $peer_id)
Exercise peer review.
Class ilObjExercise.
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...
+ Here is the call graph for this function:

◆ getLateSubmissionInfo()

ilExPeerReviewGUI::getLateSubmissionInfo ( ilExSubmission  $a_submission)
protected

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

References $lng, ilExSubmission\getUserId(), and ilLanguage\txt().

Referenced by getReceivedFeedbackPanel(), and initPeerReviewItemForm().

661  : string {
662  $lng = $this->lng;
663 
664  // #18966 - late files info
665  foreach ($this->subm->getSubmissionsOfUser($a_submission->getUserId()) as $sub) {
666  if ($sub->getLate()) {
667  return '<div class="warning">' . $lng->txt("exc_late_submission") . '</div>';
668  }
669  }
670  return "";
671  }
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMessagesGUI()

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

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

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

Referenced by editPeerReviewItemObject(), executeCommand(), and getReceivedFeedbackPanel().

844  : ilMessageGUI
845  {
846  $this->ctrl->setParameter($this, "giver_id", $giver_id);
847  $this->ctrl->setParameter($this, "peer_id", $peer_id);
848  $pr = $this->domain->peerReview()->exPeerReview($this->ass);
849  $gui = $this->notes->gui()->getMessagesGUI(
850  $peer_id,
851  $this->ass->getExerciseId(),
852  $pr->getReviewId($giver_id, $peer_id),
853  "excpf"
854  );
855  if (!$this->ass->hasPeerReviewPersonalized()) {
856  if ($giver_id === $this->user->getId()) {
857  $counterpart_name = $this->lng->txt("exc_peer_review_recipient");
858  } else {
859  $counterpart_name = $this->lng->txt("exc_peer_review_giver");
860  }
861  $gui->setAnonymised(true, $counterpart_name);
862  }
863 
864  $gui->addObserver(function (
865  int $exc_id,
866  int $pf_id,
867  string $type,
868  string $action,
869  int $note_id
870  ) use ($giver_id, $peer_id) {
871  $this->observeMessageAction(
872  $giver_id,
873  $peer_id,
874  $note_id,
875  $action
876  );
877  });
878 
879  return $gui;
880  }
ILIAS Exercise InternalGUIService $gui
observeMessageAction(int $giver_id, int $peer_id, int $note_id, string $action)
Message GUI.
+ 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.

References Vendor\Package\$b, $DIC, ilInfoScreenGUI\addProperty(), ilExSubmission\getAssignment(), ilExcAssMemberState\getInstanceByIds(), ilExSubmission\getPeerReview(), ilExSubmission\getUserId(), and ilLanguage\txt().

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 = "";
189  if ($ass->getPeerReviewDeadline()) {
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)
212  if ($ass->getPeerReviewDeadline() &&
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  }
ILIAS Exercise InternalGUIService $gui
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...
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section
global $DIC
Definition: shib_login.php:22
static getInstanceByIds(int $a_ass_id, int $a_user_id=0)
+ Here is the call graph for this function:

◆ getPeerReviewReceiverPanel()

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

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

References $ctrl, Vendor\Package\$f, $lng, ilObject\_lookupType(), ilDatePresentation\formatDate(), ilUserUtil\getNamePresentation(), ilExSubmission\getPeerReview(), ilExAssignment\hasPeerReviewPersonalized(), IL_CAL_DATETIME, ILIAS\Repository\lng(), null, and ilLanguage\txt().

Referenced by editPeerReviewObject().

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

References $lng, $user_id, getLateSubmissionInfo(), getMessagesGUI(), ilUserUtil\getNamePresentation(), getSubmissionContent(), getSubPanel(), ILIAS\Repository\lng(), null, and ilLanguage\txt().

Referenced by showGivenPeerReviewObject(), and showReceivedPeerReviewObject().

492  : \ILIAS\UI\Component\Panel\Standard {
493  $lng = $this->lng;
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  }
530  $props[] = [
531  "prop" => $lng->txt("exc_submission"),
532  "value" => $sub_data
533  ];
534 
535  $sub_panels[] = $this->getSubPanel(
536  $lng->txt("exc_your_submission"),
537  $props
538  );
539  }
540 
541  foreach ($a_peer_items as $peer) {
542  $props = [];
543  if (!$a_by_peer) {
544  $giver_id = $this->submission->getUserId();
545  $peer_id = $peer["peer_id"];
546  $id_title = $lng->txt("exc_peer_review_recipient");
547  $user_id = $peer_id;
548  } else {
549 
550  // list received feedbacks
551 
552  $giver_id = $peer["giver_id"];
553  $peer_id = $this->submission->getUserId();
554  $id_title = $lng->txt("exc_peer_review_giver");
555  $user_id = $giver_id;
556  }
557 
558  // peer info
559  if ($this->submission->isTutor()) {
560  $id_value = ilUserUtil::getNamePresentation($user_id, "", "", false, true);
561  } elseif (!$this->ass->hasPeerReviewPersonalized()) {
562  $id_value = $peer["seq"];
563  } else {
565  }
566 
567  $mess_gui = $this->getMessagesGUI(
568  $giver_id,
569  $peer_id
570  );
571 
572  // submission info
573 
574  if (!$a_by_peer) {
575  $submission = new ilExSubmission($this->ass, $peer_id);
576  $file_info = $submission->getDownloadedFilesInfoForTableGUIS();
577 
578  $props[] = [
579  "prop" => $file_info["last_submission"]["txt"],
580  "value" => $file_info["last_submission"]["value"] .
582  ];
583 
584  $sub_data = $this->getSubmissionContent($submission);
585  if ($sub_data === '' || $sub_data === '0') {
586  if (isset($file_info["files"]["download_url"])) {
587  $sub_data = '<a href="' . $file_info["files"]["download_url"] . '">' . $lng->txt("download") . '</a>';
588  }
589  }
590  $props[] = [
591  "prop" => $lng->txt("exc_submission"),
592  "value" => $sub_data
593  ];
594  }
595 
596 
597  // peer review items
598 
599  $values = $this->submission->getPeerReview()->getPeerReviewValues($giver_id, $peer_id);
600 
601  foreach ($this->ass->getPeerReviewCriteriaCatalogueItems() as $item) {
602  $crit_id = $item->getId()
603  ? $item->getId()
604  : $item->getType();
605 
606  $item->setPeerReviewContext(
607  $this->ass,
608  $giver_id,
609  $peer_id
610  );
611 
612  $title = $item->getTitle();
613  $html = $item->getHTML($values[$crit_id] ?? null);
614  $props[] = [
615  "prop" => $title ?: "&nbsp;",
616  "value" => $html ?: "&nbsp;"
617  ];
618  }
619  $sub_panels[] = $this->getSubPanel(
620  $id_title . ": " . $id_value,
621  $props,
622  $mess_gui
623  );
624  }
625  return $this->gui->ui()->factory()->panel()->standard(
626  $a_by_peer
627  ? $this->lng->txt("exc_received_feedback")
628  : $this->lng->txt("exc_given_feedback"),
629  $sub_panels
630  );
631  }
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...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getMessagesGUI(int $giver_id, int $peer_id)
getSubPanel(string $title, array $props, ?ilMessageGUI $mess_gui=null)
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='ilpublicuserprofilegui')
Default behaviour is:
getLateSubmissionInfo(ilExSubmission $a_submission)
getSubmissionContent(ilExSubmission $a_submission)
Exercise submission //TODO: This class has many static methods related to delivered "files"...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSubmissionContent()

ilExPeerReviewGUI::getSubmissionContent ( ilExSubmission  $a_submission)
protected

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

References ilRTE\_replaceMediaObjectImageSrc(), ilExSubmission\getUserId(), and ilExAssignment\TYPE_TEXT.

Referenced by getReceivedFeedbackPanel(), and initPeerReviewItemForm().

924  : string {
925  if ($this->ass->getType() != ilExAssignment::TYPE_TEXT) {
926  return "";
927  }
928 
929  $sub = $this->subm->getSubmissionsOfUser($a_submission->getUserId())->current();
930  if ($sub) {
931  if (trim($sub->getText()) !== '' && trim($sub->getText()) !== '0') {
932  // mob id to mob src
933  return nl2br(ilRTE::_replaceMediaObjectImageSrc($sub->getText(), 1));
934  }
935  }
936  return "";
937  }
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSubPanel()

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

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

References Vendor\Package\$f, $r, ilGlobalPageTemplate\get(), ilGlobalPageTemplate\parseCurrentBlock(), ilGlobalPageTemplate\setCurrentBlock(), and ilGlobalPageTemplate\setVariable().

Referenced by getReceivedFeedbackPanel().

637  : \ILIAS\UI\Component\Panel\Sub {
638  $f = $this->gui->ui()->factory();
639  $r = $this->gui->ui()->renderer();
640  $tpl = new \ilTemplate("tpl.panel_items.html", true, true, "components/ILIAS/Exercise/PeerReview");
641  foreach ($props as $prop) {
642  $tpl->setCurrentBlock("entry");
643  $tpl->setVariable("LABEL", $prop["prop"]);
644  $tpl->setVariable("VALUE", $prop["value"]);
646  }
647  $mess_html = "";
648  if ($mess_gui) {
649  $mess_html = $r->render($f->divider()->horizontal()) .
650  $mess_gui->getWidget();
651  }
652 
653  return $f->panel()->sub(
654  $title,
655  $f->legacy()->content($tpl->get() . $mess_html)
656  );
657  }
setCurrentBlock(string $blockname=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $blockname=self::DEFAULT_BLOCK)
Parses 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.
ilGlobalPageTemplate $tpl
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handlePeerReviewChange()

ilExPeerReviewGUI::handlePeerReviewChange ( )
protected

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

References $exercise.

Referenced by updateCritAjaxObject(), and updatePeerReviewObject().

1109  : void
1110  {
1111  // (in)valid peer reviews could change assignment status
1112  $exercise = new ilObjExercise($this->ass->getExerciseId(), false);
1113  $exercise->processExerciseStatus(
1114  $this->ass,
1115  $this->submission->getUserIds(),
1116  $this->submission->hasSubmitted(),
1117  $this->submission->validatePeerReviews()
1118  );
1119  }
Class ilObjExercise.
+ Here is the caller graph for this function:

◆ initPeerReviewItemForm()

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

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

References $ctrl, $id, $lng, getLateSubmissionInfo(), ilUserUtil\getNamePresentation(), getSubmissionContent(), null, and ilLanguage\txt().

Referenced by editPeerReviewItemObject(), and updatePeerReviewObject().

945  $ilCtrl = $this->ctrl;
946  $lng = $this->lng;
947 
948  // get peer data
949  $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
950  $peer = [];
951  foreach ($peer_items as $item) {
952  if ($item["peer_id"] == $a_peer_id) {
953  $peer = $item;
954  break;
955  }
956  }
957 
958  $ilCtrl->saveParameter($this, "peer_id");
959 
960  $form = new ilPropertyFormGUI();
961  $form->setFormAction($ilCtrl->getFormAction($this, "updatePeerReview"));
962 
963  $form->setTitle($this->ass->getTitle() . ": " . $lng->txt("exc_peer_review_give"));
964 
965  // peer info
966  if (!$this->ass->hasPeerReviewPersonalized()) {
967  $id_title = $lng->txt("id");
968  $id_value = $peer["seq"];
969  } else {
970  $id_title = $lng->txt("exc_peer_review_recipient");
971  $id_value = ilUserUtil::getNamePresentation($peer["peer_id"]);
972  }
973  $id = new ilNonEditableValueGUI($id_title);
974  $id->setValue($id_value);
975  $form->addItem($id);
976 
977  // submission info
978 
979  $submission = new ilExSubmission($this->ass, $peer["peer_id"]);
980  $file_info = $submission->getDownloadedFilesInfoForTableGUIS();
981 
982  $last_sub = new ilNonEditableValueGUI($file_info["last_submission"]["txt"], "", true);
983  $last_sub->setValue($file_info["last_submission"]["value"] .
985  $form->addItem($last_sub);
986 
987  $sub_data = $this->getSubmissionContent($submission);
988  if (($sub_data === '' || $sub_data === '0') && isset($file_info["files"]["download_url"])) {
989  $sub_data = '<a href="' . $file_info["files"]["download_url"] . '">' . $lng->txt("download") . '</a>';
990  }
991 
992  $sub = new ilNonEditableValueGUI($lng->txt("exc_submission"), "", true);
993  $sub->setValue($sub_data);
994  $form->addItem($sub);
995 
996  // peer review items
997 
998  $input = new ilFormSectionHeaderGUI();
999  $input->setTitle($lng->txt("exc_peer_review"));
1000  $form->addItem($input);
1001 
1002  $values = $this->submission->getPeerReview()->getPeerReviewValues($this->submission->getUserId(), $a_peer_id);
1003  // the values only contain text/selection values not files
1004 
1005  foreach ($this->ass->getPeerReviewCriteriaCatalogueItems() as $item) {
1006  $crit_id = $item->getId()
1007  ? $item->getId()
1008  : $item->getType();
1009 
1010  $item->setPeerReviewContext(
1011  $this->ass,
1012  $this->submission->getUserId(),
1013  $peer["peer_id"],
1014  $form
1015  );
1016  $item->addToPeerReviewForm($values[$crit_id] ?? null);
1017  }
1018 
1019  $form->addCommandButton("updatePeerReview", $lng->txt("save"));
1020  $form->addCommandButton("editPeerReview", $lng->txt("cancel"));
1021 
1022  return $form;
1023  }
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...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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='ilpublicuserprofilegui')
Default behaviour is:
getLateSubmissionInfo(ilExSubmission $a_submission)
getSubmissionContent(ilExSubmission $a_submission)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
Exercise submission //TODO: This class has many static methods related to delivered "files"...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidPeer()

ilExPeerReviewGUI::isValidPeer ( int  $a_peer_id)
protected

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

Referenced by editPeerReviewItemObject(), and updatePeerReviewObject().

911  : bool
912  {
913  $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
914  foreach ($peer_items as $item) {
915  if ($item["peer_id"] == $a_peer_id) {
916  return true;
917  }
918  }
919  return false;
920  }
+ Here is the caller graph for this function:

◆ observeMessageAction()

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

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

References ILIAS\UI\examples\Symbol\Glyph\Notification\notification().

Referenced by getMessagesGUI().

887  : void {
888  if ($action !== "new") {
889  return;
890  }
891  $note = $this->notes->domain()->getById($note_id);
892  $text = $note->getText();
893 
894  if ($note->getAuthor() === $giver_id) {
895  $this->notification->sendMessageFromPeerfeedbackGiverNotification(
896  $this->ass->getId(),
897  $peer_id,
898  $text
899  );
900  } else {
901  $this->notification->sendMessageFromPeerfeedbackRecipientNotification(
902  $this->ass->getId(),
903  $peer_id,
904  $giver_id,
905  $text
906  );
907  }
908  }
notification()
description: > Example for rendring a notification glyph.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetPeerReviewObject()

ilExPeerReviewGUI::resetPeerReviewObject ( )

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

References $ass, $ctrl, $exercise, $submission, $user_id, ILIAS\Repository\lng(), ilExAssignment\PEER_REVIEW_VALID_NONE, and returnToParentObject().

1226  : void
1227  {
1228  $ilCtrl = $this->ctrl;
1229 
1230  if (!$this->ass ||
1231  !$this->ass->getPeerReview()) {
1232  $this->returnToParentObject();
1233  }
1234 
1235  $peer_review = new ilExPeerReview($this->ass);
1236  $all_giver_ids = $peer_review->resetPeerReviews();
1237 
1238  if (is_array($all_giver_ids)) {
1239  // if peer review is valid for completion, we have to re-calculate all assignment members
1240  $exercise = new ilObjExercise($this->ass->getExerciseId(), false);
1241  if ($exercise->isCompletionBySubmissionEnabled() &&
1242  $this->ass->getPeerReviewValid() != ilExAssignment::PEER_REVIEW_VALID_NONE) {
1243  foreach ($all_giver_ids as $user_id) {
1244  $submission = new ilExSubmission($this->ass, $user_id);
1245  $pgui = new self($this->ass, $submission);
1246  $pgui->handlePeerReviewChange();
1247  }
1248  }
1249  }
1250 
1251  $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_peer_review_reset_done"), true);
1252  $ilCtrl->redirect($this, "showPeerReviewOverview");
1253  }
Exercise peer review.
Class ilObjExercise.
Exercise submission //TODO: This class has many static methods related to delivered "files"...
+ Here is the call graph for this function:

◆ returnToParentObject()

ilExPeerReviewGUI::returnToParentObject ( )

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

References ILIAS\Repository\ctrl().

Referenced by confirmResetPeerReviewObject(), downloadPeerReviewObject(), editPeerReviewItemObject(), editPeerReviewObject(), executeCommand(), resetPeerReviewObject(), showGivenPeerReviewObject(), showPeerReviewOverviewObject(), showReceivedPeerReviewObject(), and updatePeerReviewObject().

148  : void
149  {
150  $this->ctrl->returnToParent($this);
151  }
+ 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.

References $lng, $tpl, canView(), getReceivedFeedbackPanel(), ILIAS\Repository\lng(), returnToParentObject(), ilGlobalPageTemplate\setContent(), ilGlobalPageTemplate\setTitle(), and ilLanguage\txt().

422  : void
423  {
424  $tpl = $this->tpl;
425  $lng = $this->lng;
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  }
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...
getReceivedFeedbackPanel(array $a_peer_items, bool $a_by_peer=false)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
ilGlobalPageTemplate $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ showPeerReviewOverviewObject()

ilExPeerReviewGUI::showPeerReviewOverviewObject ( )

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

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

1160  : void
1161  {
1162  $tpl = $this->tpl;
1163 
1164  if (!$this->ass ||
1165  !$this->ass->getPeerReview()) {
1166  $this->returnToParentObject();
1167  }
1168 
1170  $this,
1171  "showPeerReviewOverview",
1172  $this->ass
1173  );
1174 
1175  $panel = "";
1176  $panel_data = $tbl->getPanelInfo();
1177  if (is_array($panel_data) && count($panel_data) > 0) {
1178  $ptpl = new ilTemplate("tpl.exc_peer_review_overview_panel.html", true, true, "components/ILIAS/Exercise");
1179  foreach ($panel_data as $item) {
1180  $ptpl->setCurrentBlock("user_bl");
1181  foreach ($item["value"] as $user) {
1182  $ptpl->setVariable("USER", $user);
1183  $ptpl->parseCurrentBlock();
1184  }
1185 
1186  $ptpl->setCurrentBlock("item_bl");
1187  $ptpl->setVariable("TITLE", $item["title"]);
1188  $ptpl->parseCurrentBlock();
1189  }
1190 
1191  $f = $this->gui->ui()->factory();
1192  $r = $this->gui->ui()->renderer();
1193  $p = $f->panel()->standard(
1194  $this->lng->txt("exc_peer_review_overview_invalid_users"),
1195  $f->legacy()->content($ptpl->get())
1196  );
1197 
1198  $panel = $r->render($p);
1199  }
1200 
1201  $tpl->setContent($tbl->getHTML() . $panel);
1202  }
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.
$r
+ 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.

References $ctrl, $lng, $tpl, canView(), getReceivedFeedbackPanel(), ILIAS\Repository\lng(), returnToParentObject(), ilGlobalPageTemplate\setContent(), ilGlobalPageTemplate\setTitle(), and ilLanguage\txt().

454  : void
455  {
456  $ilCtrl = $this->ctrl;
457  $tpl = $this->tpl;
458  $lng = $this->lng;
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  }
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...
getReceivedFeedbackPanel(array $a_peer_items, bool $a_by_peer=false)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
ilGlobalPageTemplate $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ updateCritAjaxObject()

ilExPeerReviewGUI::updateCritAjaxObject ( )

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

References $ctrl, $requested_crit_id, $requested_peer_id, $tpl, $user, canGive(), exit, ilExcCriteria\getInstanceById(), ilExcCriteria\getInstanceByType(), ilGlobalPageTemplate\getOnLoadCodeForAsynch(), and handlePeerReviewChange().

1025  : void
1026  {
1027  $ilCtrl = $this->ctrl;
1028  $ilUser = $this->user;
1029  $tpl = $this->tpl;
1030 
1031  if (!$this->canGive() ||
1032  !$this->requested_peer_id ||
1033  !$this->requested_crit_id ||
1034  !$ilCtrl->isAsynch()) {
1035  exit();
1036  }
1037 
1038  $peer_id = $this->requested_peer_id;
1039  $crit_id = $this->requested_crit_id;
1040  $giver_id = $ilUser->getId();
1041 
1042  if (!is_numeric($crit_id)) {
1043  $crit = ilExcCriteria::getInstanceByType($crit_id);
1044  } else {
1045  $crit = ilExcCriteria::getInstanceById($crit_id);
1046  }
1047  $crit->setPeerReviewContext($this->ass, $giver_id, $peer_id);
1048  $html = $crit->updateFromAjax();
1049 
1050  $this->handlePeerReviewChange();
1051 
1052  echo $html;
1053  echo $tpl->getOnLoadCodeForAsynch();
1054  exit();
1055  }
static getInstanceByType(string $a_type)
getOnLoadCodeForAsynch()
Get js onload code for ajax calls.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalPageTemplate $tpl
static getInstanceById(int $a_id)
+ Here is the call graph for this function:

◆ updatePeerReviewObject()

ilExPeerReviewGUI::updatePeerReviewObject ( )

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

References $ctrl, $lng, $requested_peer_id, $valid, canGive(), editPeerReviewItemObject(), handlePeerReviewChange(), initPeerReviewItemForm(), isValidPeer(), ILIAS\Repository\lng(), null, returnToParentObject(), and ilLanguage\txt().

1057  : void
1058  {
1059  $lng = $this->lng;
1060  $ilCtrl = $this->ctrl;
1061 
1062  if (!$this->canGive() ||
1063  !$this->isValidPeer($this->requested_peer_id)) {
1064  $this->returnToParentObject();
1065  }
1066 
1067  $peer_id = $this->requested_peer_id;
1068 
1069  $form = $this->initPeerReviewItemForm($peer_id);
1070  if ($form->checkInput()) {
1071  $valid = true;
1072 
1073  $values = array();
1074  foreach ($this->ass->getPeerReviewCriteriaCatalogueItems() as $item) {
1075  $item->setPeerReviewContext(
1076  $this->ass,
1077  $this->submission->getUserId(),
1078  $peer_id,
1079  $form
1080  );
1081  $value = $item->importFromPeerReviewForm();
1082  if ($value !== null) {
1083  $crit_id = $item->getId()
1084  ? $item->getId()
1085  : $item->getType();
1086  $values[$crit_id] = $value;
1087  }
1088  if (!$item->validate($value)) {
1089  $valid = false;
1090  }
1091  }
1092 
1093  if ($valid) {
1094  $this->submission->getPeerReview()->updatePeerReview($peer_id, $values);
1095 
1096  $this->handlePeerReviewChange();
1097 
1098  $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_peer_review_updated"), true);
1099  $ilCtrl->redirect($this, "editPeerReview");
1100  } else {
1101  $this->tpl->setOnScreenMessage('failure', $lng->txt("form_input_not_valid"));
1102  }
1103  }
1104 
1105  $form->setValuesByPost();
1106  $this->editPeerReviewItemObject($form);
1107  }
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...
$valid
editPeerReviewItemObject(?ilPropertyFormGUI $a_form=null)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
initPeerReviewItemForm(int $a_peer_id)
+ Here is the call graph for this function:

Field Documentation

◆ $ass

ilExAssignment ilExPeerReviewGUI::$ass
protected

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

Referenced by resetPeerReviewObject().

◆ $criteria_file

ILIAS Exercise PeerReview Criteria CriteriaFileManager ilExPeerReviewGUI::$criteria_file
protected

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

◆ $ctrl

◆ $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 getMessagesGUI().

◆ $lng

◆ $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.

Referenced by updateCritAjaxObject().

◆ $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

◆ $requested_review_crit_id

string ilExPeerReviewGUI::$requested_review_crit_id = ""
protected

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

Referenced by downloadPeerReviewObject().

◆ $requested_review_giver_id

int ilExPeerReviewGUI::$requested_review_giver_id = 0
protected

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

Referenced by downloadPeerReviewObject().

◆ $requested_review_peer_id

int ilExPeerReviewGUI::$requested_review_peer_id = 0
protected

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

Referenced by downloadPeerReviewObject().

◆ $subm

ILIAS Exercise Submission SubmissionManager ilExPeerReviewGUI::$subm
protected

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

◆ $submission

ilExSubmission ilExPeerReviewGUI::$submission
protected

◆ $tabs_gui

ilTabsGUI ilExPeerReviewGUI::$tabs_gui
protected

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

Referenced by confirmResetPeerReviewObject(), and executeCommand().

◆ $tpl

◆ $user

ilObjUser ilExPeerReviewGUI::$user
protected

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

Referenced by updateCritAjaxObject().


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