4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
5 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
20 function __construct($a_parent_obj, $a_parent_cmd,
ilExAssignment $a_ass, $a_show_peer_review =
false, $a_disable_peer_review =
false)
25 $this->show_peer_review = (bool)$a_show_peer_review;
26 $this->
setId(
"excassltxt".$this->ass->getId());
28 parent::__construct($a_parent_obj, $a_parent_cmd);
30 $this->
setTitle($lng->txt(
"exc_list_text_assignment").
31 ": \"".$this->ass->getTitle().
"\"");
37 $this->
addColumn($this->lng->txt(
"user"),
"uname",
"15%");
38 $this->
addColumn($this->lng->txt(
"exc_last_submission"),
"udate",
"10%");
40 if($this->show_peer_review)
42 $this->
addColumn($this->lng->txt(
"exc_files_returned_text"),
"",
"45%");
43 $this->
addColumn($this->lng->txt(
"exc_peer_review"),
"",
"30%");
45 include_once
'./Services/Rating/classes/class.ilRatingGUI.php';
46 include_once
'./Services/Accordion/classes/class.ilAccordionGUI.php';
50 $this->
addColumn($this->lng->txt(
"exc_files_returned_text"),
"",
"75%");
57 $this->
setRowTemplate(
"tpl.exc_list_text_assignment_row.html",
"Modules/Exercise");
59 if(!$a_disable_peer_review &&
60 $this->ass->getPeerReview() &&
61 !$a_show_peer_review &&
64 $this->
addCommandButton(
"listTextAssignmentWithPeerReview", $lng->txt(
"exc_show_peer_review"));
72 return ($a_field ==
"udate");
78 if($this->show_peer_review)
80 $peer_data = $this->ass->getAllPeerReviews();
83 include_once
"Services/User/classes/class.ilUserUtil.php";
84 include_once
"Services/RTE/classes/class.ilRTE.php";
87 if(trim($file[
"atext"]))
89 $data[$file[
"user_id"]] = array(
90 "uid" => $file[
"user_id"],
92 "udate" => $file[
"ts"],
96 if(isset($peer_data[$file[
"user_id"]]))
98 $data[$file[
"user_id"]][
"peer"] = $peer_data[$file[
"user_id"]];
110 if($this->show_peer_review && isset($a_set[
"peer"]))
114 foreach($a_set[
"peer"] as $peer_id => $peer_review)
117 $acc_item = $peer_name;
122 $rating->setObject($this->ass->getId(),
"ass", $a_set[
"uid"],
"peer");
123 $rating->setUserId($peer_id);
124 $acc_item .=
" ".$rating->getHTML(
false,
false);
129 $acc_item .=
'<div class="small">'.nl2br($peer_review[0]).
"</div>";
132 $uploads = $this->ass->getPeerUploadFiles($a_set[
"uid"], $peer_id);
135 $acc_item .=
'<div class="small">';
137 $ilCtrl->setParameter($this->parent_obj,
"fu", $peer_id.
"__".$a_set[
"uid"]);
139 foreach($uploads as
$file)
141 $ilCtrl->setParameter($this->parent_obj,
"fuf", md5($file));
142 $dl = $ilCtrl->getLinkTarget($this->parent_obj,
"downloadPeerReview");
143 $ilCtrl->setParameter($this->parent_obj,
"fuf",
"");
145 $acc_item .=
'<a href="'.$dl.
'">'.basename($file).
'</a><br />';
148 $ilCtrl->setParameter($this->parent_obj,
"fu",
"");
150 $acc_item .=
'</div>';
153 $acc_data[$peer_id] = array(
"name" => $peer_name,
"review" => $acc_item);
161 $acc->setId($this->ass->getId().
"_".$a_set[
"uid"]);
164 foreach($acc_data as $acc_item)
166 $acc_html .=
"<li>".$acc_item[
"review"].
"</li>";
168 $acc_html .=
"</ul>";
169 $acc->addItem($this->lng->txt(
"show").
" (".
sizeof($acc_data).
")", $acc_html);
171 $this->tpl->setCurrentBlock(
"peer_bl");
172 $this->tpl->setVariable(
"PEER_REVIEW", $acc->getHTML());
173 $this->tpl->parseCurrentBlock();
177 $this->tpl->setVariable(
"USER_NAME", $a_set[
"uname"]);
178 $this->tpl->setVariable(
"USER_DATE",
180 $this->tpl->setVariable(
"USER_TEXT", $a_set[
"utext"]);
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
getAllDeliveredFiles($a_exc_id, $a_ass_id)
was: getAllDeliveredFiles()
__construct($a_parent_obj, $a_parent_cmd, ilExAssignment $a_ass, $a_show_peer_review=false, $a_disable_peer_review=false)
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
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...
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)
Default behaviour is:
static countGivenFeedback($a_ass_id)
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setLimit($a_limit=0, $a_default_limit=0)
set max.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
static formatDate(ilDateTime $date)
Format a date public.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
numericOrdering($a_field)
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
Accordion user interface class.