/** * Save status of selecte members */ function saveStatusObject($a_part_view = false, $a_force_all = false) { global $ilCtrl; $this->checkPermission("write"); include_once "./Modules/Exercise/classes/class.ilExAssignment.php"; // include_once 'Services/Tracking/classes/class.ilLPMarks.php'; $saved_for = array(); foreach ($_POST["id"] as $key => $value) { if (!$a_part_view) { if (!$a_force_all && $_POST["member"][$key] != "1") { continue; } else { $uname = ilObjUser::_lookupName($key); $saved_for[] = $uname["lastname"] . ", " . $uname["firstname"]; } } if (!$a_part_view) { $ass_id = (int) $_GET["ass_id"]; $user_id = (int) $key; } else { $ass_id = (int) $key; $user_id = (int) $_GET["part_id"]; } // team upload? if (is_object($this->ass) and $this->ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) { $team_id = $this->ass->getTeamId($user_id); $user_ids = $this->ass->getTeamMembers($team_id); if (count($_POST["member"]) > 0) { foreach ($user_ids as $user_id) { if ($user_id != $key) { $uname = ilObjUser::_lookupName($user_id); $saved_for[] = $uname["lastname"] . ", " . $uname["firstname"]; } } } } else { $user_ids = array($user_id); } foreach ($user_ids as $user_id) { ilExAssignment::updateStatusOfUser($ass_id, $user_id, ilUtil::stripSlashes($_POST["status"][$key])); ilExAssignment::updateNoticeForUser($ass_id, $user_id, ilUtil::stripSlashes($_POST["notice"][$key])); if (ilUtil::stripSlashes($_POST['mark'][$key]) != ilExAssignment::lookupMarkOfUser($ass_id, $user_id)) { ilExAssignment::updateStatusTimeOfUser($ass_id, $user_id); } ilExAssignment::updateMarkOfUser($ass_id, $user_id, ilUtil::stripSlashes($_POST['mark'][$key])); /* ilExAssignment::updateCommentForUser($ass_id, $user_id, ilUtil::stripSlashes($_POST['lcomment'][$key])); */ } } if (count($saved_for) > 0) { $save_for_str = "(" . implode($saved_for, " - ") . ")"; } if ($save_for_str || $a_part_view) { ilUtil::sendSuccess($this->lng->txt("exc_status_saved") . " " . $save_for_str, true); } if (!$a_part_view) { $ilCtrl->redirect($this, "members"); } else { $ilCtrl->redirect($this, "showParticipant"); } }
/** * Exports grades as excel */ function exportGradesExcel() { include_once "./Modules/Exercise/classes/class.ilExAssignment.php"; $ass_data = ilExAssignment::getAssignmentDataOfExercise($this->getId()); include_once "./Services/Excel/classes/class.ilExcelWriterAdapter.php"; $excelfile = ilUtil::ilTempnam(); $adapter = new ilExcelWriterAdapter($excelfile, FALSE); $workbook = $adapter->getWorkbook(); $workbook->setVersion(8); // Use Excel97/2000 Format include_once "./Services/Excel/classes/class.ilExcelUtils.php"; // // status // $mainworksheet = $workbook->addWorksheet(); // header row $mainworksheet->writeString(0, 0, ilExcelUtils::_convert_text($this->lng->txt("name"))); $cnt = 1; foreach ($ass_data as $ass) { $mainworksheet->writeString(0, $cnt, $cnt); $cnt++; } $mainworksheet->writeString(0, $cnt, ilExcelUtils::_convert_text($this->lng->txt("exc_total_exc"))); // data rows $this->mem_obj = new ilExerciseMembers($this); $getmems = $this->mem_obj->getMembers(); $mems = array(); foreach ($getmems as $user_id) { $mems[$user_id] = ilObjUser::_lookupName($user_id); } $mems = ilUtil::sortArray($mems, "lastname", "asc", false, true); $data = array(); $row_cnt = 1; foreach ($mems as $user_id => $d) { $col_cnt = 1; // name $mainworksheet->writeString($row_cnt, 0, ilExcelUtils::_convert_text($d["lastname"] . ", " . $d["firstname"] . " [" . $d["login"] . "]")); reset($ass_data); foreach ($ass_data as $ass) { $status = ilExAssignment::lookupStatusOfUser($ass["id"], $user_id); $mainworksheet->writeString($row_cnt, $col_cnt, ilExcelUtils::_convert_text($this->lng->txt("exc_" . $status))); $col_cnt++; } // total status $status = ilExerciseMembers::_lookupStatus($this->getId(), $user_id); $mainworksheet->writeString($row_cnt, $col_cnt, ilExcelUtils::_convert_text($this->lng->txt("exc_" . $status))); $row_cnt++; } // // mark // $worksheet2 = $workbook->addWorksheet(); // header row $worksheet2->writeString(0, 0, ilExcelUtils::_convert_text($this->lng->txt("name"))); $cnt = 1; foreach ($ass_data as $ass) { $worksheet2->writeString(0, $cnt, $cnt); $cnt++; } $worksheet2->writeString(0, $cnt, ilExcelUtils::_convert_text($this->lng->txt("exc_total_exc"))); // data rows $data = array(); $row_cnt = 1; reset($mems); foreach ($mems as $user_id => $d) { $col_cnt = 1; $d = ilObjUser::_lookupName($user_id); // name $worksheet2->writeString($row_cnt, 0, ilExcelUtils::_convert_text($d["lastname"] . ", " . $d["firstname"] . " [" . $d["login"] . "]")); reset($ass_data); foreach ($ass_data as $ass) { $worksheet2->writeString($row_cnt, $col_cnt, ilExcelUtils::_convert_text(ilExAssignment::lookupMarkOfUser($ass["id"], $user_id))); $col_cnt++; } // total mark include_once 'Services/Tracking/classes/class.ilLPMarks.php'; $worksheet2->writeString($row_cnt, $col_cnt, ilExcelUtils::_convert_text(ilLPMarks::_lookupMark($user_id, $this->getId()))); $row_cnt++; } $workbook->close(); $exc_name = ilUtil::getASCIIFilename(preg_replace("/\\s/", "_", $this->getTitle())); ilUtil::deliverFile($excelfile, $exc_name . ".xls", "application/vnd.ms-excel"); }
/** * 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; } // 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_DATE)))); } 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", " "); $this->tpl->parseCurrentBlock(); } } // checkbox $this->tpl->setVariable("VAL_CHKBOX", ilUtil::formCheckbox(0, "member[{$member_id}]", 1)); $this->tpl->setVariable("VAL_ID", $member_id); // name and login if (!isset($member["team"])) { $this->tpl->setVariable("TXT_NAME", $member["name"]); $this->tpl->setVariable("TXT_LOGIN", "[" . $member["login"] . "]"); // 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(); } $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", ""); } // submission: // see if files have been resubmmited after solved $last_sub = ilExAssignment::getLastSubmission($this->ass_id, $member_id); if ($last_sub) { $last_sub = ilDatePresentation::formatDate(new ilDateTime($last_sub, IL_CAL_DATETIME)); } else { $last_sub = "---"; } if (ilExAssignment::lookupUpdatedSubmission($this->ass_id, $member_id) == 1) { $last_sub = "<b>" . $last_sub . "</b>"; } $this->tpl->setVariable("VAL_LAST_SUBMISSION", $last_sub); $this->tpl->setVariable("TXT_LAST_SUBMISSION", $lng->txt("exc_last_submission")); switch ($this->type) { case ilExAssignment::TYPE_UPLOAD_TEAM: // data is merged by team - see above // fallthrough // data is merged by team - see above // fallthrough case ilExAssignment::TYPE_UPLOAD: // nr of submitted files $this->tpl->setVariable("TXT_SUBMITTED_FILES", $lng->txt("exc_files_returned")); //$sub_cnt = count($this->exc->getDeliveredFiles($member_id, $this->ass_id)); $sub_cnt = count(ilExAssignment::getDeliveredFiles($this->exc_id, $this->ass_id, $member_id)); $new = ilExAssignment::lookupNewFiles($this->ass_id, $member_id); if (count($new) > 0) { $sub_cnt .= " " . sprintf($lng->txt("cnt_new"), count($new)); } $this->tpl->setVariable("VAL_SUBMITTED_FILES", $sub_cnt); // download command $ilCtrl->setParameter($this->parent_obj, "member_id", $member_id); if ($sub_cnt > 0) { $this->tpl->setCurrentBlock("download_link"); $this->tpl->setVariable("LINK_DOWNLOAD", $ilCtrl->getLinkTarget($this->parent_obj, "downloadReturned")); if (count($new) <= 0) { $this->tpl->setVariable("TXT_DOWNLOAD", $lng->txt("exc_download_files")); } else { $this->tpl->setVariable("TXT_DOWNLOAD", $lng->txt("exc_download_all")); } $this->tpl->parseCurrentBlock(); // download new files only if (count($new) > 0) { $this->tpl->setCurrentBlock("download_link"); $this->tpl->setVariable("LINK_NEW_DOWNLOAD", $ilCtrl->getLinkTarget($this->parent_obj, "downloadNewReturned")); $this->tpl->setVariable("TXT_NEW_DOWNLOAD", $lng->txt("exc_download_new")); $this->tpl->parseCurrentBlock(); } } break; case ilExAssignment::TYPE_BLOG: $has_submitted = false; $this->tpl->setVariable("TXT_SUBMITTED_FILES", $lng->txt("exc_blog_returned")); $blogs = ilExAssignment::getDeliveredFiles($this->exc_id, $this->ass_id, $member_id); if ($blogs) { $blogs = array_pop($blogs); if ($blogs && substr($blogs["filename"], -1) != "/") { $has_submitted = true; $this->tpl->setVariable("VAL_SUBMITTED_FILES", 1); $ilCtrl->setParameter($this->parent_obj, "member_id", $member_id); $this->tpl->setCurrentBlock("download_link"); $this->tpl->setVariable("LINK_DOWNLOAD", $ilCtrl->getLinkTarget($this->parent_obj, "downloadReturned")); $this->tpl->setVariable("TXT_DOWNLOAD", $lng->txt("exc_download_files")); $this->tpl->parseCurrentBlock(); } } if (!$has_submitted) { $this->tpl->setVariable("VAL_SUBMITTED_FILES", "---"); } break; case ilExAssignment::TYPE_PORTFOLIO: $has_submitted = false; $this->tpl->setVariable("TXT_SUBMITTED_FILES", $lng->txt("exc_portfolio_returned")); $portfolios = ilExAssignment::getDeliveredFiles($this->exc_id, $this->ass_id, $member_id); if ($portfolios) { $portfolios = array_pop($portfolios); if ($portfolios && substr($portfolios["filename"], -1) != "/") { $has_submitted = true; $this->tpl->setVariable("VAL_SUBMITTED_FILES", 1); $ilCtrl->setParameter($this->parent_obj, "member_id", $member_id); $this->tpl->setCurrentBlock("download_link"); $this->tpl->setVariable("LINK_DOWNLOAD", $ilCtrl->getLinkTarget($this->parent_obj, "downloadReturned")); $this->tpl->setVariable("TXT_DOWNLOAD", $lng->txt("exc_download_files")); $this->tpl->parseCurrentBlock(); } } if (!$has_submitted) { $this->tpl->setVariable("VAL_SUBMITTED_FILES", "---"); } break; } // note $this->tpl->setVariable("TXT_NOTE", $lng->txt("note")); $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 $this->tpl->setVariable("TXT_LCOMMENT", $lng->txt("exc_comment_for_learner")); $this->tpl->setVariable("NAME_LCOMMENT", "lcomment[{$member_id}]"); $lpcomment = ilExAssignment::lookupCommentForUser($this->ass_id, $member_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($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.png"; break; case "failed": $pic = "scorm/failed.png"; break; default: $pic = "scorm/not_attempted.png"; 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 . ")"); } $this->tpl->parseCurrentBlock(); }
/** * Get assignment body for overview */ function getOverviewBody($a_data) { global $lng, $ilCtrl, $ilUser; $tpl = new ilTemplate("tpl.assignment_body.html", true, true, "Modules/Exercise"); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; include_once "./Services/UIComponent/Button/classes/class.ilLinkButton.php"; if (IS_PAYMENT_ENABLED) { include_once './Services/Payment/classes/class.ilPaymentObject.php'; } $info = new ilInfoScreenGUI(null); $info->setTableClass(""); $not_started_yet = false; if ($a_data["start_time"] > 0 && time() - $a_data["start_time"] <= 0) { $not_started_yet = true; } if (!$not_started_yet) { // instructions $info->addSection($lng->txt("exc_instruction")); $is_html = strlen($a_data["instruction"]) != strlen(strip_tags($a_data["instruction"])); if (!$is_html) { $a_data["instruction"] = nl2br(ilUtil::makeClickable($a_data["instruction"], true)); } $info->addProperty("", $a_data["instruction"]); } // schedule $info->addSection($lng->txt("exc_schedule")); if ($a_data["start_time"] > 0) { $info->addProperty($lng->txt("exc_start_time"), ilDatePresentation::formatDate(new ilDateTime($a_data["start_time"], IL_CAL_UNIX))); } if ($a_data["deadline"] > 0) { $info->addProperty($lng->txt("exc_edit_until"), ilDatePresentation::formatDate(new ilDateTime($a_data["deadline"], IL_CAL_UNIX))); } $time_str = $this->getTimeString($a_data["deadline"]); if (!$not_started_yet) { $info->addProperty($lng->txt("exc_time_to_send"), "<b>" . $time_str . "</b>"); } // public submissions if ($this->exc->getShowSubmissions()) { $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]); if ($a_data["deadline"] - time() <= 0) { $button = ilLinkButton::getInstance(); $button->setCaption("exc_list_submission"); $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "listPublicSubmissions")); $info->addProperty($lng->txt("exc_public_submission"), $button->render()); } else { $info->addProperty($lng->txt("exc_public_submission"), $lng->txt("exc_msg_public_submission")); } $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $_GET["ass_id"]); } $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]); if (!$not_started_yet) { // download files $files = ilExAssignment::getFiles($a_data["exc_id"], $a_data["id"]); if (count($files) > 0) { $info->addSection($lng->txt("exc_files")); foreach ($files as $file) { // if download must be purchased first show a "buy"-button if (IS_PAYMENT_ENABLED && (ilPaymentObject::_isBuyable($_GET['ref_id'], 'download') && !ilPaymentObject::_hasAccess($_GET['ref_id'], '', 'download'))) { $info->addProperty($file["name"], $lng->txt("buy"), $ilCtrl->getLinkTargetByClass("ilShopPurchaseGUI", "showDetails")); } else { $ilCtrl->setParameterByClass("ilobjexercisegui", "file", urlencode($file["name"])); $info->addProperty($file["name"], $lng->txt("download"), $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadFile")); $ilCtrl->setParameterByClass("ilobjexercisegui", "file", ""); } } } // submission // if submission must be purchased first if (IS_PAYMENT_ENABLED && (ilPaymentObject::_isBuyable($_GET['ref_id'], 'upload') && !ilPaymentObject::_hasAccess($_GET['ref_id'], '', 'upload'))) { $info->addSection($lng->txt("exc_your_submission")); $ilCtrl->clearParameters($this); $ilCtrl->setParameter($this, "ref_id", $_GET['ref_id']); $ilCtrl->setParameter($this, 'subtype', 'upload'); $info->addProperty($lng->txt('exc_hand_in'), $lng->txt("buy"), $ilCtrl->getLinkTargetByClass("ilShopPurchaseGUI", "showDetails")); } else { $info->addSection($lng->txt("exc_your_submission")); $delivered_files = ilExAssignment::getDeliveredFiles($a_data["exc_id"], $a_data["id"], $ilUser->getId()); $times_up = false; if ($a_data["deadline"] > 0 && $a_data["deadline"] - time() < 0) { $times_up = true; } $team_members = null; switch ($a_data["type"]) { case ilExAssignment::TYPE_UPLOAD_TEAM: $no_team_yet = false; $team_members = ilExAssignment::getTeamMembersByAssignmentId($a_data["id"], $ilUser->getId()); if (sizeof($team_members)) { $team = array(); foreach ($team_members as $member_id) { $team[] = ilObjUser::_lookupFullname($member_id); } $team = implode(", ", $team); $button = ilLinkButton::getInstance(); $button->setCaption("exc_manage_team"); $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreenTeam")); $team .= " " . $button->render(); $info->addProperty($lng->txt("exc_team_members"), $team); } else { $no_team_yet = true; if (!$times_up) { if (!sizeof($delivered_files)) { $team_info = $lng->txt("exc_no_team_yet_notice"); } else { $team_info = '<span class="warning">' . $lng->txt("exc_no_team_yet_notice") . '</span>'; } $button = ilLinkButton::getInstance(); $button->setPrimary(true); $button->setCaption("exc_create_team"); $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createTeam")); $team_info .= " " . $button->render(); $team_info .= '<div class="ilFormInfo">' . $lng->txt("exc_no_team_yet_info") . '</div>'; } else { $team_info = '<span class="warning">' . $lng->txt("exc_create_team_times_up_warning") . '</span>'; } $info->addProperty($lng->txt("exc_team_members"), $team_info); } // fallthrough // fallthrough case ilExAssignment::TYPE_UPLOAD: $titles = array(); foreach ($delivered_files as $file) { $titles[] = $file["filetitle"]; } $files_str = implode($titles, ", "); if ($files_str == "") { $files_str = $lng->txt("message_no_delivered_files"); } // no team == no submission if (!$no_team_yet) { $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]); if (!$times_up) { $title = count($titles) == 0 ? $lng->txt("exc_hand_in") : $lng->txt("exc_edit_submission"); $button = ilLinkButton::getInstance(); $button->setPrimary(true); $button->setCaption($title, false); $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreen")); $files_str .= " " . $button->render(); } else { if (count($titles) > 0) { $button = ilLinkButton::getInstance(); $button->setCaption("already_delivered_files"); $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreen")); $files_str .= " " . $button->render(); } } } $info->addProperty($lng->txt("exc_files_returned"), $files_str); break; case ilExAssignment::TYPE_BLOG: include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php"; $wsp_tree = new ilWorkspaceTree($ilUser->getId()); // #12939 if (!$wsp_tree->getRootId()) { $wsp_tree->createTreeForUser($ilUser->getId()); } $files_str = ""; $valid_blog = false; if (sizeof($delivered_files)) { $delivered_files = array_pop($delivered_files); $blog_id = (int) $delivered_files["filetitle"]; $node = $wsp_tree->getNodeData($blog_id); if ($node["title"]) { // #10116 $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", $blog_id); $blog_link = $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilpersonalworkspacegui", "ilobjbloggui"), ""); $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", ""); $files_str = '<a href="' . $blog_link . '">' . $node["title"] . '</a>'; $valid_blog = true; } else { if (substr($delivered_files["filename"], -1) == "/") { $this->exc->deleteResourceObject($delivered_files["ass_id"], $ilUser->getId(), $delivered_files["returned_id"]); } } } if (!$times_up) { if (!$valid_blog) { $button = ilLinkButton::getInstance(); $button->setCaption("exc_create_blog"); $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createBlog")); $files_str .= $button->render(); } // #10462 $blogs = sizeof($wsp_tree->getObjectsFromType("blog")); if (!$valid_blog && $blogs || $valid_blog && $blogs > 1) { $button = ilLinkButton::getInstance(); $button->setCaption("exc_select_blog" . ($valid_blog ? "_change" : "")); $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "selectBlog")); $files_str .= " " . $button->render(); } } if ($files_str) { $info->addProperty($lng->txt("exc_blog_returned"), $files_str); } if ($delivered_files && substr($delivered_files["filename"], -1) != "/") { $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", $delivered_files["returned_id"]); $dl_link = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "download"); $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", ""); $button = ilLinkButton::getInstance(); $button->setCaption("download"); $button->setUrl($dl_link); $info->addProperty($lng->txt("exc_files_returned"), $button->render()); } break; case ilExAssignment::TYPE_PORTFOLIO: include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php"; $files_str = ""; $valid_prtf = false; if (sizeof($delivered_files)) { $delivered_files = array_pop($delivered_files); $portfolio_id = (int) $delivered_files["filetitle"]; // #11746 if (ilObject::_exists($portfolio_id, false, "prtf")) { $portfolio = new ilObjPortfolio($portfolio_id, false); if ($portfolio->getTitle()) { // #10116 / #12791 $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", $portfolio_id); $prtf_link = $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilportfoliorepositorygui", "ilobjportfoliogui"), "view"); $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", ""); $files_str = '<a href="' . $prtf_link . '">' . $portfolio->getTitle() . '</a>'; $valid_prtf = true; } } else { if (substr($delivered_files["filename"], -1) == "/") { $this->exc->deleteResourceObject($delivered_files["ass_id"], $ilUser->getId(), $delivered_files["returned_id"]); } } } if (!$times_up) { if (!$valid_prtf) { // if there are portfolio templates available show form first include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php"; $has_prtt = sizeof(ilObjPortfolioTemplate::getAvailablePortfolioTemplates()) ? "Template" : ""; $button = ilLinkButton::getInstance(); $button->setCaption("exc_create_portfolio"); $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createPortfolio" . $has_prtt)); $files_str .= $button->render(); } // #10462 $prtfs = sizeof(ilObjPortfolio::getPortfoliosOfUser($ilUser->getId())); if (!$valid_prtf && $prtfs || $valid_prtf && $prtfs > 1) { $button = ilLinkButton::getInstance(); $button->setCaption("exc_select_portfolio" . ($valid_prtf ? "_change" : "")); $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "selectPortfolio")); $files_str .= " " . $button->render(); } } if ($files_str) { $info->addProperty($lng->txt("exc_portfolio_returned"), $files_str); } if ($delivered_files && substr($delivered_files["filename"], -1) != "/") { $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", $delivered_files["returned_id"]); $dl_link = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "download"); $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", ""); $button = ilLinkButton::getInstance(); $button->setCaption("download"); $button->setUrl($dl_link); $info->addProperty($lng->txt("exc_files_returned"), $button->render()); } break; case ilExAssignment::TYPE_TEXT: $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]); if (!$times_up) { $button = ilLinkButton::getInstance(); $button->setPrimary(true); $button->setCaption("exc_text_assignment_edit"); $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "editAssignmentText")); $files_str = $button->render(); } else { $button = ilLinkButton::getInstance(); $button->setCaption("exc_text_assignment_show"); $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "showAssignmentText")); $files_str = $button->render(); } $info->addProperty($lng->txt("exc_files_returned_text"), $files_str); break; } $last_sub = ilExAssignment::getLastSubmission($a_data["id"], $ilUser->getId()); if ($last_sub) { $last_sub = ilDatePresentation::formatDate(new ilDateTime($last_sub, IL_CAL_DATETIME)); } else { $last_sub = "---"; } if ($last_sub != "---") { $info->addProperty($lng->txt("exc_last_submission"), $last_sub); } // peer feedback if ($times_up && $a_data["peer"]) { $nr_missing_fb = ilExAssignment::getNumberOfMissingFeedbacks($a_data["id"], $a_data["peer_min"]); if (!$a_data["peer_dl"] || $a_data["peer_dl"] > time()) { $dl_info = ""; if ($a_data["peer_dl"]) { $dl_info = " (" . sprintf($lng->txt("exc_peer_review_deadline_info_button"), ilDatePresentation::formatDate(new ilDateTime($a_data["peer_dl"], IL_CAL_UNIX))) . ")"; } $button = ilLinkButton::getInstance(); $button->setPrimary($nr_missing_fb); $button->setCaption($lng->txt("exc_peer_review_give") . $dl_info, false); $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "editPeerReview")); $edit_pc = $button->render(); } else { if ($a_data["peer_dl"]) { $edit_pc = $lng->txt("exc_peer_review_deadline_reached"); } } if ((!$a_data["peer_dl"] || $a_data["peer_dl"] < time()) && !$nr_missing_fb) { $button = ilLinkButton::getInstance(); $button->setCaption("exc_peer_review_show"); $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "showPersonalPeerReview")); $view_pc = $button->render(); } /* else { $view_pc = $lng->txt("exc_peer_review_show_not_rated_yet"); } */ $info->addProperty($lng->txt("exc_peer_review"), $edit_pc . " " . $view_pc); } // feedback from tutor if ($a_data["type"] == ilExAssignment::TYPE_UPLOAD_TEAM) { $feedback_id = "t" . ilExAssignment::getTeamIdByAssignment($a_data["id"], $ilUser->getId()); } else { $feedback_id = $ilUser->getId(); } // global feedback / sample solution if ($a_data["fb_date"] == ilExAssignment::FEEDBACK_DATE_DEADLINE) { $show_global_feedback = $times_up && $a_data["fb_file"]; } else { $show_global_feedback = $last_sub != "---" && $a_data["fb_file"]; } $storage = new ilFSStorageExercise($a_data["exc_id"], $a_data["id"]); $cnt_files = $storage->countFeedbackFiles($feedback_id); $lpcomment = ilExAssignment::lookupCommentForUser($a_data["id"], $ilUser->getId()); $mark = ilExAssignment::lookupMarkOfUser($a_data["id"], $ilUser->getId()); $status = ilExAssignment::lookupStatusOfUser($a_data["id"], $ilUser->getId()); if ($lpcomment != "" || $mark != "" || $status != "notgraded" || $cnt_files > 0 || $show_global_feedback) { $info->addSection($lng->txt("exc_feedback_from_tutor")); if ($lpcomment != "") { $info->addProperty($lng->txt("exc_comment"), $lpcomment); } if ($mark != "") { $info->addProperty($lng->txt("exc_mark"), $mark); } if ($status == "") { // $info->addProperty($lng->txt("status"), // $lng->txt("message_no_delivered_files")); } else { if ($status != "notgraded") { $img = '<img src="' . ilUtil::getImagePath("scorm/" . $status . ".svg") . '" ' . ' alt="' . $lng->txt("exc_" . $status) . '" title="' . $lng->txt("exc_" . $status) . '" />'; $info->addProperty($lng->txt("status"), $img . " " . $lng->txt("exc_" . $status)); } } if ($cnt_files > 0) { $info->addSection($lng->txt("exc_fb_files") . '<a name="fb' . $a_data["id"] . '"></a>'); if ($cnt_files > 0) { $files = $storage->getFeedbackFiles($feedback_id); foreach ($files as $file) { $ilCtrl->setParameterByClass("ilobjexercisegui", "file", urlencode($file)); $info->addProperty($file, $lng->txt("download"), $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadFeedbackFile")); $ilCtrl->setParameterByClass("ilobjexercisegui", "file", ""); } } } // #15002 - global feedback if ($show_global_feedback) { $info->addSection($lng->txt("exc_global_feedback_file")); $info->addProperty($a_data["fb_file"], $lng->txt("download"), $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadGlobalFeedbackFile")); } } } } $tpl->setVariable("CONTENT", $info->getHTML()); return $tpl->get(); }
/** * Fill table row */ protected function fillRow($d) { global $lng, $ilCtrl; $user_id = $d["user_id"]; foreach ($this->ass_data as $ass) { // grade $this->tpl->setCurrentBlock("grade"); $status = ilExAssignment::lookupStatusOfUser($ass["id"], $user_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")); 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 $mark = ilExAssignment::lookupMarkOfUser($ass["id"], $user_id); $this->tpl->setVariable("VAL_ONLY_MARK", $mark); $this->tpl->parseCurrentBlock(); } // exercise total // mark input $this->tpl->setCurrentBlock("mark_input"); $this->tpl->setVariable("TXT_MARK", $lng->txt("exc_mark")); $this->tpl->setVariable("NAME_MARK", "mark[" . $user_id . "]"); include_once 'Services/Tracking/classes/class.ilLPMarks.php'; $mark = ilLPMarks::_lookupMark($user_id, $this->exc_id); $this->tpl->setVariable("VAL_MARK", ilUtil::prepareFormOutput($mark)); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("grade"); $status = ilExerciseMembers::_lookupStatus($this->exc_id, $user_id); $this->tpl->setVariable("SEL_" . strtoupper($status), ' selected="selected" '); 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($ass["id"], $user_id); $this->tpl->setVariable("VAL_MARK", ilUtil::prepareFormOutput($mark));*/ $this->tpl->parseCurrentBlock(); // name $this->tpl->setVariable("TXT_NAME", $d["lastname"] . ", " . $d["firstname"] . " [" . $d["login"] . "]"); $this->tpl->setVariable("VAL_ID", $user_id); $ilCtrl->setParameter($this->parent_obj, "part_id", $user_id); $this->tpl->setVariable("LINK_NAME", $ilCtrl->getLinkTarget($this->parent_obj, "showParticipant")); // comment $this->tpl->setVariable("ID_COMMENT", $user_id); $c = ilLPMarks::_lookupComment($user_id, $this->exc_id); $this->tpl->setVariable("VAL_COMMENT", ilUtil::prepareFormOutput($c)); }
/** * attach marking tag to member for given assignment * * @param int $user_id * @param int $assignment_id */ private function attachMarking($user_id, $assignment_id) { $amark = ilExAssignment::lookupMarkOfUser($assignment_id, $user_id); $astatus = ilExAssignment::lookupStatusOfUser($assignment_id, $user_id); $acomment = ilExAssignment::lookupCommentForUser($assignment_id, $user_id); $anotice = ilExAssignment::lookupNoticeOfUser($assignment_id, $user_id); if ($astatus == "notgraded") { $status = ilExerciseXMLWriter::$STATUS_NOT_GRADED; } elseif ($astatus == "failed") { $status = ilExerciseXMLWriter::$STATUS_FAILED; } else { $status = ilExerciseXMLWriter::$STATUS_PASSED; } $this->xmlStartTag("Marking", array("status" => $status)); $this->xmlElement("Mark", null, $amark); $this->xmlElement("Notice", null, $anotice); $this->xmlElement("Comment", null, $acomment); $this->xmlEndTag("Marking"); }
/** * 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"); } }
/** * Get assignment body for overview */ function getOverviewBody($a_data) { global $lng, $ilCtrl, $ilUser; $tpl = new ilTemplate("tpl.assignment_body.html", true, true, "Modules/Exercise"); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; if (IS_PAYMENT_ENABLED) { include_once './Services/Payment/classes/class.ilPaymentObject.php'; } $info = new ilInfoScreenGUI(null); $info->setTableClass(""); $not_started_yet = false; if ($a_data["start_time"] > 0 && time() - $a_data["start_time"] <= 0) { $not_started_yet = true; } if (!$not_started_yet) { // instructions $info->addSection($lng->txt("exc_instruction")); $info->addProperty("", nl2br(ilUtil::makeClickable($a_data["instruction"], true))); } // schedule $info->addSection($lng->txt("exc_schedule")); if ($a_data["start_time"] > 0) { $info->addProperty($lng->txt("exc_start_time"), ilDatePresentation::formatDate(new ilDateTime($a_data["start_time"], IL_CAL_UNIX))); } if ($a_data["deadline"] > 0) { $info->addProperty($lng->txt("exc_edit_until"), ilDatePresentation::formatDate(new ilDateTime($a_data["deadline"], IL_CAL_UNIX))); } $time_str = $this->getTimeString($a_data["deadline"]); if (!$not_started_yet) { $info->addProperty($lng->txt("exc_time_to_send"), "<b>" . $time_str . "</b>"); } // public submissions if ($this->exc->getShowSubmissions()) { $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]); if ($a_data["deadline"] - time() <= 0) { $link = '<a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "listPublicSubmissions") . '">' . $lng->txt("exc_list_submission") . '</a>'; $info->addProperty($lng->txt("exc_public_submission"), $link); } else { $info->addProperty($lng->txt("exc_public_submission"), $lng->txt("exc_msg_public_submission")); } $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $_GET["ass_id"]); } $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]); if (!$not_started_yet) { // download files $files = ilExAssignment::getFiles($a_data["exc_id"], $a_data["id"]); if (count($files) > 0) { $info->addSection($lng->txt("exc_files")); foreach ($files as $file) { // if download must be purchased first show a "buy"-button if (IS_PAYMENT_ENABLED && (ilPaymentObject::_isBuyable($_GET['ref_id'], 'download') && !ilPaymentObject::_hasAccess($_GET['ref_id'], '', 'download'))) { $info->addProperty($file["name"], $lng->txt("buy"), $ilCtrl->getLinkTargetByClass("ilShopPurchaseGUI", "showDetails")); } else { $ilCtrl->setParameterByClass("ilobjexercisegui", "file", urlencode($file["name"])); $info->addProperty($file["name"], $lng->txt("download"), $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadFile")); $ilCtrl->setParameterByClass("ilobjexercisegui", "file", ""); } } } // submission // if submission must be purchased first if (IS_PAYMENT_ENABLED && (ilPaymentObject::_isBuyable($_GET['ref_id'], 'upload') && !ilPaymentObject::_hasAccess($_GET['ref_id'], '', 'upload'))) { $info->addSection($lng->txt("exc_your_submission")); $ilCtrl->clearParameters($this); $ilCtrl->setParameter($this, "ref_id", $_GET['ref_id']); $ilCtrl->setParameter($this, 'subtype', 'upload'); $info->addProperty($lng->txt('exc_hand_in'), $lng->txt("buy"), $ilCtrl->getLinkTargetByClass("ilShopPurchaseGUI", "showDetails")); } else { $info->addSection($lng->txt("exc_your_submission")); $delivered_files = ilExAssignment::getDeliveredFiles($a_data["exc_id"], $a_data["id"], $ilUser->getId()); $times_up = false; if ($a_data["deadline"] > 0 && $a_data["deadline"] - time() < 0) { $times_up = true; } $team_members = null; switch ($a_data["type"]) { case ilExAssignment::TYPE_UPLOAD_TEAM: $team_members = ilExAssignment::getTeamMembersByAssignmentId($a_data["id"], $ilUser->getId()); if (sizeof($team_members) > 1) { $team = array(); foreach ($team_members as $member_id) { $team[] = ilObjUser::_lookupFullname($member_id); } $info->addProperty($lng->txt("exc_team_members"), implode(", ", $team)); } // fallthrough // fallthrough case ilExAssignment::TYPE_UPLOAD: $titles = array(); foreach ($delivered_files as $file) { $titles[] = $file["filetitle"]; } $files_str = implode($titles, ", "); if ($files_str == "") { $files_str = $lng->txt("message_no_delivered_files"); } $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]); if (!$times_up) { $files_str .= ' <a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreen") . '">' . (count($titles) == 0 ? $lng->txt("exc_hand_in") : $lng->txt("exc_edit_submission")) . '</a>'; } else { if (count($titles) > 0) { $files_str .= ' <a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreen") . '">' . $lng->txt("already_delivered_files") . '</a>'; } } $info->addProperty($lng->txt("exc_files_returned"), $files_str); break; case ilExAssignment::TYPE_BLOG: $files_str = ""; $valid_blog = false; if (sizeof($delivered_files)) { $delivered_files = array_pop($delivered_files); $blog_id = (int) $delivered_files["filetitle"]; include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php"; include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php"; $wsp_tree = new ilWorkspaceTree($ilUser->getId()); $node = $wsp_tree->getNodeData($blog_id); if ($node["title"]) { // #10116 // $blog_link = ilWorkspaceAccessHandler::getGotoLink($blog_id, $node["obj_id"]); $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", $blog_id); $blog_link = $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilpersonalworkspacegui", "ilobjbloggui"), ""); $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", ""); $files_str = '<a href="' . $blog_link . '">' . $node["title"] . '</a>'; $valid_blog = true; } } if (!$times_up) { if (!$valid_blog) { $files_str .= '<a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createBlog") . '">' . $lng->txt("exc_create_blog") . '</a>'; } $files_str .= ' <a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "selectBlog") . '">' . $lng->txt("exc_select_blog" . ($valid_blog ? "_change" : "")) . '</a>'; } if ($files_str) { $info->addProperty($lng->txt("exc_blog_returned"), $files_str); } if ($delivered_files && substr($delivered_files["filename"], -1) != "/") { $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", $delivered_files["returned_id"]); $dl_link = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "download"); $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", ""); $info->addProperty($lng->txt("exc_files_returned"), "<a href=\"" . $dl_link . "\">" . $lng->txt("download") . "</a>"); } break; case ilExAssignment::TYPE_PORTFOLIO: $files_str = ""; $valid_prtf = false; if (sizeof($delivered_files)) { $delivered_files = array_pop($delivered_files); $portfolio_id = (int) $delivered_files["filetitle"]; include_once "Services/Portfolio/classes/class.ilObjPortfolio.php"; include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php"; $portfolio = new ilObjPortfolio($portfolio_id, false); if ($portfolio->getTitle()) { // #10116 // $prtf_link = ilWorkspaceAccessHandler::getGotoLink($portfolio_id, $portfolio_id) $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", $portfolio_id); $prtf_link = $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilobjportfoliogui"), "pages"); $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", ""); $files_str = '<a href="' . $prtf_link . '">' . $portfolio->getTitle() . '</a>'; $valid_prtf = true; } } if (!$times_up) { if (!$valid_prtf) { $files_str .= '<a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createPortfolio") . '">' . $lng->txt("exc_create_portfolio") . '</a>'; } $files_str .= ' <a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "selectPortfolio") . '">' . $lng->txt("exc_select_portfolio" . ($valid_prtf ? "_change" : "")) . '</a>'; } if ($files_str) { $info->addProperty($lng->txt("exc_portfolio_returned"), $files_str); } if ($delivered_files && substr($delivered_files["filename"], -1) != "/") { $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", $delivered_files["returned_id"]); $dl_link = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "download"); $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", ""); $info->addProperty($lng->txt("exc_files_returned"), "<a href=\"" . $dl_link . "\">" . $lng->txt("download") . "</a>"); } break; } $last_sub = ilExAssignment::getLastSubmission($a_data["id"], $ilUser->getId()); if ($last_sub) { $last_sub = ilDatePresentation::formatDate(new ilDateTime($last_sub, IL_CAL_DATETIME)); } else { $last_sub = "---"; } if ($last_sub != "---") { $info->addProperty($lng->txt("exc_last_submission"), $last_sub); } // feedback from tutor if ($a_data["type"] == ilExAssignment::TYPE_UPLOAD_TEAM) { $feedback_id = "t" . ilExAssignment::getTeamIdByAssignment($a_data["id"], $ilUser->getId()); } else { $feedback_id = $ilUser->getId(); } $storage = new ilFSStorageExercise($a_data["exc_id"], $a_data["id"]); $cnt_files = $storage->countFeedbackFiles($feedback_id); $lpcomment = ilExAssignment::lookupCommentForUser($a_data["id"], $ilUser->getId()); $mark = ilExAssignment::lookupMarkOfUser($a_data["id"], $ilUser->getId()); $status = ilExAssignment::lookupStatusOfUser($a_data["id"], $ilUser->getId()); if ($lpcomment != "" || $mark != "" || $status != "notgraded" || $cnt_files > 0) { $info->addSection($lng->txt("exc_feedback_from_tutor")); if ($lpcomment != "") { $info->addProperty($lng->txt("exc_comment"), $lpcomment); } if ($mark != "") { $info->addProperty($lng->txt("exc_mark"), $mark); } if ($status == "") { // $info->addProperty($lng->txt("status"), // $lng->txt("message_no_delivered_files")); } else { if ($status != "notgraded") { $img = '<img border="0" src="' . ilUtil::getImagePath("scorm/" . $status . ".png") . '" ' . ' alt="' . $lng->txt("exc_" . $status) . '" title="' . $lng->txt("exc_" . $status) . '" style="vertical-align:middle;"/>'; $info->addProperty($lng->txt("status"), $img . " " . $lng->txt("exc_" . $status)); } } if ($cnt_files > 0) { $info->addSection($lng->txt("exc_fb_files")); $files = $storage->getFeedbackFiles($feedback_id); foreach ($files as $file) { $ilCtrl->setParameterByClass("ilobjexercisegui", "file", urlencode($file)); $info->addProperty($file, $lng->txt("download"), $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadFeedbackFile")); $ilCtrl->setParameter($this, "file", ""); } } } } } $tpl->setVariable("CONTENT", $info->getHTML()); return $tpl->get(); }
/** * Fill table row */ protected function fillRow($d) { global $lng, $ilCtrl; $this->tpl->setVariable("TXT_ASS_TITLE", $d["title"]); if ($d["type"] == ilExAssignment::TYPE_UPLOAD_TEAM) { $members = ilExAssignment::getTeamMembersByAssignmentId($d["id"], $this->part_id); $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", ""); } $this->tpl->setVariable("VAL_CHKBOX", ilUtil::formCheckbox(0, "assid[" . $d["id"] . "]", 1)); $this->tpl->setVariable("VAL_ID", $d["id"]); // submission: // see if files have been resubmmited after solved $last_sub = ilExAssignment::getLastSubmission($d["id"], $this->part_id); if ($last_sub) { $last_sub = ilDatePresentation::formatDate(new ilDateTime($last_sub, IL_CAL_DATETIME)); } else { $last_sub = "---"; } if (ilExAssignment::lookupUpdatedSubmission($d["id"], $this->part_id) == 1) { $last_sub = "<b>" . $last_sub . "</b>"; } $this->tpl->setVariable("VAL_LAST_SUBMISSION", $last_sub); $this->tpl->setVariable("TXT_LAST_SUBMISSION", $lng->txt("exc_last_submission")); // nr of submitted files $this->tpl->setVariable("TXT_SUBMITTED_FILES", $lng->txt("exc_files_returned")); $sub_cnt = count(ilExAssignment::getDeliveredFiles($this->exc_id, $d["id"], $this->part_id)); $new = ilExAssignment::lookupNewFiles($d["id"], $this->part_id); if (count($new) > 0) { $sub_cnt .= " " . sprintf($lng->txt("cnt_new"), count($new)); } $this->tpl->setVariable("VAL_SUBMITTED_FILES", $sub_cnt); // download command $ilCtrl->setParameter($this->parent_obj, "ass_id", $d["id"]); $ilCtrl->setParameter($this->parent_obj, "member_id", $this->part_id); if ($sub_cnt > 0) { $this->tpl->setCurrentBlock("download_link"); $this->tpl->setVariable("LINK_DOWNLOAD", $ilCtrl->getLinkTarget($this->parent_obj, "downloadReturned")); if (count($new) <= 0) { $this->tpl->setVariable("TXT_DOWNLOAD", $lng->txt("exc_download_files")); } else { $this->tpl->setVariable("TXT_DOWNLOAD", $lng->txt("exc_download_all")); } $this->tpl->parseCurrentBlock(); // download new files only if (count($new) > 0) { $this->tpl->setCurrentBlock("download_link"); $this->tpl->setVariable("LINK_NEW_DOWNLOAD", $ilCtrl->getLinkTarget($this->parent_obj, "downloadNewReturned")); $this->tpl->setVariable("TXT_NEW_DOWNLOAD", $lng->txt("exc_download_new")); $this->tpl->parseCurrentBlock(); } } // note $this->tpl->setVariable("TXT_NOTE", $lng->txt("note")); $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 $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.png"; break; case "failed": $pic = "scorm/failed.png"; break; default: $pic = "scorm/not_attempted.png"; 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 . ")"); } $ilCtrl->setParameter($this->parent_obj, "ass_id", $_GET["ass_id"]); }
/** * 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", " "); $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"); } }