/** * Save status of selected members */ function saveStatus($a_part_view = false) { global $ilCtrl; include_once "./Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus/classes/class.ilEphAssignment.php"; include_once "./Services/Tracking/classes/class.ilLPMarks.php"; $saved_for = array(); foreach ($_POST["id"] as $key => $value) { if (!$a_part_view) { if (count($_POST["member"]) > 0 && $_POST["member"][$key] != "1") { continue; } else { if (count($_POST["member"]) > 0) { $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"]; } ilEphAssignment::updateStatusOfUser($ass_id, $user_id, ilUtil::stripSlashes($_POST["status"][$key])); ilEphAssignment::updateNoticeForUser($ass_id, $user_id, ilUtil::stripSlashes($_POST["notice"][$key])); if (ilUtil::stripSlashes($_POST['mark'][$key]) != ilEphAssignment::lookupMarkOfUser($ass_id, $user_id)) { ilEphAssignment::updateStatusTimeOfUser($ass_id, $user_id); } ilEphAssignment::updateMarkOfUser($ass_id, $user_id, ilUtil::stripSlashes($_POST['mark'][$key])); ilEphAssignment::updateCommentForUser($ass_id, $user_id, ilUtil::stripSlashes($_POST['lcomment'][$key])); } if (count($saved_for) > 0) { $save_for_str = "(" . implode($saved_for, " - ") . ")"; } ilUtil::sendSuccess($this->lng->txt("rep_robj_xeph_status_saved") . " " . $save_for_str, true); if (!$a_part_view) { $ilCtrl->redirect($this, "showSubmissions"); } else { $ilCtrl->redirect($this, "showParticipants"); } }
/** * Fill table row */ protected function fillRow($member) { global $lng, $ilCtrl; include_once "./Services/Object/classes/class.ilObjectFactory.php"; $member_id = $member["user_id"]; if (!($mem_obj = ilObjectFactory::getInstanceByObjId($member_id, false))) { return; } // mail sent if ($this->sent_col) { if (ilEphAssignment::lookupStatusSentOfUser($this->ass_id, $member_id)) { $this->tpl->setCurrentBlock("mail_sent"); if (($st = ilEphAssignment::lookupSentTimeOfUser($this->ass_id, $member_id)) > 0) { $this->tpl->setVariable("TXT_MAIL_SENT", sprintf($lng->txt("rep_robj_xeph_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 $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")); // submission: // see if files have been resubmmited after solved $last_sub = ilEphAssignment::getLastSubmission($this->ass_id, $member_id); if ($last_sub) { $last_sub = ilDatePresentation::formatDate(new ilDateTime($last_sub, IL_CAL_DATETIME)); } else { $last_sub = "---"; } if (ilEphAssignment::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("rep_robj_xeph_last_submission")); // nr of submitted files $this->tpl->setVariable("TXT_SUBMITTED_FILES", $lng->txt("rep_robj_xeph_files_returned")); $sub_cnt = count(ilEphAssignment::getDeliveredFiles($this->eph_id, $this->ass_id, $member_id)); $new = ilEphAssignment::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("rep_robj_xeph_download_files")); } else { $this->tpl->setVariable("TXT_DOWNLOAD", $lng->txt("rep_robj_xeph_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("rep_robj_xeph_download_new")); $this->tpl->parseCurrentBlock(); } } // note $this->tpl->setVariable("TXT_NOTE", $lng->txt("note")); $this->tpl->setVariable("NAME_NOTE", "notice[{$member_id}]"); $this->tpl->setVariable("VAL_NOTE", ilUtil::prepareFormOutput(ilEphAssignment::lookupNoticeOfUser($this->ass_id, $member_id))); // comment for learner $this->tpl->setVariable("TXT_LCOMMENT", $lng->txt("rep_robj_xeph_comment_for_learner")); $this->tpl->setVariable("NAME_LCOMMENT", "lcomment[{$member_id}]"); $lpcomment = ilEphAssignment::lookupCommentForUser($this->ass_id, $member_id); $this->tpl->setVariable("VAL_LCOMMENT", ilUtil::prepareFormOutput($lpcomment)); // Reports $documents = ilEphAssignment::getDeliveredFiles($this->eph_id, $this->ass_id, $member_id); foreach ($documents as $document) { $ilCtrl->setParameter($this->parent_obj, "filename", $document["filename"]); $ilCtrl->setParameter($this->parent_obj, "filetitle", $document["filetitle"]); $ilCtrl->setParameter($this->parent_obj, "part_id", $member_id); $this->tpl->setCurrentBlock("report"); $this->tpl->setVariable("DOCUMENT_LINK", $ilCtrl->getLinkTarget($this->parent_obj, "downloadSubmittedFile")); $this->tpl->setVariable("DOCUMENT_TITLE", $document["filetitle"]); $ilCtrl->setParameter($this->parent_obj, "filename", ""); $ilCtrl->setParameter($this->parent_obj, "filetitle", ""); $ilCtrl->setParameter($this->parent_obj, "part_id", ""); $ilCtrl->setParameter($this->parent_obj, "doc_id", $document["guid"]); $report_link = ""; $visibility_link = ""; switch ($document["status"]) { case 0: if (!$document["guid"]) { $report_link = "<span title=\"" . $lng->txt("rep_robj_xeph_wait_for_sending_msg") . "\">" . $lng->txt("rep_robj_xeph_wait_for_sending") . "</span>"; } else { $report_link = "<span title=\"" . $lng->txt("rep_robj_xeph_processing_msg") . "\">" . $lng->txt("rep_robj_xeph_processing") . "</span>"; $visibility_link = "<img src=\"./templates/default/images/loader.gif" . "\">"; } break; case 1: $report_link = "<a href=\"" . $ilCtrl->getLinkTarget($this->parent_obj, "viewReport") . "\">" . $document["percentage"] . "%" . "</a>"; $visibility_link = "<a href=\"" . $ilCtrl->getLinkTarget($this->parent_obj, "changeVisibility") . "\">" . "<img src=\"./Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus/templates/images/" . "eye_" . ($document["visibility_index"] == 1 ? "open" : "closed") . ".png" . "\">" . "</a>"; break; case 2: $report_link = "<a href=\"" . $ilCtrl->getLinkTarget($this->parent_obj, "viewReport") . "\"" . "title=\"" . $lng->txt("rep_robj_xeph_duplicate_document_msg") . "\">" . $lng->txt("rep_robj_xeph_duplicate_document") . "</a>"; break; case 3: $report_link = "<span title=\"" . $lng->txt("rep_robj_xeph_document_protected_msg") . "\">" . $lng->txt("rep_robj_xeph_document_protected") . "</span>"; break; case 4: $report_link = "<span title=\"" . $lng->txt("rep_robj_xeph_not_enough_text_msg") . "\">" . $lng->txt("rep_robj_xeph_not_enough_text") . "</span>"; break; case 5: $report_link = "<span title=\"" . $lng->txt("rep_robj_xeph_no_text_msg") . "\">" . $lng->txt("rep_robj_xeph_no_text") . "</span>"; break; case 6: $report_link = "<span title=\"" . $lng->txt("rep_robj_xeph_unknown_error_msg") . "\">" . $lng->txt("rep_robj_xeph_unknown_error") . "</span>"; break; case 99: $report_link = "<span title=\"" . $lng->txt("rep_robj_xeph_" . $document["error"] . "_msg") . "\">" . $lng->txt("rep_robj_xeph_" . $document["error"]) . "</span>"; break; } $this->tpl->setVariable("REPORT_LINK", $report_link); $this->tpl->setVariable("VISIBILITY_LINK", $visibility_link); $this->tpl->parseCurrentBlock(); } // solved //$this->tpl->setVariable("CHKBOX_SOLVED", //ilUtil::formCheckbox($this->eph->members_obj->getStatusByMember($member_id),"solved[$member_id]",1)); $status = ilEphAssignment::lookupStatusOfUser($this->ass_id, $member_id); $this->tpl->setVariable("SEL_" . strtoupper($status), ' selected="selected" '); $this->tpl->setVariable("TXT_NOTGRADED", $lng->txt("rep_robj_xeph_notgraded")); $this->tpl->setVariable("TXT_PASSED", $lng->txt("rep_robj_xeph_passed")); $this->tpl->setVariable("TXT_FAILED", $lng->txt("rep_robj_xeph_failed")); if (($sd = ilEphAssignment::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("rep_robj_xeph_" . $status)); // mark $this->tpl->setVariable("TXT_MARK", $lng->txt("rep_robj_xeph_mark")); $this->tpl->setVariable("NAME_MARK", "mark[{$member_id}]"); $mark = ilEphAssignment::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 = ilEphAssignment::lookupFeedbackTimeOfUser($this->ass_id, $member_id)) > 0) { $this->tpl->setCurrentBlock("feedback_date"); $this->tpl->setVariable("TXT_FEEDBACK_MAIL_SENT", sprintf($lng->txt("rep_robj_xeph_sent_at"), ilDatePresentation::formatDate(new ilDateTime($ft, IL_CAL_DATETIME)))); $this->tpl->parseCurrentBlock(); } // feedback mail $ilCtrl->setParameter($this, "rcp_to", $mem_obj->getLogin()); $this->tpl->setVariable("LINK_FEEDBACK", $ilCtrl->getLinkTarget($this->parent_obj, "redirectFeedbackMail")); $this->tpl->setVariable("TXT_FEEDBACK", $lng->txt("rep_robj_xeph_send_mail")); $ilCtrl->setParameter($this->parent_obj, "rcp_to", ""); // file feedback $cnt_files = $this->storage->countFeedbackFiles($member_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("rep_robj_xeph_add_feedback_file")); } else { $this->tpl->setVariable("TXT_FILE_FEEDBACK", $lng->txt("rep_robj_xeph_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, "Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus"); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.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("rep_robj_xeph_instruction")); $info->addProperty("", nl2br(ilUtil::makeClickable($a_data["instruction"], true))); } // schedule $info->addSection($lng->txt("rep_robj_xeph_schedule")); if ($a_data["start_time"] > 0) { $info->addProperty($lng->txt("rep_robj_xeph_start_time"), ilDatePresentation::formatDate(new ilDateTime($a_data["start_time"], IL_CAL_UNIX))); } $info->addProperty($lng->txt("rep_robj_xeph_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("rep_robj_xeph_time_to_send"), "<b>" . $time_str . "</b>"); } // public submissions if ($this->eph->getShowSubmissions()) { $ilCtrl->setParameterByClass("ilobjephorusgui", "ass_id", $a_data["id"]); if ($a_data["deadline"] - time() <= 0) { $link = '<a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjephorusgui", "listPublicSubmissions") . '">' . $lng->txt("rep_robj_xeph_list_submission") . '</a>'; $info->addProperty($lng->txt("rep_robj_xeph_public_submission"), $link); } else { $info->addProperty($lng->txt("rep_robj_xeph_public_submission"), $lng->txt("rep_robj_xeph_msg_public_submission")); } $ilCtrl->setParameterByClass("ilobjephorusgui", "ass_id", $_GET["ass_id"]); } $ilCtrl->setParameterByClass("ilobjephorusgui", "ass_id", $a_data["id"]); if (!$not_started_yet) { // download files $files = ilEphAssignment::getFiles($a_data["eph_id"], $a_data["id"]); if (count($files) > 0) { $info->addSection($lng->txt("rep_robj_xeph_files")); foreach ($files as $file) { $ilCtrl->setParameterByClass("ilobjephorusgui", "file", urlencode($file["name"])); $info->addProperty($file["name"], $lng->txt("rep_robj_xeph_download"), $ilCtrl->getLinkTargetByClass("ilobjephorusgui", "downloadFile")); $ilCtrl->setParameterByClass("ilobjephorusgui", "file", ""); } } // submission $info->addSection($lng->txt("rep_robj_xeph_your_submission")); $delivered_files = ilEphAssignment::getDeliveredFiles($a_data["eph_id"], $a_data["id"], $ilUser->getId()); $times_up = false; if ($a_data["deadline"] - time() < 0) { $times_up = true; } $titles = array(); foreach ($delivered_files as $file) { $titles[] = $file["filetitle"]; } $files_str = implode($titles, ", "); if ($files_str == "") { $files_str = $lng->txt("rep_robj_xeph_message_no_delivered_files"); } $ilCtrl->setParameterByClass("ilobjephorusgui", "ass_id", $a_data["id"]); if (!$times_up) { $files_str .= ' <a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjephorusgui", "submissionScreen") . '">' . (count($titles) == 0 ? $lng->txt("rep_robj_xeph_hand_in") : $lng->txt("rep_robj_xeph_edit_submission")) . '</a>'; } else { if (count($titles) > 0) { $files_str .= ' <a class="submit" href="' . $ilCtrl->getLinkTargetByClass("ilobjephorusgui", "submissionScreen") . '">' . $lng->txt("rep_robj_xeph_already_delivered_files") . '</a>'; } } $info->addProperty($lng->txt("rep_robj_xeph_files_returned"), $files_str); $last_sub = ilEphAssignment::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("rep_robj_xeph_last_submission"), $last_sub); } // feedback from tutor $storage = new ilFSStorageEphorus($a_data["eph_id"], $a_data["id"]); $cnt_files = $storage->countFeedbackFiles($ilUser->getId()); $lpcomment = ilEphAssignment::lookupCommentForUser($a_data["id"], $ilUser->getId()); $mark = ilEphAssignment::lookupMarkOfUser($a_data["id"], $ilUser->getId()); $status = ilEphAssignment::lookupStatusOfUser($a_data["id"], $ilUser->getId()); if ($lpcomment != "" || $mark != "" || $status != "notgraded" || $cnt_files > 0) { $info->addSection($lng->txt("rep_robj_xeph_feedback_from_tutor")); if ($lpcomment != "") { $info->addProperty($lng->txt("rep_robj_xeph_comment"), $lpcomment); } if ($mark != "") { $info->addProperty($lng->txt("rep_robj_xeph_mark"), $mark); } if ($status == "") { $info->addProperty($lng->txt("rep_robj_xeph_status"), $lng->txt("rep_robj_xeph_message_no_delivered_files")); } else { if ($status != "notgraded") { $img = '<img border="0" src="' . ilUtil::getImagePath("scorm/" . $status . ".png") . '" ' . ' alt="' . $lng->txt("rep_robj_xeph_" . $status) . '" title="' . $lng->txt("rep_robj_xeph_" . $status) . '" style="vertical-align:middle;"/>'; $info->addProperty($lng->txt("rep_robj_xeph_status"), $img . " " . $lng->txt("rep_robj_xeph_" . $status)); } } if ($cnt_files > 0) { $info->addSection($lng->txt("fb_files")); $files = $storage->getFeedbackFiles($ilUser->getId()); foreach ($files as $file) { $ilCtrl->setParameterByClass("ilobjephorusgui", "file", urlencode($file)); $info->addProperty($file, $lng->txt("rep_robj_xeph_download"), $ilCtrl->getLinkTargetByClass("ilobjephorusgui", "downloadFeedbackFile")); $ilCtrl->setParameter($this, "file", ""); } } } } $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 = ilEphAssignment::lookupStatusOfUser($ass["id"], $user_id); $this->tpl->setVariable("SEL_" . strtoupper($status), ' selected="selected" '); $this->tpl->setVariable("TXT_NOTGRADED", $lng->txt("rep_robj_xeph_notgraded")); $this->tpl->setVariable("TXT_PASSED", $lng->txt("rep_robj_xeph_passed")); $this->tpl->setVariable("TXT_FAILED", $lng->txt("rep_robj_xeph_failed")); 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("rep_robj_xeph_" . $status)); // mark $mark = ilEphAssignment::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("rep_robj_xeph_mark")); $this->tpl->setVariable("NAME_MARK", "mark[" . $user_id . "]"); include_once 'Services/Tracking/classes/class.ilLPMarks.php'; $mark = ilLPMarks::_lookupMark($user_id, $this->eph_id); $this->tpl->setVariable("VAL_MARK", ilUtil::prepareFormOutput($mark)); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("grade"); $status = ilEphorusMembers::_lookupStatus($this->eph_id, $user_id); $this->tpl->setVariable("SEL_" . strtoupper($status), ' selected="selected" '); 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("rep_robj_xeph_" . $status)); // mark /*$this->tpl->setVariable("TXT_MARK", $lng->txt("eph_mark")); $this->tpl->setVariable("NAME_MARK", "mark[".$d["id"]."]"); $mark = ilEphAssignment::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->eph_id); $this->tpl->setVariable("VAL_COMMENT", ilUtil::prepareFormOutput($c)); }
/** * Exports grades as ephel */ function exportGradesExcel() { include_once "./Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus/classes/class.ilEphAssignment.php"; $ass_data = ilEphAssignment::getAssignmentDataOfEphorus($this->getId()); include_once "./Services/Excel/classes/class.ilExcelWriterAdapter.php"; $ephelfile = ilUtil::ilTempnam(); $adapter = new ilExcelWriterAdapter($ephelfile, 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("rep_robj_xeph_total_exc"))); // data rows $this->mem_obj = new ilEphorusMembers($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 = ilEphAssignment::lookupStatusOfUser($ass["id"], $user_id); $mainworksheet->writeString($row_cnt, $col_cnt, ilExcelUtils::_convert_text($this->lng->txt("rep_robj_xeph_" . $status))); $col_cnt++; } // total status $status = ilEphorusMembers::_lookupStatus($this->getId(), $user_id); $mainworksheet->writeString($row_cnt, $col_cnt, ilExcelUtils::_convert_text($this->lng->txt("rep_robj_xeph_" . $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("rep_robj_xeph_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(ilEphAssignment::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(); $eph_name = ilUtil::getASCIIFilename(preg_replace("/\\s/", "_", $this->getTitle())); ilUtil::deliverFile($ephelfile, $eph_name . ".xls", "application/vnd.ms-ephel"); }