/** * show information screen */ function infoScreen() { global $ilAccess, $ilUser, $ilTabs, $lng; $ilTabs->activateTab("info"); $this->checkPermission("visible"); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); $info->enableNews(); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { $info->enableNewsEditing(); $info->setBlockProperty("news", "settings", true); } // standard meta data //$info->addMetaDataSections($this->object->getId(),0, $this->object->getType()); // instructions $info->addSection($this->lng->txt("exc_overview")); include_once "./Modules/Exercise/classes/class.ilExAssignment.php"; $ass = ilExAssignment::getAssignmentDataOfExercise($this->object->getId()); $cnt = 0; $mcnt = 0; foreach ($ass as $a) { $cnt++; if ($a["mandatory"]) { $mcnt++; } } $info->addProperty($lng->txt("exc_assignments"), $cnt); $info->addProperty($lng->txt("exc_mandatory"), $mcnt); if ($this->object->getPassMode() != "nr") { $info->addProperty($lng->txt("exc_pass_mode"), $lng->txt("exc_msg_all_mandatory_ass")); } else { $info->addProperty($lng->txt("exc_pass_mode"), sprintf($lng->txt("exc_msg_min_number_ass"), $this->object->getPassNr())); } // feedback from tutor include_once "Services/Tracking/classes/class.ilLPMarks.php"; if ($ilAccess->checkAccess("read", "", $this->ref_id)) { $lpcomment = ilLPMarks::_lookupComment($ilUser->getId(), $this->object->getId()); $mark = ilLPMarks::_lookupMark($ilUser->getId(), $this->object->getId()); //$status = ilExerciseMembers::_lookupStatus($this->object->getId(), $ilUser->getId()); $st = $this->object->determinStatusOfUser($ilUser->getId()); $status = $st["overall_status"]; if ($lpcomment != "" || $mark != "" || $status != "notgraded") { $info->addSection($this->lng->txt("exc_feedback_from_tutor")); if ($lpcomment != "") { $info->addProperty($this->lng->txt("exc_comment"), $lpcomment); } if ($mark != "") { $info->addProperty($this->lng->txt("exc_mark"), $mark); } //if ($status == "") //{ // $info->addProperty($this->lng->txt("status"), // $this->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) . '" />'; $add = ""; if ($st["failed_a_mandatory"]) { $add = " (" . $lng->txt("exc_msg_failed_mandatory") . ")"; } else { if ($status == "failed") { $add = " (" . $lng->txt("exc_msg_missed_minimum_number") . ")"; } } $info->addProperty($this->lng->txt("status"), $img . " " . $this->lng->txt("exc_" . $status) . $add); } } } // forward the command $this->ctrl->forwardCommand($info); }
function __appendLPDetails(&$info, $item_id, $user_id) { global $ilObjDataCache; $type = $ilObjDataCache->lookupType($item_id); // Section learning_progress // $info->addSection($this->lng->txt('trac_learning_progress')); // see ilLPTableBaseGUI::parseTitle(); $info->addSection($this->lng->txt("trac_progress") . ": " . ilObject::_lookupTitle($item_id)); $olp = ilObjectLP::getInstance($item_id); $info->addProperty($this->lng->txt('trac_mode'), $olp->getModeText($olp->getCurrentMode())); switch ($type) { case 'lm': case 'htlm': include_once 'Services/Tracking/classes/class.ilLearningProgress.php'; $progress = ilLearningProgress::_getProgress($user_id, $item_id); if ($progress['access_time']) { $info->addProperty($this->lng->txt('last_access'), ilDatePresentation::formatDate(new ilDateTime($progress['access_time'], IL_CAL_DATETIME))); } else { $info->addProperty($this->lng->txt('last_access'), $this->lng->txt('trac_not_accessed')); } $info->addProperty($this->lng->txt('trac_visits'), (int) $progress['visits']); if ($type == 'lm') { $info->addProperty($this->lng->txt('trac_spent_time'), ilFormat::_secondsToString($progress['spent_seconds'])); } // fallthrough // fallthrough case 'exc': case 'tst': case 'crs': case 'sahs': case 'grp': // display status as image include_once "./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php"; $status = $this->__readStatus($item_id, $user_id); $status_path = ilLearningProgressBaseGUI::_getImagePathForStatus($status); $status_text = ilLearningProgressBaseGUI::_getStatusText($status); $info->addProperty($this->lng->txt('trac_status'), ilUtil::img($status_path, $status_text) . " " . $status_text); // #15334 - see ilLPTableBaseGUI::isPercentageAvailable() $mode = $olp->getCurrentMode(); if (in_array($mode, array(ilLPObjSettings::LP_MODE_TLT, ilLPObjSettings::LP_MODE_VISITS, ilLPObjSettings::LP_MODE_SCORM, ilLPObjSettings::LP_MODE_TEST_PASSED))) { include_once 'Services/Tracking/classes/class.ilLPStatus.php'; $perc = ilLPStatus::_lookupPercentage($item_id, $user_id); $info->addProperty($this->lng->txt('trac_percentage'), (int) $perc . "%"); } break; } include_once 'Services/Tracking/classes/class.ilLPMarks.php'; if (strlen($mark = ilLPMarks::_lookupMark($user_id, $item_id))) { $info->addProperty($this->lng->txt('trac_mark'), $mark); } if (strlen($comment = ilLPMarks::_lookupComment($user_id, $item_id))) { $info->addProperty($this->lng->txt('trac_comment'), $comment); } }
/** * show information screen */ function infoScreen() { global $ilAccess, $ilUser, $ilTabs, $lng, $tpl; $ilTabs->activateTab("info"); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $tpl->setDescription($this->object->getDescription()); $info->enablePrivateNotes(); $info->enableNews(); if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) { $info->enableNewsEditing(); $info->setBlockProperty("news", "settings", true); } // standard meta data //$info->addMetaDataSections($this->object->getId(),0, $this->object->getType()); // instructions $info->addSection($this->lng->txt("rep_robj_xeph_overview")); include_once "./Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus/classes/class.ilEphAssignment.php"; $ass = ilEphAssignment::getAssignmentDataOfEphorus($this->object->getId()); $cnt = 0; $mcnt = 0; foreach ($ass as $a) { $cnt++; if ($a["mandatory"]) { $mcnt++; } } $info->addProperty($lng->txt("rep_robj_xeph_assignments"), $cnt); $info->addProperty($lng->txt("rep_robj_xeph_mandatory"), $mcnt); if ($this->object->getPassMode() != "nr") { $info->addProperty($lng->txt("rep_robj_xeph_pass_mode"), $lng->txt("rep_robj_xeph_msg_all_mandatory_ass")); } else { $info->addProperty($lng->txt("rep_robj_xeph_pass_mode"), sprintf($lng->txt("rep_robj_xeph_msg_min_number_ass"), $this->object->getPassNr())); } // feedback from tutor include_once "Services/Tracking/classes/class.ilLPMarks.php"; if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) { $lpcomment = ilLPMarks::_lookupComment($ilUser->getId(), $this->object->getId()); $mark = ilLPMarks::_lookupMark($ilUser->getId(), $this->object->getId()); //$status = ilEphorusMembers::_lookupStatus($this->object->getId(), $ilUser->getId()); $st = $this->object->determineStatusOfUser($ilUser->getId()); $status = $st["overall_status"]; if ($lpcomment != "" || $mark != "" || $status != "notgraded") { $info->addSection($this->lng->txt("rep_robj_xeph_feedback_from_tutor")); if ($lpcomment != "") { $info->addProperty($this->lng->txt("rep_robj_xeph_comment"), $lpcomment); } if ($mark != "") { $info->addProperty($this->lng->txt("rep_robj_xeph_mark"), $mark); } //if ($status == "") //{ // $info->addProperty($this->lng->txt("status"), // $this->lng->txt("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;"/>'; $add = ""; if ($st["failed_a_mandatory"]) { $add = " (" . $lng->txt("rep_robj_xeph_msg_failed_mandatory") . ")"; } else { if ($status == "failed") { $add = " (" . $lng->txt("rep_robj_xeph_msg_missed_minimum_number") . ")"; } } $info->addProperty($this->lng->txt("status"), $img . " " . $this->lng->txt("rep_robj_xeph_" . $status) . $add); } } } // forward the command $this->ctrl->forwardCommand($info); }
/** * 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)); }
function __appendLPDetails(&$info, $item_id, $user_id) { global $ilObjDataCache; $type = $ilObjDataCache->lookupType($item_id); // Section learning_progress $info->addSection($this->lng->txt('trac_learning_progress')); switch ($type) { case 'lm': case 'htlm': include_once 'Services/Tracking/classes/class.ilLearningProgress.php'; $progress = ilLearningProgress::_getProgress($user_id, $item_id); if ($progress['access_time']) { $info->addProperty($this->lng->txt('last_access'), ilDatePresentation::formatDate(new ilDateTime($progress['access_time'], IL_CAL_DATETIME))); } else { $info->addProperty($this->lng->txt('last_access'), $this->lng->txt('trac_not_accessed')); } $info->addProperty($this->lng->txt('trac_visits'), (int) $progress['visits']); if ($type == 'lm') { $info->addProperty($this->lng->txt('trac_spent_time'), ilFormat::_secondsToString($progress['spent_seconds'])); } // display status as image include_once "./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php"; $status = $this->__readStatus($item_id, $user_id); $status_path = ilLearningProgressBaseGUI::_getImagePathForStatus($status); $status_text = ilLearningProgressBaseGUI::_getStatusText($status); $info->addProperty($this->lng->txt('trac_status'), ilUtil::img($status_path, $status_text) . " " . $status_text); break; case 'exc': case 'tst': case 'crs': case 'sahs': case 'grp': // display status as image include_once "./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php"; $status = $this->__readStatus($item_id, $user_id); $status_path = ilLearningProgressBaseGUI::_getImagePathForStatus($status); $status_text = ilLearningProgressBaseGUI::_getStatusText($status); $info->addProperty($this->lng->txt('trac_status'), ilUtil::img($status_path, $status_text) . " " . $status_text); break; } include_once 'Services/Tracking/classes/class.ilLPMarks.php'; if (strlen($mark = ilLPMarks::_lookupMark($user_id, $item_id))) { $info->addProperty($this->lng->txt('trac_mark'), $mark); } if (strlen($comment = ilLPMarks::_lookupComment($user_id, $item_id))) { $info->addProperty($this->lng->txt('trac_comment'), $comment); } }
/** * Test LP marks * @param * @return */ public function testLPMarks() { include_once './Services/Tracking/classes/class.ilLPMarks.php'; include_once './Services/Tracking/classes/class.ilLPStatusFactory.php'; $marks = new ilLPMarks(999, 888); $marks->setMark('Gut'); $marks->setComment('Weiter so'); $marks->setCompleted(true); $marks->update(); $marks = new ilLPMarks(999, 888); $mark = $marks->getMark(); $this->assertEquals($mark, 'Gut'); $comment = ilLPMarks::_lookupComment(888, 999); $this->assertEquals($comment, 'Weiter so'); $class = ilLPStatusFactory::_getClassById(999, ilLPObjSettings::LP_MODE_MANUAL); $completed = $class::_getCompleted(999); $this->assertEquals(array(888), $completed); ilLPMarks::deleteObject(999); }
/** * show information screen */ function infoScreen() { global $ilAccess, $ilUser, $ilTabs, $lng; $ilTabs->activateTab("info_short"); if (!$ilAccess->checkAccess("visible", "", $this->object->getRefId())) { $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE); } include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); if (trim($this->object->getIntroduction()) != "") { $info->addSection($lng->txt("wiki_introduction")); $info->addProperty("", nl2br($this->object->getIntroduction())); } // feedback from tutor; mark, status, comment include_once "./Modules/Wiki/classes/class.ilWikiContributor.php"; include_once "./Services/Tracking/classes/class.ilLPMarks.php"; $lpcomment = ilLPMarks::_lookupComment($ilUser->getId(), $this->object->getId()); $mark = ilLPMarks::_lookupMark($ilUser->getId(), $this->object->getId()); $status = ilWikiContributor::_lookupStatus($this->object->getId(), $ilUser->getId()); if ($lpcomment != "" || $mark != "" || $status != ilWikiContributor::STATUS_NOT_GRADED) { $info->addSection($this->lng->txt("wiki_feedback_from_tutor")); if ($lpcomment != "") { $info->addProperty($this->lng->txt("wiki_comment"), $lpcomment); } if ($mark != "") { $info->addProperty($this->lng->txt("wiki_mark"), $mark); } if ($status == ilWikiContributor::STATUS_PASSED) { $info->addProperty($this->lng->txt("status"), $this->lng->txt("wiki_passed")); } if ($status == ilWikiContributor::STATUS_FAILED) { $info->addProperty($this->lng->txt("status"), $this->lng->txt("wiki_failed")); } } /* $info->enableNews(); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { //$info->enableNewsEditing(); $info->setBlockProperty("news", "settings", true); }*/ if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) { $info->addButton($lng->txt("wiki_start_page"), ilObjWikiGUI::getGotoLink($this->object->getRefId())); } // general information $this->lng->loadLanguageModule("meta"); $this->lng->loadLanguageModule("wiki"); //$info->addSection($this->lng->txt("meta_general")); //$info->addProperty($this->lng->txt("mcst_nr_items"), // (int) count($med_items)); // forward the command $this->ctrl->forwardCommand($info); if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) { // $this->setSideBlock(); } }
/** * Standard Version of Fill Row. Most likely to * be overwritten by derived class. */ protected function fillRow($a_set) { global $lng, $ilCtrl, $lng; include_once "./Services/Tracking/classes/class.ilLPMarks.php"; include_once "./Modules/Wiki/classes/class.ilWikiContributor.php"; if (ilObject::_exists($a_set["user_id"])) { arsort($a_set["pages"]); // pages foreach ($a_set["pages"] as $page_id => $cnt) { if ($page_id > 0) { include_once "./Modules/Wiki/classes/class.ilWikiPage.php"; $title = ilWikiPage::lookupTitle($page_id); $this->tpl->setCurrentBlock("page"); $this->tpl->setVariable("PAGE", $title); $this->tpl->setVariable("CNT", $cnt); $this->tpl->parseCurrentBlock(); } } $this->tpl->setVariable("TXT_LINKED_USER", $user["lastname"] . ", " . $user["firstname"] . " [" . $login . "]"); // profile link //$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "user", $a_set["user"]); //$ilCtrl->setParameterByClass("ilpublicuserprofilegui", "back_url", // rawurlencode($ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCmd()))); //$this->tpl->setVariable("USER_LINK", // $ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML")); $img = ilObjUser::_getPersonalPicturePath($a_set["user_id"], "xsmall"); $this->tpl->setVariable("IMG_USER", $img); $this->tpl->setVariable("TXT_NAME", $a_set["lastname"] . ", " . $a_set["firstname"]); $this->tpl->setVariable("USER_ID", $a_set["user_id"]); // comment for learner $this->tpl->setVariable("TXT_LCOMMENT", $lng->txt("wiki_comment_for_learner")); $this->tpl->setVariable("NAME_LCOMMENT", "lcomment[" . $a_set["user_id"] . "]"); $lpcomment = ilLPMarks::_lookupComment($a_set["user_id"], $this->parent_obj->object->getId()); $this->tpl->setVariable("VAL_LCOMMENT", ilUtil::prepareFormOutput($lpcomment)); // status //$status = ilExerciseMembers::_lookupStatus($this->object->getId(), $member_id); $status = ilWikiContributor::_lookupStatus($this->parent_obj->object->getId(), $a_set["user_id"]); $this->tpl->setVariable("SEL_" . $status, ' selected="selected" '); $this->tpl->setVariable("TXT_NOTGRADED", $lng->txt("wiki_notgraded")); $this->tpl->setVariable("TXT_PASSED", $lng->txt("wiki_passed")); $this->tpl->setVariable("TXT_FAILED", $lng->txt("wiki_failed")); $this->tpl->setVariable("VAL_NOTGRADED", ilWikiContributor::STATUS_NOT_GRADED); $this->tpl->setVariable("VAL_PASSED", ilWikiContributor::STATUS_PASSED); $this->tpl->setVariable("VAL_FAILED", ilWikiContributor::STATUS_FAILED); if (($sd = ilWikiContributor::_lookupStatusTime($this->parent_obj->object->getId(), $a_set["user_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 ilWikiContributor::STATUS_PASSED: $pic = "scorm/passed.png"; break; case ilWikiContributor::STATUS_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("wiki_" . $status)); // mark $this->tpl->setVariable("TXT_MARK", $lng->txt("wiki_mark")); $this->tpl->setVariable("NAME_MARK", "mark[" . $a_set["user_id"] . "]"); $mark = ilLPMarks::_lookupMark($a_set["user_id"], $this->parent_obj->object->getId()); $this->tpl->setVariable("VAL_MARK", ilUtil::prepareFormOutput($mark)); } }