4 include_once 
'./Services/Table/classes/class.ilTable2GUI.php';
 
    5 include_once 
'./Modules/Exercise/classes/class.ilExAssignment.php';
 
    6 include_once 
'./Services/Rating/classes/class.ilRatingGUI.php';
 
   33         public function  __construct($a_parent_obj, $a_parent_cmd, 
ilExAssignment $a_ass, $a_user_id, array $a_peer_data, $a_title, $a_cancel_cmd, $a_read_only = 
false)
 
   38                 $this->user_id = $a_user_id;
 
   39                 $this->peer_data = $a_peer_data;
 
   40                 $this->read_only = $a_read_only;
 
   46                 $this->
addColumn($this->lng->txt(
"id"), 
"seq");
 
   49                         $this->
addColumn($this->lng->txt(
"exc_submission"), 
"");
 
   51                 $this->
addColumn($this->lng->txt(
"exc_peer_review_rating"), 
"mark");
 
   52                 $this->
addColumn($this->lng->txt(
"exc_peer_review_comment"), 
"");
 
   53                 $this->
addColumn($this->lng->txt(
"last_update"), 
"tstamp");
 
   57                 $this->
setRowTemplate(
"tpl.exc_peer_review_row.html", 
"Modules/Exercise");
 
   58                 $this->
setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
 
   60                 $this->
setTitle($a_ass->
getTitle().
": ".$this->lng->txt(
"exc_peer_review").
" - ".$this->lng->txt($a_title));
 
   77                 foreach($this->peer_data as $idx => $item)
 
   82                         $row[
"giver_id"] = $item[
"giver_id"];
 
   83                         $row[
"peer_id"] = $item[
"peer_id"];
 
   84                         $row[
"submission"] = 
"";
 
   86                                 "ass", $item[
"peer_id"], 
"peer", $item[
"giver_id"]));
 
   87                         $row[
"comment"] = $item[
"pcomment"];
 
   88                         $row[
"tstamp"] = $item[
"tstamp"];                                       
 
   98                 if(in_array($a_field, array(
"mark", 
"tstamp")))
 
  109                 $this->tpl->setVariable(
"VAL_SEQ", $a_set[
"seq"]);              
 
  115                 $this->tpl->setVariable(
"VAL_TSTAMP", $a_set[
"tstamp"]);        
 
  119                 $ilCtrl->setParameter($this->parent_obj, 
"peer_id", $a_set[
"peer_id"]);         
 
  121                 $rating->setObject($this->ass->getId(), 
"ass", $a_set[
"peer_id"], 
"peer");
 
  122                 $rating->setUserId($a_set[
"giver_id"]);
 
  123                 $this->tpl->setVariable(
"ID_RATING", 
"rtr_".$a_set[
"peer_id"]);
 
  124                 if(!$this->read_only)
 
  126                         $this->tpl->setVariable(
"VAL_RATING", $rating->getHTML(
false, 
true, 
 
  127                                 "il.ExcPeerReview.saveComments(".$a_set[
"peer_id"].
", %rating%)"));     
 
  131                         $this->tpl->setVariable(
"VAL_RATING", $rating->getHTML(
false, 
false));  
 
  133                 $ilCtrl->setParameter($this->parent_obj, 
"peer_id", 
"");                
 
  138                 if(!$this->read_only)
 
  140                         $ilCtrl->setParameter($this->parent_obj, 
"seq", $a_set[
"seq"]);
 
  144                         $ilCtrl->setParameter($this->parent_obj, 
"seq", 
"");
 
  146                         $this->tpl->setVariable(
"VAL_LAST_SUBMISSION", $file_info[
"last_submission"][
"value"]);
 
  147                         $this->tpl->setVariable(
"TXT_LAST_SUBMISSION", $file_info[
"last_submission"][
"txt"]);
 
  149                         $this->tpl->setVariable(
"TXT_SUBMITTED_FILES", $file_info[
"files"][
"txt"]);
 
  150                         $this->tpl->setVariable(
"VAL_SUBMITTED_FILES", $file_info[
"files"][
"count"]);
 
  152                         if($file_info[
"files"][
"download_url"])
 
  154                                 $this->tpl->setCurrentBlock(
"download_link");
 
  155                                 $this->tpl->setVariable(
"LINK_DOWNLOAD", $file_info[
"files"][
"download_url"]);
 
  156                                 $this->tpl->setVariable(
"TXT_DOWNLOAD", $file_info[
"files"][
"download_txt"]);           
 
  157                                 $this->tpl->parseCurrentBlock();
 
  160                         if($file_info[
"files"][
"download_new_url"])
 
  162                                 $this->tpl->setCurrentBlock(
"download_link");
 
  163                                 $this->tpl->setVariable(
"LINK_NEW_DOWNLOAD", $file_info[
"files"][
"download_new_url"]);
 
  164                                 $this->tpl->setVariable(
"TXT_NEW_DOWNLOAD", $file_info[
"files"][
"download_new_txt"]);           
 
  165                                 $this->tpl->parseCurrentBlock();
 
  169                         $this->tpl->setCurrentBlock(
"pcomment_edit_bl");                                
 
  170                         $idx = $a_set[
"giver_id"].
"__".$a_set[
"peer_id"];
 
  171                         $this->tpl->setVariable(
"VAL_ID", $idx);                
 
  172                         $this->tpl->setVariable(
"VAL_PCOMMENT_EDIT", $a_set[
"comment"]);        
 
  173                         $this->tpl->parseCurrentBlock();        
 
  177                         $this->tpl->setCurrentBlock(
"pcomment_static_bl");
 
  178                         $this->tpl->setVariable(
"VAL_PCOMMENT_STATIC", $a_set[
"comment"]);              
 
  179                         $this->tpl->parseCurrentBlock();