public function getHTML()
 {
     global $ilCtrl;
     $rgui = new ilRatingGUI();
     $rgui->setObject($this->getRecord()->getId(), "dcl_record", $this->getField()->getId(), "dcl_field");
     $ilCtrl->setParameterByClass("ilratinggui", "field_id", $this->getField()->getId());
     $ilCtrl->setParameterByClass("ilratinggui", "record_id", $this->getRecord()->getId());
     $html = $rgui->getHTML();
     return $html;
 }
 protected function fillRow($a_set)
 {
     global $ilCtrl;
     if ($this->show_peer_review && isset($a_set["peer"])) {
         $acc_data = array();
         foreach ($a_set["peer"] as $peer_id => $peer_review) {
             $peer_name = ilUserUtil::getNamePresentation($peer_id);
             $acc_item = $peer_name;
             if ($peer_review[1]) {
                 $rating = new ilRatingGUI();
                 $rating->setObject($this->ass->getId(), "ass", $a_set["uid"], "peer");
                 $rating->setUserId($peer_id);
                 $acc_item .= " " . $rating->getHTML(false, false);
             }
             if ($peer_review[0]) {
                 $acc_item .= '<div class="small">' . nl2br($peer_review[0]) . "</div>";
             }
             $uploads = $this->ass->getPeerUploadFiles($a_set["uid"], $peer_id);
             if ($uploads) {
                 $acc_item .= '<div class="small">';
                 $ilCtrl->setParameter($this->parent_obj, "fu", $peer_id . "__" . $a_set["uid"]);
                 foreach ($uploads as $file) {
                     $ilCtrl->setParameter($this->parent_obj, "fuf", md5($file));
                     $dl = $ilCtrl->getLinkTarget($this->parent_obj, "downloadPeerReview");
                     $ilCtrl->setParameter($this->parent_obj, "fuf", "");
                     $acc_item .= '<a href="' . $dl . '">' . basename($file) . '</a><br />';
                 }
                 $ilCtrl->setParameter($this->parent_obj, "fu", "");
                 $acc_item .= '</div>';
             }
             $acc_data[$peer_id] = array("name" => $peer_name, "review" => $acc_item);
         }
         if ($acc_data) {
             $acc_data = ilUtil::sortArray($acc_data, "name", "asc");
             $acc = new ilAccordionGUI();
             $acc->setId($this->ass->getId() . "_" . $a_set["uid"]);
             $acc_html = "<ul>";
             foreach ($acc_data as $acc_item) {
                 $acc_html .= "<li>" . $acc_item["review"] . "</li>";
             }
             $acc_html .= "</ul>";
             $acc->addItem($this->lng->txt("show") . " (" . sizeof($acc_data) . ")", $acc_html);
             $this->tpl->setCurrentBlock("peer_bl");
             $this->tpl->setVariable("PEER_REVIEW", $acc->getHTML());
             $this->tpl->parseCurrentBlock();
         }
     }
     $this->tpl->setVariable("USER_NAME", $a_set["uname"]);
     $this->tpl->setVariable("USER_DATE", ilDatePresentation::formatDate(new ilDate($a_set["udate"], IL_CAL_DATETIME)));
     $this->tpl->setVariable("USER_TEXT", $a_set["utext"]);
 }
