ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilExAssignmentPeerReviewOverviewTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
11{
12 protected $ass; // [ilExAssignment]
13 protected $panel_info; // [array]
14
22 public function __construct($a_parent_obj, $a_parent_cmd, ilExAssignment $a_ass)
23 {
24 global $DIC;
25
26 $this->ctrl = $DIC->ctrl();
27 $ilCtrl = $DIC->ctrl();
28
29 $this->ass = $a_ass;
30
31 parent::__construct($a_parent_obj, $a_parent_cmd);
32
33 $this->setLimit(9999);
34
35 $this->addColumn($this->lng->txt("exc_peer_review_recipient"), "recipient");
36 $this->addColumn($this->lng->txt("exc_peer_review_giver"), "giver");
37 $this->addColumn($this->lng->txt("status"), "status");
38
39 $this->setDefaultOrderField("recipient");
40
41 $this->setRowTemplate("tpl.exc_peer_review_overview_row.html", "Modules/Exercise");
42 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
43
44 $this->setTitle($a_ass->getTitle() . ": " . $this->lng->txt("exc_peer_review_overview"));
45
46 $this->disable("numinfo");
47
48 $this->getItems();
49
50 $this->addCommandButton("confirmResetPeerReview", $this->lng->txt("exc_peer_review_reset"));
51 }
52
53 protected function translateUserIds($a_user_ids, $a_implode = false)
54 {
55 if (!is_array($a_user_ids) && is_numeric($a_user_ids)) {
56 $a_user_ids = array($a_user_ids);
57 }
58
59 $res = array();
60
61 foreach (array_unique($a_user_ids) as $user_id) {
63 }
64
65 if ($a_implode) {
66 $res = implode("<br />", $res);
67 }
68 return $res;
69 }
70
71 public function getPanelInfo()
72 {
73 return $this->panel_info;
74 }
75
76 protected function getItems()
77 {
78 $data = array();
79
80 $peer_review = new ilExPeerReview($this->ass);
81 $tmp = $peer_review->validatePeerReviewGroups();
82
83 if (!is_array($tmp)) {
84 return;
85 }
86
87 foreach ($tmp["reviews"] as $peer_id => $reviews) {
88 $peer = $this->translateUserIds($peer_id, true);
89
90 foreach ($reviews as $giver_id => $status) {
91 $data[] = array("recipient" => $peer,
92 "giver" => $this->translateUserIds($giver_id, true),
93 "status" => ($status ? $this->lng->txt("valid") : ""));
94 }
95 }
96
97 if ($tmp["missing_user_ids"]) {
98 $this->panel_info[] = array(
99 "title" => $this->lng->txt("exc_peer_review_missing_users"),
100 "value" => $this->translateUserIds($tmp["missing_user_ids"])
101 );
102 }
103
104 if ($tmp["not_returned_ids"]) {
105 $this->panel_info[] = array(
106 "title" => $this->lng->txt("exc_peer_review_not_returned_users"),
107 "value" => $this->translateUserIds($tmp["not_returned_ids"])
108 );
109 }
110
111 if ($tmp["invalid_peer_ids"]) {
112 $this->panel_info[] = array(
113 "title" => $this->lng->txt("exc_peer_review_invalid_peer_ids"),
114 "value" => $this->translateUserIds($tmp["invalid_peer_ids"])
115 );
116 }
117
118 if ($tmp["invalid_giver_ids"]) {
119 $this->panel_info[] = array(
120 "title" => $this->lng->txt("exc_peer_review_invalid_giver_ids"),
121 "value" => $this->translateUserIds($tmp["invalid_giver_ids"])
122 );
123 }
124
125 $this->setData($data);
126 }
127
128 protected function fillRow($a_set)
129 {
130 $this->tpl->setVariable("PEER", $a_set["recipient"]);
131 $this->tpl->setVariable("GIVER", $a_set["giver"]);
132 $this->tpl->setVariable("STATUS", $a_set["status"]);
133 }
134}
An exception for terminatinating execution or to throw for unit testing.
__construct($a_parent_obj, $a_parent_cmd, ilExAssignment $a_ass)
Constructor.
Exercise assignment.
Exercise peer review.
Class ilTable2GUI.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
disable($a_module_name)
diesables particular modules of table
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:
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res