30 $this->submission = $a_submission;
34 $this->tabs_gui = $ilTabs;
43 if(!$this->ass->getPeerReview())
48 $class = $ilCtrl->getNextClass($this);
49 $cmd = $ilCtrl->getCmd(
"showpeerreviewoverview");
53 case "ilfilesystemgui":
54 $ilCtrl->saveParameter($this,
array(
"fu"));
57 $parts = explode(
"__",
$_GET[
"fu"]);
58 $giver_id = $parts[0];
67 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByPeerId($peer_id,
true);
68 if(
sizeof($peer_items))
70 foreach($peer_items as $item)
72 if($item[
"giver_id"] == $giver_id)
80 $ilCtrl->redirect($this,
"editPeerReview");
83 $ilTabs->clearTargets();
84 $ilTabs->setBackTarget($lng->txt(
"back"),
85 $ilCtrl->getLinkTarget($this,
"editPeerReview"));
87 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
91 include_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
92 $fs_gui =
new ilFileSystemGUI($fstorage->getPeerReviewUploadPath($peer_id, $giver_id));
94 $fs_gui->setAllowDirectories(
false);
95 $fs_gui->setTitle($this->ass->getTitle().
": ".
96 $lng->txt(
"exc_peer_review").
" - ".
97 $lng->txt(
"exc_peer_review_give"));
98 $ret = $this->ctrl->forwardCommand($fs_gui);
102 $this->ass->updatePeerReviewTimestamp((
int)$_REQUEST[
"peer_id"]);
104 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
106 $rating_gui->setObject($this->ass->getId(),
"ass",
107 (int)$_REQUEST[
"peer_id"],
"peer");
108 $this->ctrl->forwardCommand($rating_gui);
109 $ilCtrl->redirect($this,
"editPeerReview");
112 case "ilexsubmissiontextgui":
113 if(!$this->submission->isTutor())
115 $ilTabs->clearTargets();
116 $ilTabs->setBackTarget($lng->txt(
"back"),
117 $ilCtrl->getLinkTarget($this,
"editPeerReview"));
118 $this->ctrl->setReturn($this,
"editPeerReview");
122 $ilTabs->clearTargets();
123 $ilTabs->setBackTarget($lng->txt(
"back"),
124 $ilCtrl->getLinkTarget($this,
"showGivenPeerReview"));
125 $this->ctrl->setReturn($this,
"showGivenPeerReview");
127 include_once
"Modules/Exercise/classes/class.ilExSubmissionTextGUI.php";
129 $ilCtrl->forwardCommand($gui);
133 $this->{
$cmd.
"Object"}();
140 $this->ctrl->returnToParent($this);
149 if(
$ass->afterDeadlineStrict() &&
150 $ass->getPeerReview())
152 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"ass_id", $a_submission->
getAssignment()->getId());
154 $nr_missing_fb = $a_submission->
getPeerReview()->getNumberOfMissingFeedbacksForReceived(
$ass->getId(),
$ass->getPeerReviewMin());
157 if(!
$ass->getPeerReviewDeadline() ||
158 $ass->getPeerReviewDeadline() >
time())
161 if(
$ass->getPeerReviewDeadline())
163 $dl_info =
" (".sprintf($lng->txt(
"exc_peer_review_deadline_info_button"),
168 $button->setPrimary($nr_missing_fb);
169 $button->setCaption($lng->txt(
"exc_peer_review_give").$dl_info,
false);
170 $button->setUrl($ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExPeerReviewGUI"),
"editPeerReview"));
171 $edit_pc = $button->render();
173 else if(
$ass->getPeerReviewDeadline())
175 $edit_pc = $lng->txt(
"exc_peer_review_deadline_reached");
179 if((!
$ass->getPeerReviewDeadline() ||
180 $ass->getPeerReviewDeadline() <
time()))
183 if(
$ass->getPeerReviewDeadline() &&
187 $button->setCaption(
"exc_peer_review_given");
188 $button->setUrl($ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExPeerReviewGUI"),
"showGivenPeerReview"));
189 $view_pc = $button->render().
" ";
196 $received = (bool)
sizeof($a_submission->
getPeerReview()->getPeerReviewsByPeerId($a_submission->
getUserId(),
true));
200 $button->setCaption(
"exc_peer_review_show");
201 $button->setUrl($ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExPeerReviewGUI"),
"showReceivedPeerReview"));
202 $view_pc .= $button->render();
207 $view_pc .= $lng->txt(
"exc_peer_review_show_received_none");
213 $view_pc .= $lng->txt(
"exc_peer_review_show_missing");
223 $a_info->
addProperty($lng->txt(
"exc_peer_review"), $edit_pc.
" ".$view_pc);
225 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"ass_id",
"");
231 return ($this->submission->isOwner() &&
232 $this->ass->afterDeadlineStrict() &&
233 (!$this->ass->getPeerReviewDeadline() ||
234 $this->ass->getPeerReviewDeadline() >
time()));
239 return ($this->submission->isTutor() ||
240 ($this->submission->isOwner() &&
241 $this->ass->afterDeadlineStrict() &&
242 (!$this->ass->getPeerReviewDeadline() ||
243 $this->ass->getPeerReviewDeadline() <
time())));
255 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
256 if(!
sizeof($peer_items))
262 $tpl->setTitle($this->ass->getTitle().
": ".$lng->txt(
"exc_peer_review_given"));
264 include_once
"Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
269 $tpl->setContent($info_widget->getHTML());
277 (!$this->submission->isTutor() &&
278 $this->submission->getPeerReview()->getNumberOfMissingFeedbacksForReceived()))
283 $this->tabs_gui->clearTargets();
284 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this,
"returnToParent"));
286 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByPeerId($this->submission->getUserId(), !$this->submission->isTutor());
287 if(!
sizeof($peer_items))
291 $ilCtrl->redirect($this,
"returnToParent");
294 $tpl->setTitle($this->ass->getTitle().
": ".$lng->txt(
"exc_peer_review_show"));
296 include_once
"Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
301 $tpl->setContent($info_widget->getHTML());
308 include_once
"Services/User/classes/class.ilUserUtil.php";
310 if($this->submission->isTutor())
312 $user_title = $a_by_peer
313 ? $lng->txt(
"exc_peer_review_recipient")
314 : $lng->txt(
"exc_peer_review_giver");
324 $a_info_widget->
addSection($lng->txt(
"exc_submission"));
327 $file_info =
$submission->getDownloadedFilesInfoForTableGUIS($this,
"showReceivedPeerReview");
329 $a_info_widget->
addProperty($file_info[
"last_submission"][
"txt"],
330 $file_info[
"last_submission"][
"value"].
336 $sub_data =
'<a href="'.$file_info[
"files"][
"download_url"].
'">'.$lng->txt(
"download").
'</a>';
338 $a_info_widget->
addProperty($lng->txt(
"exc_submission"), $sub_data);
341 foreach($a_peer_items as $peer)
345 $giver_id = $this->submission->getUserId();
346 $peer_id = $peer[
"peer_id"];
347 $id_title = $lng->txt(
"exc_peer_review_recipient");
352 $giver_id = $peer[
"giver_id"];
353 $peer_id = $this->submission->getUserId();
354 $id_title = $lng->txt(
"exc_peer_review_giver");
355 $user_id = $giver_id;
359 if($this->submission->isTutor())
363 else if(!$this->ass->hasPeerReviewPersonalized())
365 $id_value = $peer[
"seq"];
371 $a_info_widget->
addSection($id_title.
": ".$id_value);
379 $file_info =
$submission->getDownloadedFilesInfoForTableGUIS($this,
"editPeerReviewItem");
381 $a_info_widget->
addProperty($file_info[
"last_submission"][
"txt"],
382 $file_info[
"last_submission"][
"value"].
388 $sub_data =
'<a href="'.$file_info[
"files"][
"download_url"].
'">'.$lng->txt(
"download").
'</a>';
390 $a_info_widget->
addProperty($lng->txt(
"exc_submission"), $sub_data);
396 $values = $this->submission->getPeerReview()->getPeerReviewValues($giver_id, $peer_id);
398 foreach($this->ass->getPeerReviewCriteriaCatalogueItems() as $item)
400 $crit_id = $item->getId()
404 $item->setPeerReviewContext(
410 $title = $item->getTitle();
411 $html = $item->getHTML($values[$crit_id]);
426 return '<div class="warning">'.$lng->txt(
"exc_late_submission").
'</div>';
440 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
441 if(!
sizeof($peer_items))
447 $missing = $this->submission->getPeerReview()->getNumberOfMissingFeedbacksForReceived();
450 $dl = $this->ass->getPeerReviewDeadline();
451 if(!$dl || $dl <
time())
453 ilUtil::sendInfo(sprintf($this->lng->txt(
"exc_peer_review_missing_info"), $missing));
457 ilUtil::sendInfo(sprintf($this->lng->txt(
"exc_peer_review_missing_info_deadline"), $missing,
462 include_once
"Modules/Exercise/classes/class.ilExAssignmentPeerReviewTableGUI.php";
464 $peer_items,
"returnToParent");
465 $tpl->setContent(
$tbl->getHTML());
483 $tpl->setContent($a_form->getHTML());
488 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
489 foreach($peer_items as $item)
491 if($item[
"peer_id"] == $a_peer_id)
510 if(trim(
$text[
"atext"]))
513 include_once
"Services/RTE/classes/class.ilRTE.php";
524 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
525 foreach($peer_items as $item)
527 if($item[
"peer_id"] == $a_peer_id)
534 $ilCtrl->saveParameter($this,
"peer_id");
536 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
538 $form->setFormAction($ilCtrl->getFormAction($this,
"updatePeerReview"));
540 $form->setTitle($this->ass->getTitle().
": ".$lng->txt(
"exc_peer_review_give"));
543 if(!$this->ass->hasPeerReviewPersonalized())
545 $id_title = $lng->txt(
"id");
546 $id_value = $peer[
"seq"];
550 include_once
"Services/User/classes/class.ilUserUtil.php";
551 $id_title = $lng->txt(
"exc_peer_review_recipient");
555 $id->setValue($id_value);
561 $file_info =
$submission->getDownloadedFilesInfoForTableGUIS($this,
"editPeerReviewItem");
564 $last_sub->setValue($file_info[
"last_submission"][
"value"].
566 $form->addItem($last_sub);
571 $sub_data =
'<a href="'.$file_info[
"files"][
"download_url"].
'">'.$lng->txt(
"download").
'</a>';
576 $form->addItem($sub);
581 $input->setTitle($lng->txt(
"exc_peer_review"));
582 $form->addItem($input);
584 $values = $this->submission->getPeerReview()->getPeerReviewValues($this->submission->getUserId(), $a_peer_id);
586 foreach($this->ass->getPeerReviewCriteriaCatalogueItems() as $item)
588 $crit_id = $item->getId()
592 $item->setPeerReviewContext(
594 $this->submission->getUserId(),
598 $item->addToPeerReviewForm($values[$crit_id]);
601 $form->addCommandButton(
"updatePeerReview", $lng->txt(
"save"));
602 $form->addCommandButton(
"editPeerReview", $lng->txt(
"cancel"));
614 !$ilCtrl->isAsynch())
619 $peer_id = (int)
$_POST[
"peer_id"];
620 $crit_id =
$_POST[
"crit_id"];
621 $giver_id = $ilUser->getId();
623 include_once
"Modules/Exercise/classes/class.ilExcCriteria.php";
624 if(!is_numeric($crit_id))
632 $crit->setPeerReviewContext($this->ass, $giver_id, $peer_id);
633 $html = $crit->updateFromAjax();
638 echo $tpl->getOnLoadCodeForAsynch();
652 $peer_id = $_REQUEST[
"peer_id"];
655 if($form->checkInput())
660 foreach($this->ass->getPeerReviewCriteriaCatalogueItems() as $item)
662 $item->setPeerReviewContext(
664 $this->submission->getUserId(),
668 $value = $item->importFromPeerReviewForm();
671 $crit_id = $item->getId()
674 $values[$crit_id] = $value;
676 if(!$item->validate($value))
684 $this->submission->getPeerReview()->updatePeerReview($peer_id, $values);
689 $ilCtrl->redirect($this,
"editPeerReview");
697 $form->setValuesByPost();
704 $exercise =
new ilObjExercise($this->ass->getExerciseId(),
false);
706 $this->submission->getUserIds(),
707 $this->submission->hasSubmitted(),
708 $this->submission->validatePeerReviews()
722 $parts = explode(
"__",
$_GET[
"fu"]);
723 $giver_id = $parts[0];
724 $peer_id = $parts[1];
725 $crit_id = $parts[2];
727 include_once
"Modules/Exercise/classes/class.ilExcCriteria.php";
728 if(!is_numeric($crit_id))
737 $crit->setPeerReviewContext($this->ass, $giver_id, $peer_id);
738 $file = $crit->getFileByHash();
744 $ilCtrl->redirect($this,
"returnToParent");
758 !$this->ass->getPeerReview())
763 include_once
"Modules/Exercise/classes/class.ilExAssignmentPeerReviewOverviewTableGUI.php";
768 $panel_data =
$tbl->getPanelInfo();
769 if(
sizeof($panel_data))
771 $ptpl =
new ilTemplate(
"tpl.exc_peer_review_overview_panel.html",
true,
true,
"Modules/Exercise");
772 foreach($panel_data as $item)
774 $ptpl->setCurrentBlock(
"user_bl");
775 foreach($item[
"value"] as $user)
777 $ptpl->setVariable(
"USER", $user);
778 $ptpl->parseCurrentBlock();
781 $ptpl->setCurrentBlock(
"item_bl");
782 $ptpl->setVariable(
"TITLE", $item[
"title"]);
783 $ptpl->parseCurrentBlock();
786 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
788 $panel->setHeading($this->lng->txt(
"exc_peer_review_overview_invalid_users"));
789 $panel->setBody($ptpl->get());
790 $panel = $panel->getHTML();
793 $tpl->setContent(
$tbl->getHTML().$panel);
801 !$this->ass->getPeerReview())
806 $ilTabs->clearTargets();
808 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
810 $cgui->setFormAction($ilCtrl->getFormAction($this));
811 $cgui->setHeaderText(sprintf($this->lng->txt(
"exc_peer_review_reset_sure"), $this->ass->getTitle()));
812 $cgui->setCancel($this->lng->txt(
"cancel"),
"showPeerReviewOverview");
813 $cgui->setConfirm($this->lng->txt(
"delete"),
"resetPeerReview");
815 $tpl->setContent($cgui->getHTML());
823 !$this->ass->getPeerReview())
828 include_once
"Modules/Exercise/classes/class.ilExPeerReview.php";
830 $all_giver_ids = $peer_review->resetPeerReviews();
832 if(is_array($all_giver_ids))
835 $exercise =
new ilObjExercise($this->ass->getExerciseId(),
false);
836 if($exercise->isCompletionBySubmissionEnabled() &&
839 include_once
"Modules/Exercise/classes/class.ilExSubmission.php";
840 foreach($all_giver_ids as $user_id)
844 $pgui->handlePeerReviewChange();
850 $ilCtrl->redirect($this,
"showPeerReviewOverview");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getInstanceByType($a_type)
editPeerReviewItemObject(ilPropertyFormGUI $a_form=null)
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
setValue($a_value)
Set Value.
initPeerReviewItemForm($a_peer_id)
static getInstanceById($a_id)
addSection($a_title)
add a new section
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
confirmResetPeerReviewObject()
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setTableId($a_val)
Set table id.
List all peers to be reviewed for user.
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false)
Default behaviour is:
showPeerReviewOverviewObject()
showReceivedPeerReviewObject()
getLateSubmissionInfo(ilExSubmission $a_submission)
special template class to simplify handling of ITX/PEAR
static formatDate(ilDateTime $date)
Format a date public.
showGivenPeerReviewObject()
getSubmissionContent(ilExSubmission $a_submission)
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
Create styles array
The data for the language used.
__construct(ilExAssignment $a_ass, ilExSubmission $a_submission=null)
Constructor.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
renderInfoWidget(ilInfoScreenGUI $a_info_widget, array $a_peer_items, $a_by_peer=false)
static getInstance()
Get instance.
List all peer groups for assignment.
This class represents a non editable value in a property form.
create()
Create directory.
addProperty($a_name, $a_value, $a_link="")
add a property to current section
const PEER_REVIEW_VALID_NONE
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
File System Explorer GUI class.
downloadPeerReviewObject()
processExerciseStatus(ilExAssignment $a_ass, array $a_user_ids, $a_has_submitted, array $a_valid_submissions=null)
getFiles(array $a_file_ids=null, $a_only_valid=false, $a_min_timestamp=null)
Object-based submissions (ends up as static file)
Confirmation screen class.