예제 #3
0
 function updatePeerReviewCommentsObject()
 {
     global $ilCtrl, $ilUser, $tpl;
     if (!$this->ass || !$this->ass->getPeerReview() || !$this->ass->getDeadline() || $this->ass->getDeadline() - time() > 0 || !sizeof($_POST["pc"]) || !$ilCtrl->isAsynch()) {
         exit;
     }
     $rating_peer_id = $_POST["rating_peer_id"];
     $giver_id = $ilUser->getId();
     // save rating
     include_once './Services/Rating/classes/class.ilRating.php';
     ilRating::writeRatingForUserAndObject($this->ass->getId(), "ass", $rating_peer_id, "peer", $giver_id, $_POST["rating"]);
     // save comments
     foreach ($_POST["pc"] as $peer_id => $value) {
         if ($peer_id) {
             $this->ass->updatePeerReviewComment($peer_id, $value);
         }
     }
     // render current rating
     $ilCtrl->setParameter($this->parent_obj, "peer_id", $rating_peer_id);
     include_once './Services/Rating/classes/class.ilRatingGUI.php';
     $rating = new ilRatingGUI();
     $rating->setObject($this->ass->getId(), "ass", $rating_peer_id, "peer");
     $rating->setUserId($giver_id);
     if (!$_REQUEST["ssrtg"]) {
         echo $rating->getHTML(false, true, "il.ExcPeerReview.saveComments(" . $rating_peer_id . ", %rating%)");
     } else {
         echo '<div id="rtr_widget">' . $rating->getHTML(false, true, "il.ExcPeerReview.saveSingleRating(" . $rating_peer_id . ", %rating%)") . '</div>';
     }
     echo $tpl->getOnLoadCodeForAsynch();
     exit;
 }
 /**
  * Fill table row
  */
 protected function fillRow($d)
 {
     global $lng, $ilCtrl;
     $this->tpl->setVariable("TXT_ASS_TITLE", $d["title"]);
     $file_info = ilExAssignment::getDownloadedFilesInfoForTableGUIS($this->parent_obj, $this->exc_id, $d["type"], $d["id"], $this->part_id, $this->parent_cmd);
     $has_no_team_yet = false;
     if ($d["type"] == ilExAssignment::TYPE_UPLOAD_TEAM) {
         $members = ilExAssignment::getTeamMembersByAssignmentId($d["id"], $this->part_id);
         // #11957
         if (sizeof($members)) {
             $this->tpl->setCurrentBlock("ass_members");
             foreach ($members as $member_id) {
                 $this->tpl->setVariable("TXT_MEMBER_NAME", ilObjUser::_lookupFullname($member_id));
                 $this->tpl->parseCurrentBlock();
             }
             $ilCtrl->setParameter($this->parent_obj, "lpart", $this->part_id);
             $this->tpl->setVariable("HREF_LOG", $ilCtrl->getLinkTarget($this->parent_obj, "showTeamLog"));
             $this->tpl->setVariable("TXT_LOG", $lng->txt("exc_team_log"));
             $ilCtrl->setParameter($this->parent_obj, "lpart", "");
         } else {
             // #11957
             $has_no_team_yet = true;
             $this->tpl->setCurrentBlock("team_info");
             $this->tpl->setVariable("TXT_TEAM_INFO", $lng->txt("exc_no_team_yet"));
             $this->tpl->setVariable("TXT_CREATE_TEAM", $lng->txt("exc_create_team"));
             $ilCtrl->setParameter($this->parent_obj, "ass_id", $d["id"]);
             $ilCtrl->setParameter($this->parent_obj, "lpart", $this->part_id);
             $this->tpl->setVariable("URL_CREATE_TEAM", $ilCtrl->getLinkTarget($this->getParentObject(), "createSingleMemberTeam"));
             $ilCtrl->setParameter($this->parent_obj, "lpart", "");
             $ilCtrl->setParameter($this->parent_obj, "ass_id", "");
             if ($file_info["files"]["count"]) {
                 $this->tpl->setVariable("TEAM_FILES_INFO", "<br />" . $file_info["files"]["txt"] . ": " . $file_info["files"]["count"]);
             }
             $this->tpl->parseCurrentBlock();
         }
     }
     if (!$has_no_team_yet) {
         $this->tpl->setVariable("VAL_CHKBOX", ilUtil::formCheckbox(0, "assid[" . $d["id"] . "]", 1));
         $this->tpl->setVariable("VAL_ID", $d["id"]);
         $this->tpl->setVariable("VAL_LAST_SUBMISSION", $file_info["last_submission"]["value"]);
         $this->tpl->setVariable("TXT_LAST_SUBMISSION", $file_info["last_submission"]["txt"]);
         $this->tpl->setVariable("TXT_SUBMITTED_FILES", $file_info["files"]["txt"]);
         $this->tpl->setVariable("VAL_SUBMITTED_FILES", $file_info["files"]["count"]);
         if ($file_info["files"]["download_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_DOWNLOAD", $file_info["files"]["download_url"]);
             $this->tpl->setVariable("TXT_DOWNLOAD", $file_info["files"]["download_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         if ($file_info["files"]["download_new_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_NEW_DOWNLOAD", $file_info["files"]["download_new_url"]);
             $this->tpl->setVariable("TXT_NEW_DOWNLOAD", $file_info["files"]["download_new_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         // note
         $this->tpl->setVariable("TXT_NOTE", $lng->txt("exc_note_for_tutor"));
         $this->tpl->setVariable("NAME_NOTE", "notice[" . $d["id"] . "]");
         $this->tpl->setVariable("VAL_NOTE", ilUtil::prepareFormOutput(ilExAssignment::lookupNoticeOfUser($d["id"], $this->part_id)));
         // comment for learner
         $lcomment_value = ilExAssignment::lookupCommentForUser($d["id"], $this->part_id);
         $overlay_id = "excasscomm_" . $d["id"] . "_" . $this->part_id;
         $overlay_trigger_id = $overlay_id . "_tr";
         $overlay = new ilOverlayGUI($overlay_id);
         $overlay->setAnchor($overlay_trigger_id);
         $overlay->setTrigger($overlay_trigger_id, "click", $overlay_trigger_id);
         $overlay->add();
         $this->tpl->setVariable("LCOMMENT_ID", $overlay_id . "_snip");
         $this->tpl->setVariable("LCOMMENT_SNIPPET", ilUtil::shortenText($lcomment_value, 25, true));
         $this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_ID", $overlay_trigger_id);
         $this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_TEXT", $lng->txt("exc_comment_for_learner_edit"));
         $lcomment_form = new ilPropertyFormGUI();
         $lcomment_form->setId($overlay_id);
         $lcomment_form->setPreventDoubleSubmission(false);
         $lcomment = new ilTextAreaInputGUI($lng->txt("exc_comment_for_learner"), "lcomment_" . $d["id"] . "_" . $this->part_id);
         $lcomment->setInfo($lng->txt("exc_comment_for_learner_info"));
         $lcomment->setValue($lcomment_value);
         $lcomment->setCols(45);
         $lcomment->setRows(5);
         $lcomment_form->addItem($lcomment);
         //$lcomment_form->addCommandButton("save", $lng->txt("save"));
         // $lcomment_form->addCommandButton("cancel", $lng->txt("cancel"));
         $this->overlay_tpl->setCurrentBlock("overlay_bl");
         $this->overlay_tpl->setVariable("COMMENT_OVERLAY_ID", $overlay_id);
         $this->overlay_tpl->setVariable("COMMENT_OVERLAY_FORM", $lcomment_form->getHTML());
         $this->overlay_tpl->parseCurrentBlock();
         /*			
         $this->tpl->setVariable("TXT_LCOMMENT", $lng->txt("exc_comment_for_learner"));
         $this->tpl->setVariable("NAME_LCOMMENT",
         	"lcomment[".$d["id"]."]");
         $lpcomment = ilExAssignment::lookupCommentForUser($d["id"], $this->part_id);
         $this->tpl->setVariable("VAL_LCOMMENT",
         	ilUtil::prepareFormOutput($lpcomment));
         */
         // solved
         //$this->tpl->setVariable("CHKBOX_SOLVED",
         //	ilUtil::formCheckbox($this->exc->members_obj->getStatusByMember($member_id),"solved[$member_id]",1));
         $status = ilExAssignment::lookupStatusOfUser($d["id"], $this->part_id);
         $this->tpl->setVariable("SEL_" . strtoupper($status), ' selected="selected" ');
         $this->tpl->setVariable("TXT_NOTGRADED", $lng->txt("exc_notgraded"));
         $this->tpl->setVariable("TXT_PASSED", $lng->txt("exc_passed"));
         $this->tpl->setVariable("TXT_FAILED", $lng->txt("exc_failed"));
         if (($sd = ilExAssignment::lookupStatusTimeOfUser($d["id"], $this->part_id)) > 0) {
             $this->tpl->setCurrentBlock("status_date");
             $this->tpl->setVariable("TXT_LAST_CHANGE", $lng->txt("last_change"));
             $this->tpl->setVariable('VAL_STATUS_DATE', ilDatePresentation::formatDate(new ilDateTime($sd, IL_CAL_DATETIME)));
             $this->tpl->parseCurrentBlock();
         }
         switch ($status) {
             case "passed":
                 $pic = "scorm/passed.svg";
                 break;
             case "failed":
                 $pic = "scorm/failed.svg";
                 break;
             default:
                 $pic = "scorm/not_attempted.svg";
                 break;
         }
         $this->tpl->setVariable("IMG_STATUS", ilUtil::getImagePath($pic));
         $this->tpl->setVariable("ALT_STATUS", $lng->txt("exc_" . $status));
         // mark
         $this->tpl->setVariable("TXT_MARK", $lng->txt("exc_mark"));
         $this->tpl->setVariable("NAME_MARK", "mark[" . $d["id"] . "]");
         $mark = ilExAssignment::lookupMarkOfUser($d["id"], $this->part_id);
         $this->tpl->setVariable("VAL_MARK", ilUtil::prepareFormOutput($mark));
         // feedback
         $ilCtrl->setParameter($this->parent_obj, "member_id", $this->part_id);
         if (($ft = ilExAssignment::lookupFeedbackTimeOfUser($d["id"], $this->part_id)) > 0) {
             $this->tpl->setCurrentBlock("feedback_date");
             $this->tpl->setVariable("TXT_FEEDBACK_MAIL_SENT", sprintf($lng->txt("exc_sent_at"), ilDatePresentation::formatDate(new ilDateTime($ft, IL_CAL_DATETIME))));
             $this->tpl->parseCurrentBlock();
         }
         $ilCtrl->setParameter($this, "rcp_to", $this->user->getLogin());
         $this->tpl->setVariable("LINK_FEEDBACK", $ilCtrl->getLinkTarget($this->parent_obj, "redirectFeedbackMail"));
         //"ilias.php?baseClass=ilMailGUI&type=new&rcp_to=".$mem_obj->getLogin());
         $this->tpl->setVariable("TXT_FEEDBACK", $lng->txt("exc_send_mail"));
         $ilCtrl->setParameter($this->parent_obj, "rcp_to", "");
         if ($d["type"] == ilExAssignment::TYPE_UPLOAD_TEAM) {
             $feedback_id = "t" . ilExAssignment::getTeamIdByAssignment($d["id"], $this->part_id);
         } else {
             $feedback_id = $this->part_id;
         }
         $storage = new ilFSStorageExercise($this->exc_id, $d["id"]);
         $cnt_files = $storage->countFeedbackFiles($feedback_id);
         $ilCtrl->setParameter($this->parent_obj, "fsmode", "feedbackpart");
         $this->tpl->setVariable("LINK_FILE_FEEDBACK", $ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"));
         if ($cnt_files == 0) {
             $this->tpl->setVariable("TXT_FILE_FEEDBACK", $lng->txt("exc_add_feedback_file"));
         } else {
             $this->tpl->setVariable("TXT_FILE_FEEDBACK", $lng->txt("exc_fb_files") . " (" . $cnt_files . ")");
         }
         // peer review / rating
         if ($d["type"] != ilExAssignment::TYPE_UPLOAD_TEAM && $d["peer"]) {
             $this->tpl->setCurrentBlock("peer_review_bl");
             $this->tpl->setVariable("TXT_PEER_REVIEW", $lng->txt("exc_peer_review_show"));
             $ilCtrl->setParameter($this->parent_obj, "grd", 2);
             $this->tpl->setVariable("LINK_PEER_REVIEW", $ilCtrl->getLinkTarget($this->parent_obj, "showPersonalPeerReview"));
             $ilCtrl->setParameter($this->parent_obj, "grd", "");
             $rating = new ilRatingGUI();
             $rating->setObject($d["id"], "ass", $this->part_id, "peer");
             $rating->setUserId(0);
             $this->tpl->setVariable("VAL_RATING", $rating->getHTML(true, false));
             $this->tpl->parseCurrentBlock();
         }
         $ilCtrl->setParameter($this->parent_obj, "ass_id", $_GET["ass_id"]);
     } else {
         $this->tpl->touchBlock("member_has_no_team_bl");
     }
 }
 protected function fillRow($a_set)
 {
     global $ilCtrl;
     $this->tpl->setVariable("VAL_SEQ", $a_set["seq"]);
     if ($a_set["tstamp"]) {
         $a_set["tstamp"] = ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"], IL_CAL_DATETIME));
     }
     $this->tpl->setVariable("VAL_TSTAMP", $a_set["tstamp"]);
     // rating
     $ilCtrl->setParameter($this->parent_obj, "peer_id", $a_set["peer_id"]);
     $rating = new ilRatingGUI();
     $rating->setObject($this->ass->getId(), "ass", $a_set["peer_id"], "peer");
     $rating->setUserId($a_set["giver_id"]);
     $this->tpl->setVariable("ID_RATING", "rtr_" . $a_set["peer_id"]);
     if (!$this->read_only) {
         $this->tpl->setVariable("VAL_RATING", $rating->getHTML(false, true, "il.ExcPeerReview.saveComments(" . $a_set["peer_id"] . ", %rating%)"));
     } else {
         $this->tpl->setVariable("VAL_RATING", $rating->getHTML(false, false));
     }
     $ilCtrl->setParameter($this->parent_obj, "peer_id", "");
     // submission
     if (!$this->read_only) {
         $ilCtrl->setParameter($this->parent_obj, "seq", $a_set["seq"]);
         $file_info = ilExAssignment::getDownloadedFilesInfoForTableGUIS($this->parent_obj, $this->ass->getExerciseId(), $this->ass->getType(), $this->ass->getId(), $a_set["peer_id"]);
         $ilCtrl->setParameter($this->parent_obj, "seq", "");
         $this->tpl->setVariable("VAL_LAST_SUBMISSION", $file_info["last_submission"]["value"]);
         $this->tpl->setVariable("TXT_LAST_SUBMISSION", $file_info["last_submission"]["txt"]);
         $this->tpl->setVariable("TXT_SUBMITTED_FILES", $file_info["files"]["txt"]);
         $this->tpl->setVariable("VAL_SUBMITTED_FILES", $file_info["files"]["count"]);
         if ($file_info["files"]["download_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_DOWNLOAD", $file_info["files"]["download_url"]);
             $this->tpl->setVariable("TXT_DOWNLOAD", $file_info["files"]["download_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         if ($file_info["files"]["download_new_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_NEW_DOWNLOAD", $file_info["files"]["download_new_url"]);
             $this->tpl->setVariable("TXT_NEW_DOWNLOAD", $file_info["files"]["download_new_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("pcomment_edit_bl");
         $idx = $a_set["giver_id"] . "__" . $a_set["peer_id"];
         $this->tpl->setVariable("VAL_ID", $idx);
         $this->tpl->setVariable("VAL_PCOMMENT_EDIT", $a_set["comment"]);
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->setCurrentBlock("pcomment_static_bl");
         $this->tpl->setVariable("VAL_PCOMMENT_STATIC", $a_set["comment"]);
         $this->tpl->parseCurrentBlock();
     }
 }
 /**
  * @param ilForumTopic $thread
  */
 public function fillRow(ilForumTopic $thread)
 {
     /**
      * @var $ilUser ilObjUser
      */
     global $ilUser;
     $this->ctrl->setParameter($this->getParentObject(), 'thr_pk', $thread->getId());
     if ('mergeThreads' == $this->parent_cmd) {
         $checked = $this->max_count == 1 || isset($_POST['thread_ids']) && in_array($thread->getId(), $_POST['thread_ids']);
         $this->tpl->setVariable('VAL_CHECK', ilUtil::formRadioButton($checked, 'thread_ids[]', $thread->getId()));
     } else {
         if ('showThreads' == $this->parent_cmd) {
             $this->tpl->setVariable('VAL_CHECK', ilUtil::formCheckbox(isset($_POST['thread_ids']) && in_array($thread->getId(), $_POST['thread_ids']) ? true : false, 'thread_ids[]', $thread->getId()));
             if ($this->parent_obj->objProperties->isIsThreadRatingEnabled()) {
                 $rating = new ilRatingGUI();
                 $rating->setObject($this->parent_obj->object->getId(), $this->parent_obj->object->getType(), $thread->getId(), 'thread');
                 $rating->setUserId($ilUser->getId());
                 $this->tpl->setVariable('VAL_RATING', $rating->getHTML());
             }
         } else {
             if ($thread->isSticky()) {
                 $this->tpl->setVariable('VAL_SORTING_NAME', 'thread_sorting[' . $thread->getId() . ']');
                 $this->tpl->setVariable('VAL_SORTING', (int) $this->position * 10);
             } else {
                 $this->tpl->setVariable('VAL_CHECK', '');
             }
             $this->position++;
         }
     }
     $subject = '';
     if ($thread->isSticky()) {
         $subject .= '<span class="light">[' . $this->lng->txt('sticky') . ']</span> ';
     }
     if ($thread->isClosed()) {
         $subject .= '<span class="light">[' . $this->lng->txt('topic_close') . ']</span> ';
     }
     if (!$ilUser->isAnonymous() && $this->ilias->getSetting('forum_notification') != 0 && $thread->getUserNotificationEnabled()) {
         $subject .= '<span class="light">[' . $this->lng->txt('forums_notification_enabled') . ']</span> ';
     }
     $num_posts = $thread->getNumPosts();
     $num_unread = $thread->getNumUnreadPosts();
     $num_new = $thread->getNumNewPosts();
     if ($num_posts > 0) {
         $subject = '<div><a href="' . $this->ctrl->getLinkTarget($this->getParentObject(), 'viewThread') . '">' . $thread->getSubject() . '</a></div>' . $subject;
     } else {
         $subject = $thread->getSubject() . $subject;
     }
     $this->tpl->setVariable('VAL_SUBJECT', $subject);
     // Author
     $this->ctrl->setParameter($this->getParentObject(), 'backurl', urlencode($this->ctrl->getLinkTargetByClass("ilrepositorygui", "")));
     $this->ctrl->setParameter($this->getParentObject(), 'user', $thread->getDisplayUserId());
     $authorinfo = new ilForumAuthorInformation($thread->getThrAuthorId(), $thread->getDisplayUserId(), $thread->getUserAlias(), $thread->getImportName(), array('class' => 'il_ItemProperty', 'href' => $this->ctrl->getLinkTarget($this->getParentObject(), 'showUser')));
     $this->tpl->setVariable('VAL_AUTHOR', $authorinfo->getLinkedAuthorName());
     $topicStats = $num_posts;
     if (!$ilUser->isAnonymous()) {
         if ($num_unread > 0) {
             $topicStats .= '<br /><span class="ilAlert ilWhiteSpaceNowrap">' . $this->lng->txt('unread') . ': ' . $num_unread . '</span>';
         }
         if ($num_new > 0 && $this->getOverviewSetting() == 0) {
             $topicStats .= '<br /><span class="ilAlert ilWhiteSpaceNowrap">' . $this->lng->txt('new') . ': ' . $num_new . '</span>';
         }
     }
     $this->tpl->setVariable('VAL_ARTICLE_STATS', $topicStats);
     $this->tpl->setVariable('VAL_NUM_VISIT', $thread->getVisits());
     // Last posting
     if ($num_posts > 0) {
         if ($this->getIsModerator()) {
             $objLastPost = $thread->getLastPost();
         } else {
             $objLastPost = $thread->getLastActivePost();
         }
         if (is_object($objLastPost)) {
             $authorinfo = new ilForumAuthorInformation($objLastPost->getPosAuthorId(), $objLastPost->getDisplayUserId(), $objLastPost->getUserAlias(), $objLastPost->getImportName(), array('href' => $this->ctrl->getLinkTarget($this->getParentObject(), 'viewThread') . '#' . $objLastPost->getId()));
             $this->tpl->setVariable('VAL_LP_DATE', '<div class="ilWhiteSpaceNowrap">' . ilDatePresentation::formatDate(new ilDateTime($objLastPost->getCreateDate(), IL_CAL_DATETIME)) . '</div>' . '<div class="ilWhiteSpaceNowrap">' . $this->lng->txt('from') . ' ' . $authorinfo->getLinkedAuthorName() . '</div>');
         }
     }
     // Row style
     $css_row = $this->css_row;
     if ($thread->isSticky()) {
         $css_row = $css_row == 'tblrow1' ? 'tblstickyrow1' : 'tblstickyrow2';
     }
     $this->tpl->setVariable('CSS_ROW', $css_row);
     $this->ctrl->setParameter($this->getParentObject(), 'thr_pk', '');
     $this->ctrl->setParameter($this->getParentObject(), 'user', '');
     $this->ctrl->setParameter($this->getParentObject(), 'backurl', '');
 }
 /**
  * Fill table row
  */
 protected function fillRow($member)
 {
     global $lng, $ilCtrl;
     include_once "./Services/Object/classes/class.ilObjectFactory.php";
     $member_id = $member["usr_id"];
     if (!($mem_obj = ilObjectFactory::getInstanceByObjId($member_id, false))) {
         return;
     }
     $has_no_team_yet = substr($member["team_id"], 0, 3) == "nty";
     if (!$has_no_team_yet) {
         // mail sent
         if ($this->sent_col) {
             if (ilExAssignment::lookupStatusSentOfUser($this->ass_id, $member_id)) {
                 $this->tpl->setCurrentBlock("mail_sent");
                 if (($st = ilExAssignment::lookupSentTimeOfUser($this->ass_id, $member_id)) > 0) {
                     $this->tpl->setVariable("TXT_MAIL_SENT", sprintf($lng->txt("exc_sent_at"), ilDatePresentation::formatDate(new ilDateTime($st, IL_CAL_DATETIME))));
                 } else {
                     $this->tpl->setVariable("TXT_MAIL_SENT", $lng->txt("sent"));
                 }
                 $this->tpl->parseCurrentBlock();
             } else {
                 $this->tpl->setCurrentBlock("mail_sent");
                 $this->tpl->setVariable("TXT_MAIL_SENT", "&nbsp;");
                 $this->tpl->parseCurrentBlock();
             }
         }
         // checkbox
         $this->tpl->setVariable("VAL_CHKBOX", ilUtil::formCheckbox(0, "member[{$member_id}]", 1));
         $this->tpl->setVariable("VAL_ID", $member_id);
     }
     $file_info = ilExAssignment::getDownloadedFilesInfoForTableGUIS($this->parent_obj, $this->exc_id, $this->type, $this->ass_id, $member_id, $this->parent_cmd);
     // name and login
     if (!isset($member["team"])) {
         $this->tpl->setVariable("TXT_NAME", $member["name"]);
         if (in_array("login", $this->selected)) {
             $this->tpl->setVariable("TXT_LOGIN", "[" . $member["login"] . "]");
         }
         if (in_array("image", $this->selected)) {
             // image
             $this->tpl->setVariable("USR_IMAGE", $mem_obj->getPersonalPicturePath("xxsmall"));
             $this->tpl->setVariable("USR_ALT", $lng->txt("personal_picture"));
         }
     } else {
         $this->tpl->setCurrentBlock("team_member");
         asort($member["team"]);
         foreach ($member["team"] as $member_name) {
             $this->tpl->setVariable("TXT_MEMBER_NAME", $member_name);
             $this->tpl->parseCurrentBlock();
         }
         if (!$has_no_team_yet) {
             $this->tpl->setCurrentBlock("team_log");
             $ilCtrl->setParameter($this->parent_obj, "lmem", $member_id);
             $this->tpl->setVariable("HREF_LOG", $ilCtrl->getLinkTarget($this->parent_obj, "showTeamLog"));
             $this->tpl->setVariable("TXT_LOG", $lng->txt("exc_team_log"));
             $ilCtrl->setParameter($this->parent_obj, "lmem", "");
             $this->tpl->parseCurrentBlock();
         } else {
             // #11957
             $this->tpl->setCurrentBlock("team_info");
             $this->tpl->setVariable("TXT_TEAM_INFO", $lng->txt("exc_no_team_yet"));
             $this->tpl->setVariable("TXT_CREATE_TEAM", $lng->txt("exc_create_team"));
             $ilCtrl->setParameter($this->parent_obj, "lmem", $member_id);
             $this->tpl->setVariable("URL_CREATE_TEAM", $ilCtrl->getLinkTarget($this->getParentObject(), "createSingleMemberTeam"));
             $ilCtrl->setParameter($this->parent_obj, "lmem", "");
             if ($file_info["files"]["count"]) {
                 $this->tpl->setVariable("TEAM_FILES_INFO", "<br />" . $file_info["files"]["txt"] . ": " . $file_info["files"]["count"]);
             }
             $this->tpl->parseCurrentBlock();
         }
     }
     if (!$has_no_team_yet) {
         $this->tpl->setVariable("VAL_LAST_SUBMISSION", $file_info["last_submission"]["value"]);
         $this->tpl->setVariable("TXT_LAST_SUBMISSION", $file_info["last_submission"]["txt"]);
         $this->tpl->setVariable("TXT_SUBMITTED_FILES", $file_info["files"]["txt"]);
         $this->tpl->setVariable("VAL_SUBMITTED_FILES", $file_info["files"]["count"]);
         if ($file_info["files"]["download_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_DOWNLOAD", $file_info["files"]["download_url"]);
             $this->tpl->setVariable("TXT_DOWNLOAD", $file_info["files"]["download_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         if ($file_info["files"]["download_new_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_NEW_DOWNLOAD", $file_info["files"]["download_new_url"]);
             $this->tpl->setVariable("TXT_NEW_DOWNLOAD", $file_info["files"]["download_new_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         // note
         $this->tpl->setVariable("TXT_NOTE", $lng->txt("exc_note_for_tutor"));
         $this->tpl->setVariable("NAME_NOTE", "notice[{$member_id}]");
         $this->tpl->setVariable("VAL_NOTE", ilUtil::prepareFormOutput(ilExAssignment::lookupNoticeOfUser($this->ass_id, $member_id)));
         // comment for learner
         $lcomment_value = ilExAssignment::lookupCommentForUser($this->ass_id, $member_id);
         $overlay_id = "excasscomm_" . $this->ass_id . "_" . $member_id;
         $overlay_trigger_id = $overlay_id . "_tr";
         $overlay = new ilOverlayGUI($overlay_id);
         $overlay->setAnchor($overlay_trigger_id);
         $overlay->setTrigger($overlay_trigger_id, "click", $overlay_trigger_id);
         $overlay->add();
         $this->tpl->setVariable("LCOMMENT_ID", $overlay_id . "_snip");
         $this->tpl->setVariable("LCOMMENT_SNIPPET", ilUtil::shortenText($lcomment_value, 25, true));
         $this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_ID", $overlay_trigger_id);
         $this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_TEXT", $lng->txt("exc_comment_for_learner_edit"));
         $lcomment_form = new ilPropertyFormGUI();
         $lcomment_form->setId($overlay_id);
         $lcomment_form->setPreventDoubleSubmission(false);
         $lcomment = new ilTextAreaInputGUI($lng->txt("exc_comment_for_learner"), "lcomment_" . $this->ass_id . "_" . $member_id);
         $lcomment->setInfo($lng->txt("exc_comment_for_learner_info"));
         $lcomment->setValue($lcomment_value);
         $lcomment->setCols(45);
         $lcomment->setRows(10);
         $lcomment_form->addItem($lcomment);
         $lcomment_form->addCommandButton("save", $lng->txt("save"));
         // $lcomment_form->addCommandButton("cancel", $lng->txt("cancel"));
         $this->overlay_tpl->setCurrentBlock("overlay_bl");
         $this->overlay_tpl->setVariable("COMMENT_OVERLAY_ID", $overlay_id);
         $this->overlay_tpl->setVariable("COMMENT_OVERLAY_FORM", $lcomment_form->getHTML());
         $this->overlay_tpl->parseCurrentBlock();
         // solved
         //$this->tpl->setVariable("CHKBOX_SOLVED",
         //	ilUtil::formCheckbox($this->exc->members_obj->getStatusByMember($member_id),"solved[$member_id]",1));
         $status = ilExAssignment::lookupStatusOfUser($this->ass_id, $member_id);
         $this->tpl->setVariable("SEL_" . strtoupper($status), ' selected="selected" ');
         $this->tpl->setVariable("TXT_NOTGRADED", $lng->txt("exc_notgraded"));
         $this->tpl->setVariable("TXT_PASSED", $lng->txt("exc_passed"));
         $this->tpl->setVariable("TXT_FAILED", $lng->txt("exc_failed"));
         if (($sd = ilExAssignment::lookupStatusTimeOfUser($this->ass_id, $member_id)) > 0) {
             $this->tpl->setCurrentBlock("status_date");
             $this->tpl->setVariable("TXT_LAST_CHANGE", $lng->txt("last_change"));
             $this->tpl->setVariable('VAL_STATUS_DATE', ilDatePresentation::formatDate(new ilDateTime($sd, IL_CAL_DATETIME)));
             $this->tpl->parseCurrentBlock();
         }
         switch ($status) {
             case "passed":
                 $pic = "scorm/passed.svg";
                 break;
             case "failed":
                 $pic = "scorm/failed.svg";
                 break;
             default:
                 $pic = "scorm/not_attempted.svg";
                 break;
         }
         $this->tpl->setVariable("IMG_STATUS", ilUtil::getImagePath($pic));
         $this->tpl->setVariable("ALT_STATUS", $lng->txt("exc_" . $status));
         // mark
         $this->tpl->setVariable("TXT_MARK", $lng->txt("exc_mark"));
         $this->tpl->setVariable("NAME_MARK", "mark[{$member_id}]");
         $mark = ilExAssignment::lookupMarkOfUser($this->ass_id, $member_id);
         $this->tpl->setVariable("VAL_MARK", ilUtil::prepareFormOutput($mark));
         // feedback
         $ilCtrl->setParameter($this->parent_obj, "member_id", $member_id);
         if (($ft = ilExAssignment::lookupFeedbackTimeOfUser($this->ass_id, $member_id)) > 0) {
             $this->tpl->setCurrentBlock("feedback_date");
             $this->tpl->setVariable("TXT_FEEDBACK_MAIL_SENT", sprintf($lng->txt("exc_sent_at"), ilDatePresentation::formatDate(new ilDateTime($ft, IL_CAL_DATETIME))));
             $this->tpl->parseCurrentBlock();
         }
         // feedback mail
         $this->tpl->setVariable("LINK_FEEDBACK", $ilCtrl->getLinkTarget($this->parent_obj, "redirectFeedbackMail"));
         $this->tpl->setVariable("TXT_FEEDBACK", $lng->txt("exc_send_mail"));
         if ($this->type == ilExAssignment::TYPE_UPLOAD_TEAM) {
             $feedback_id = "t" . $member["team_id"];
         } else {
             $feedback_id = $member_id;
         }
         // file feedback
         $cnt_files = $this->storage->countFeedbackFiles($feedback_id);
         $ilCtrl->setParameter($this->parent_obj, "fsmode", "feedback");
         $this->tpl->setVariable("LINK_FILE_FEEDBACK", $ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"));
         if ($cnt_files == 0) {
             $this->tpl->setVariable("TXT_FILE_FEEDBACK", $lng->txt("exc_add_feedback_file"));
         } else {
             $this->tpl->setVariable("TXT_FILE_FEEDBACK", $lng->txt("exc_fb_files") . " (" . $cnt_files . ")");
         }
         // peer review / rating
         if (!isset($member["team"]) && $this->peer_review) {
             $this->tpl->setCurrentBlock("peer_review_bl");
             $this->tpl->setVariable("TXT_PEER_REVIEW", $lng->txt("exc_peer_review_show"));
             $ilCtrl->setParameter($this->parent_obj, "grd", 1);
             $this->tpl->setVariable("LINK_PEER_REVIEW", $ilCtrl->getLinkTarget($this->parent_obj, "showPersonalPeerReview"));
             $ilCtrl->setParameter($this->parent_obj, "grd", "");
             $rating = new ilRatingGUI();
             $rating->setObject($this->ass_id, "ass", $member_id, "peer");
             $rating->setUserId(0);
             $this->tpl->setVariable("VAL_RATING", $rating->getHTML(true, false));
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->touchBlock("member_has_no_team_bl");
     }
 }
 protected function fillRow($a_set)
 {
     global $ilCtrl;
     if (isset($a_set["seq"])) {
         $this->tpl->setVariable("VAL_SEQ", $a_set["seq"]);
     } else {
         $this->tpl->setVariable("VAL_SEQ", $a_set["name"]);
     }
     if ($a_set["tstamp"]) {
         $a_set["tstamp"] = ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"], IL_CAL_DATETIME));
     }
     $this->tpl->setVariable("VAL_TSTAMP", $a_set["tstamp"]);
     // rating
     $ilCtrl->setParameter($this->parent_obj, "peer_id", $a_set["peer_id"]);
     $rating = new ilRatingGUI();
     $rating->setObject($this->ass->getId(), "ass", $a_set["peer_id"], "peer");
     $rating->setUserId($a_set["giver_id"]);
     $this->tpl->setVariable("ID_RATING", "rtr_" . $a_set["peer_id"]);
     if (!$this->read_only) {
         $this->tpl->setVariable("VAL_RATING", $rating->getHTML(false, true, "il.ExcPeerReview.saveComments(" . $a_set["peer_id"] . ", %rating%)"));
     } else {
         $this->tpl->setVariable("VAL_RATING", $rating->getHTML(false, false));
     }
     $ilCtrl->setParameter($this->parent_obj, "peer_id", "");
     // submission
     $uploads = null;
     if ($this->ass->hasPeerReviewFileUpload()) {
         $path = $this->fstorage->getPeerReviewUploadPath($a_set["peer_id"], $a_set["giver_id"]);
         $uploads = glob($path . "/*.*");
     }
     if (!$this->read_only) {
         $ilCtrl->setParameter($this->parent_obj, "seq", $a_set["seq"]);
         $file_info = ilExAssignment::getDownloadedFilesInfoForTableGUIS($this->parent_obj, $this->ass->getExerciseId(), $this->ass->getType(), $this->ass->getId(), $a_set["peer_id"]);
         $ilCtrl->setParameter($this->parent_obj, "seq", "");
         $this->tpl->setVariable("VAL_LAST_SUBMISSION", $file_info["last_submission"]["value"]);
         $this->tpl->setVariable("TXT_LAST_SUBMISSION", $file_info["last_submission"]["txt"]);
         $this->tpl->setVariable("TXT_SUBMITTED_FILES", $file_info["files"]["txt"]);
         $this->tpl->setVariable("VAL_SUBMITTED_FILES", $file_info["files"]["count"]);
         if ($file_info["files"]["download_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_DOWNLOAD", $file_info["files"]["download_url"]);
             $this->tpl->setVariable("TXT_DOWNLOAD", $file_info["files"]["download_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         if ($file_info["files"]["download_new_url"]) {
             $this->tpl->setCurrentBlock("download_link");
             $this->tpl->setVariable("LINK_NEW_DOWNLOAD", $file_info["files"]["download_new_url"]);
             $this->tpl->setVariable("TXT_NEW_DOWNLOAD", $file_info["files"]["download_new_txt"]);
             $this->tpl->parseCurrentBlock();
         }
         $idx = $a_set["giver_id"] . "__" . $a_set["peer_id"];
         // file edit link
         if ($this->ass->hasPeerReviewFileUpload()) {
             $ilCtrl->setParameter($this->parent_obj, "fu", $idx);
             $ilCtrl->setParameter($this->parent_obj, "fsmode", "peer");
             $url = $ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles");
             $ilCtrl->setParameter($this->parent_obj, "fsmode", "");
             $ilCtrl->setParameter($this->parent_obj, "fu", "");
             $this->tpl->setCurrentBlock("file_edit_bl");
             $this->tpl->setVariable("FILE_EDIT_URL", $url);
             $this->tpl->setVariable("FILE_EDIT_CAPTION", $uploads ? $this->lng->txt("exc_peer_edit_file") : $this->lng->txt("exc_peer_upload_file"));
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("pcomment_edit_bl");
         $this->tpl->setVariable("VAL_ID", $idx);
         $this->tpl->setVariable("VAL_PCOMMENT_EDIT", $a_set["comment"]);
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->setCurrentBlock("pcomment_static_bl");
         $this->tpl->setVariable("VAL_PCOMMENT_STATIC", $a_set["comment"]);
         $this->tpl->parseCurrentBlock();
     }
     // list existing files
     if ($uploads) {
         $idx = $a_set["giver_id"] . "__" . $a_set["peer_id"];
         $ilCtrl->setParameter($this->parent_obj, "fu", $idx);
         foreach ($uploads as $upload) {
             $ilCtrl->setParameter($this->parent_obj, "fuf", md5($upload));
             $url = $ilCtrl->getLinkTarget($this->parent_obj, "downloadPeerReview");
             $ilCtrl->setParameter($this->parent_obj, "fuf", "");
             $this->tpl->setCurrentBlock("file_static_bl");
             $this->tpl->setVariable("FILE_NAME", basename($upload));
             $this->tpl->setVariable("FILE_URL", $url);
             $this->tpl->parseCurrentBlock();
         }
         $ilCtrl->setParameter($this->parent_obj, "fu", "");
     }
 }