54 $this->
user = $DIC->user();
56 $ilTabs = $DIC->tabs();
57 $lng = $DIC->language();
61 $this->submission = $a_submission;
65 $this->tabs_gui = $ilTabs;
77 if (!$this->ass->getPeerReview()) {
81 $class =
$ilCtrl->getNextClass($this);
82 $cmd =
$ilCtrl->getCmd(
"showpeerreviewoverview");
85 case "ilfilesystemgui":
89 $parts = explode(
"__",
$_GET[
"fu"]);
90 $giver_id = $parts[0];
98 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByPeerId($peer_id,
true);
99 if (
sizeof($peer_items)) {
100 foreach ($peer_items as $item) {
101 if ($item[
"giver_id"] == $giver_id) {
107 $ilCtrl->redirect($this,
"editPeerReview");
110 $ilTabs->clearTargets();
111 $ilTabs->setBackTarget(
113 $ilCtrl->getLinkTarget($this,
"editPeerReview")
116 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
120 include_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
121 $fs_gui =
new ilFileSystemGUI($fstorage->getPeerReviewUploadPath($peer_id, $giver_id));
123 $fs_gui->setAllowDirectories(
false);
124 $fs_gui->setTitle($this->ass->getTitle() .
": " .
125 $lng->txt(
"exc_peer_review") .
" - " .
126 $lng->txt(
"exc_peer_review_give"));
127 $ret = $this->ctrl->forwardCommand($fs_gui);
131 $this->ass->updatePeerReviewTimestamp((
int) $_REQUEST[
"peer_id"]);
133 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
135 $rating_gui->setObject(
138 (int) $_REQUEST[
"peer_id"],
141 $this->ctrl->forwardCommand($rating_gui);
142 $ilCtrl->redirect($this,
"editPeerReview");
145 case "ilexsubmissiontextgui":
146 if (!$this->submission->isTutor()) {
147 $ilTabs->clearTargets();
148 $ilTabs->setBackTarget(
150 $ilCtrl->getLinkTarget($this,
"editPeerReview")
152 $this->ctrl->setReturn($this,
"editPeerReview");
154 $ilTabs->clearTargets();
155 $ilTabs->setBackTarget(
157 $ilCtrl->getLinkTarget($this,
"showGivenPeerReview")
159 $this->ctrl->setReturn($this,
"showGivenPeerReview");
161 include_once
"Modules/Exercise/classes/class.ilExSubmissionTextGUI.php";
167 $this->{$cmd .
"Object"}();
174 $this->ctrl->returnToParent($this);
181 $lng = $DIC->language();
186 if (
$ass->afterDeadlineStrict() &&
187 $ass->getPeerReview()) {
188 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"ass_id", $a_submission->
getAssignment()->getId());
190 $nr_missing_fb = $a_submission->
getPeerReview()->getNumberOfMissingFeedbacksForReceived(
$ass->getId(),
$ass->getPeerReviewMin());
193 if (!
$ass->getPeerReviewDeadline() ||
194 $ass->getPeerReviewDeadline() >
time()) {
196 if (
$ass->getPeerReviewDeadline()) {
197 $dl_info =
" (" . sprintf(
198 $lng->txt(
"exc_peer_review_deadline_info_button"),
204 $button->setPrimary($nr_missing_fb);
205 $button->setCaption(
$lng->txt(
"exc_peer_review_give") . $dl_info,
false);
206 $button->setUrl(
$ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExPeerReviewGUI"),
"editPeerReview"));
207 $edit_pc = $button->render();
208 } elseif (
$ass->getPeerReviewDeadline()) {
209 $edit_pc =
$lng->txt(
"exc_peer_review_deadline_reached");
213 if ((!
$ass->getPeerReviewDeadline() ||
214 $ass->getPeerReviewDeadline() <
time())) {
216 if (
$ass->getPeerReviewDeadline() &&
219 $button->setCaption(
"exc_peer_review_given");
220 $button->setUrl(
$ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExPeerReviewGUI"),
"showGivenPeerReview"));
221 $view_pc = $button->render() .
" ";
225 if (!$nr_missing_fb) {
227 $received = (bool)
sizeof($a_submission->
getPeerReview()->getPeerReviewsByPeerId($a_submission->
getUserId(),
true));
230 $button->setCaption(
"exc_peer_review_show");
231 $button->setUrl(
$ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExPeerReviewGUI"),
"showReceivedPeerReview"));
232 $view_pc .= $button->render();
236 $view_pc .=
$lng->txt(
"exc_peer_review_show_received_none");
241 $view_pc .=
$lng->txt(
"exc_peer_review_show_missing");
251 $a_info->
addProperty(
$lng->txt(
"exc_peer_review"), $edit_pc .
" " . $view_pc);
253 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"ass_id",
"");
259 return ($this->submission->isOwner() &&
260 $this->ass->afterDeadlineStrict() &&
261 (!$this->ass->getPeerReviewDeadline() ||
262 $this->ass->getPeerReviewDeadline() >
time()));
267 return ($this->submission->isTutor() ||
268 ($this->submission->isOwner() &&
269 $this->ass->afterDeadlineStrict() &&
270 (!$this->ass->getPeerReviewDeadline() ||
271 $this->ass->getPeerReviewDeadline() <
time())));
283 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
284 if (!
sizeof($peer_items)) {
289 $tpl->setTitle($this->ass->getTitle() .
": " .
$lng->txt(
"exc_peer_review_given"));
291 include_once
"Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
296 $tpl->setContent($info_widget->getHTML());
306 (!$this->submission->isTutor() &&
307 $this->submission->getPeerReview()->getNumberOfMissingFeedbacksForReceived())) {
311 $this->tabs_gui->clearTargets();
312 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this,
"returnToParent"));
314 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByPeerId($this->submission->getUserId(), !$this->submission->isTutor());
315 if (!
sizeof($peer_items)) {
318 $ilCtrl->redirect($this,
"returnToParent");
321 $tpl->setTitle($this->ass->getTitle() .
": " .
$lng->txt(
"exc_peer_review_show"));
323 include_once
"Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
328 $tpl->setContent($info_widget->getHTML());
335 include_once
"Services/User/classes/class.ilUserUtil.php";
337 if ($this->submission->isTutor()) {
338 $user_title = $a_by_peer
339 ?
$lng->txt(
"exc_peer_review_recipient")
340 :
$lng->txt(
"exc_peer_review_giver");
354 $file_info =
$submission->getDownloadedFilesInfoForTableGUIS($this,
"showReceivedPeerReview");
357 $file_info[
"last_submission"][
"txt"],
358 $file_info[
"last_submission"][
"value"] .
364 $sub_data =
'<a href="' . $file_info[
"files"][
"download_url"] .
'">' .
$lng->txt(
"download") .
'</a>';
369 foreach ($a_peer_items as $peer) {
371 $giver_id = $this->submission->getUserId();
372 $peer_id = $peer[
"peer_id"];
373 $id_title =
$lng->txt(
"exc_peer_review_recipient");
376 $giver_id = $peer[
"giver_id"];
377 $peer_id = $this->submission->getUserId();
378 $id_title =
$lng->txt(
"exc_peer_review_giver");
379 $user_id = $giver_id;
383 if ($this->submission->isTutor()) {
385 } elseif (!$this->ass->hasPeerReviewPersonalized()) {
386 $id_value = $peer[
"seq"];
390 $a_info_widget->
addSection($id_title .
": " . $id_value);
397 $file_info =
$submission->getDownloadedFilesInfoForTableGUIS($this,
"editPeerReviewItem");
400 $file_info[
"last_submission"][
"txt"],
401 $file_info[
"last_submission"][
"value"] .
407 $sub_data =
'<a href="' . $file_info[
"files"][
"download_url"] .
'">' .
$lng->txt(
"download") .
'</a>';
415 $values = $this->submission->getPeerReview()->getPeerReviewValues($giver_id, $peer_id);
417 foreach ($this->ass->getPeerReviewCriteriaCatalogueItems() as $item) {
418 $crit_id = $item->getId()
422 $item->setPeerReviewContext(
428 $title = $item->getTitle();
429 $html = $item->getHTML($values[$crit_id]);
442 return '<div class="warning">' .
$lng->txt(
"exc_late_submission") .
'</div>';
455 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
456 if (!
sizeof($peer_items)) {
461 $missing = $this->submission->getPeerReview()->getNumberOfMissingFeedbacksForReceived();
463 $dl = $this->ass->getPeerReviewDeadline();
464 if (!$dl || $dl <
time()) {
465 ilUtil::sendInfo(sprintf($this->lng->txt(
"exc_peer_review_missing_info"), $missing));
468 $this->lng->txt(
"exc_peer_review_missing_info_deadline"),
475 include_once
"Modules/Exercise/classes/class.ilExAssignmentPeerReviewTableGUI.php";
480 $this->submission->getUserId(),
500 $tpl->setContent($a_form->getHTML());
505 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
506 foreach ($peer_items as $item) {
507 if ($item[
"peer_id"] == $a_peer_id) {
523 if (trim(
$text[
"atext"])) {
525 include_once
"Services/RTE/classes/class.ilRTE.php";
537 $peer_items = $this->submission->getPeerReview()->getPeerReviewsByGiver($this->submission->getUserId());
538 foreach ($peer_items as $item) {
539 if ($item[
"peer_id"] == $a_peer_id) {
545 $ilCtrl->saveParameter($this,
"peer_id");
547 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
549 $form->setFormAction(
$ilCtrl->getFormAction($this,
"updatePeerReview"));
551 $form->setTitle($this->ass->getTitle() .
": " .
$lng->txt(
"exc_peer_review_give"));
554 if (!$this->ass->hasPeerReviewPersonalized()) {
555 $id_title =
$lng->txt(
"id");
556 $id_value = $peer[
"seq"];
558 include_once
"Services/User/classes/class.ilUserUtil.php";
559 $id_title =
$lng->txt(
"exc_peer_review_recipient");
563 $id->setValue($id_value);
569 $file_info =
$submission->getDownloadedFilesInfoForTableGUIS($this,
"editPeerReviewItem");
572 $last_sub->setValue($file_info[
"last_submission"][
"value"] .
574 $form->addItem($last_sub);
578 $sub_data =
'<a href="' . $file_info[
"files"][
"download_url"] .
'">' .
$lng->txt(
"download") .
'</a>';
583 $form->addItem($sub);
588 $input->setTitle(
$lng->txt(
"exc_peer_review"));
589 $form->addItem($input);
591 $values = $this->submission->getPeerReview()->getPeerReviewValues($this->submission->getUserId(), $a_peer_id);
593 foreach ($this->ass->getPeerReviewCriteriaCatalogueItems() as $item) {
594 $crit_id = $item->getId()
598 $item->setPeerReviewContext(
600 $this->submission->getUserId(),
604 $item->addToPeerReviewForm($values[$crit_id]);
607 $form->addCommandButton(
"updatePeerReview",
$lng->txt(
"save"));
608 $form->addCommandButton(
"editPeerReview",
$lng->txt(
"cancel"));
626 $peer_id = (int)
$_POST[
"peer_id"];
627 $crit_id =
$_POST[
"crit_id"];
630 include_once
"Modules/Exercise/classes/class.ilExcCriteria.php";
631 if (!is_numeric($crit_id)) {
636 $crit->setPeerReviewContext($this->ass, $giver_id, $peer_id);
637 $html = $crit->updateFromAjax();
642 echo
$tpl->getOnLoadCodeForAsynch();
656 $peer_id = $_REQUEST[
"peer_id"];
659 if (
$form->checkInput()) {
663 foreach ($this->ass->getPeerReviewCriteriaCatalogueItems() as $item) {
664 $item->setPeerReviewContext(
666 $this->submission->getUserId(),
670 $value = $item->importFromPeerReviewForm();
671 if ($value !== null) {
672 $crit_id = $item->getId()
675 $values[$crit_id] = $value;
677 if (!$item->validate($value)) {
683 $this->submission->getPeerReview()->updatePeerReview($peer_id, $values);
688 $ilCtrl->redirect($this,
"editPeerReview");
694 $form->setValuesByPost();
701 $exercise =
new ilObjExercise($this->ass->getExerciseId(),
false);
704 $this->submission->getUserIds(),
705 $this->submission->hasSubmitted(),
706 $this->submission->validatePeerReviews()
719 $parts = explode(
"__",
$_GET[
"fu"]);
720 $giver_id = $parts[0];
721 $peer_id = $parts[1];
722 $crit_id = $parts[2];
724 include_once
"Modules/Exercise/classes/class.ilExcCriteria.php";
725 if (!is_numeric($crit_id)) {
731 $crit->setPeerReviewContext($this->ass, $giver_id, $peer_id);
732 $file = $crit->getFileByHash();
737 $ilCtrl->redirect($this,
"returnToParent");
751 !$this->ass->getPeerReview()) {
755 include_once
"Modules/Exercise/classes/class.ilExAssignmentPeerReviewOverviewTableGUI.php";
758 "showPeerReviewOverview",
763 $panel_data =
$tbl->getPanelInfo();
764 if (
sizeof($panel_data)) {
765 $ptpl =
new ilTemplate(
"tpl.exc_peer_review_overview_panel.html",
true,
true,
"Modules/Exercise");
766 foreach ($panel_data as $item) {
767 $ptpl->setCurrentBlock(
"user_bl");
768 foreach ($item[
"value"] as
$user) {
769 $ptpl->setVariable(
"USER", $user);
770 $ptpl->parseCurrentBlock();
773 $ptpl->setCurrentBlock(
"item_bl");
774 $ptpl->setVariable(
"TITLE", $item[
"title"]);
775 $ptpl->parseCurrentBlock();
778 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
780 $panel->setHeading($this->lng->txt(
"exc_peer_review_overview_invalid_users"));
781 $panel->setBody($ptpl->get());
782 $panel = $panel->getHTML();
785 $tpl->setContent(
$tbl->getHTML() . $panel);
795 !$this->ass->getPeerReview()) {
799 $ilTabs->clearTargets();
801 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
803 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
804 $cgui->setHeaderText(sprintf($this->lng->txt(
"exc_peer_review_reset_sure"), $this->ass->getTitle()));
805 $cgui->setCancel($this->lng->txt(
"cancel"),
"showPeerReviewOverview");
806 $cgui->setConfirm($this->lng->txt(
"delete"),
"resetPeerReview");
808 $tpl->setContent($cgui->getHTML());
816 !$this->ass->getPeerReview()) {
820 include_once
"Modules/Exercise/classes/class.ilExPeerReview.php";
822 $all_giver_ids = $peer_review->resetPeerReviews();
824 if (is_array($all_giver_ids)) {
826 $exercise =
new ilObjExercise($this->ass->getExerciseId(),
false);
827 if ($exercise->isCompletionBySubmissionEnabled() &&
829 include_once
"Modules/Exercise/classes/class.ilExSubmission.php";
830 foreach ($all_giver_ids as $user_id) {
833 $pgui->handlePeerReviewChange();
839 $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)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
if(!array_key_exists('StateId', $_REQUEST)) $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.
showPeerReviewOverviewObject()
showReceivedPeerReviewObject()
getLateSubmissionInfo(ilExSubmission $a_submission)
if(isset($_POST['submit'])) $form
special template class to simplify handling of ITX/PEAR
showGivenPeerReviewObject()
getSubmissionContent(ilExSubmission $a_submission)
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, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
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)
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
Confirmation screen class.