当前位置: 首页>>代码示例>>PHP>>正文


PHP ilLPStatusWrapper::_lookupInProgressForObject方法代码示例

本文整理汇总了PHP中ilLPStatusWrapper::_lookupInProgressForObject方法的典型用法代码示例。如果您正苦于以下问题:PHP ilLPStatusWrapper::_lookupInProgressForObject方法的具体用法?PHP ilLPStatusWrapper::_lookupInProgressForObject怎么用?PHP ilLPStatusWrapper::_lookupInProgressForObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilLPStatusWrapper的用法示例。


在下文中一共展示了ilLPStatusWrapper::_lookupInProgressForObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: gatherCourseLPData

 function gatherCourseLPData()
 {
     global $tree, $ilDB;
     // process all courses
     $all_courses = array_keys(ilObject::_getObjectsByType("crs"));
     if ($all_courses) {
         // gather objects in trash
         $trashed_objects = $tree->getSavedNodeObjIds($all_courses);
         include_once 'Services/Tracking/classes/class.ilLPObjSettings.php';
         include_once "Modules/Course/classes/class.ilCourseParticipants.php";
         include_once "Services/Tracking/classes/class.ilLPStatusWrapper.php";
         foreach ($all_courses as $crs_id) {
             // trashed objects will not change
             if (!in_array($crs_id, $trashed_objects)) {
                 // only if LP is active
                 $mode = ilLPObjSettings::_lookupMode($crs_id);
                 if ($mode == LP_MODE_DEACTIVATED || $mode == LP_MODE_UNDEFINED) {
                     continue;
                 }
                 // only save once per day
                 $ilDB->manipulate("DELETE FROM obj_lp_stat WHERE" . " obj_id = " . $ilDB->quote($crs_id, "integer") . " AND fulldate = " . $ilDB->quote(date("Ymd", $this->date), "integer"));
                 $members = new ilCourseParticipants($crs_id);
                 $members = $members->getMembers();
                 $in_progress = count(ilLPStatusWrapper::_lookupInProgressForObject($crs_id, $members));
                 $completed = count(ilLPStatusWrapper::_lookupCompletedForObject($crs_id, $members));
                 $failed = count(ilLPStatusWrapper::_lookupFailedForObject($crs_id, $members));
                 // calculate with other values - there is not direct method
                 $not_attempted = count($members) - $in_progress - $completed - $failed;
                 $set = array("type" => array("text", "crs"), "obj_id" => array("integer", $crs_id), "yyyy" => array("integer", date("Y", $this->date)), "mm" => array("integer", date("m", $this->date)), "dd" => array("integer", date("d", $this->date)), "fulldate" => array("integer", date("Ymd", $this->date)), "mem_cnt" => array("integer", count($members)), "in_progress" => array("integer", $in_progress), "completed" => array("integer", $completed), "failed" => array("integer", $failed), "not_attempted" => array("integer", $not_attempted));
                 $ilDB->insert("obj_lp_stat", $set);
             }
         }
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:34,代码来源:class.ilCronObjectStatisticsCheck.php

示例2: fetchPrintMemberData

 function fetchPrintMemberData($a_members)
 {
     global $ilAccess, $lng;
     $lng->loadLanguageModule('trac');
     #$is_admin = (bool) $ilAccess->checkAccess("write",'',$this->object->getRefId());
     $is_admin = true;
     include_once './Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
     $privacy = ilPrivacySettings::_getInstance();
     if ($privacy->enabledCourseAccessTimes()) {
         include_once './Services/Tracking/classes/class.ilLearningProgress.php';
         $progress = ilLearningProgress::_lookupProgressByObjId($this->object->getId());
     }
     if ($this->show_tracking) {
         include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
         $completed = ilLPStatusWrapper::_lookupCompletedForObject($this->object->getId());
         $in_progress = ilLPStatusWrapper::_lookupInProgressForObject($this->object->getId());
         $failed = ilLPStatusWrapper::_lookupFailedForObject($this->object->getId());
     }
     foreach ($a_members as $member_id) {
         // GET USER OBJ
         if ($tmp_obj = ilObjectFactory::getInstanceByObjId($member_id, false)) {
             $print_member[$member_id]['login'] = $tmp_obj->getLogin();
             $print_member[$member_id]['name'] = $tmp_obj->getLastname() . ', ' . $tmp_obj->getFirstname();
             if ($this->object->getMembersObject()->isAdmin($member_id)) {
                 $print_member[$member_id]['role'] = $this->lng->txt("il_crs_admin");
             } elseif ($this->object->getMembersObject()->isTutor($member_id)) {
                 $print_member[$member_id]['role'] = $this->lng->txt("il_crs_tutor");
             } elseif ($this->object->getMembersObject()->isMember($member_id)) {
                 $print_member[$member_id]['role'] = $this->lng->txt("il_crs_member");
             }
             if ($this->object->getMembersObject()->isAdmin($member_id) or $this->object->getMembersObject()->isTutor($member_id)) {
                 if ($this->object->getMembersObject()->isNotificationEnabled($member_id)) {
                     $print_member[$member_id]['status'] = $this->lng->txt("crs_notify");
                 } else {
                     $print_member[$member_id]['status'] = $this->lng->txt("crs_no_notify");
                 }
             } else {
                 if ($this->object->getMembersObject()->isBlocked($member_id)) {
                     $print_member[$member_id]['status'] = $this->lng->txt("crs_blocked");
                 } else {
                     $print_member[$member_id]['status'] = $this->lng->txt("crs_unblocked");
                 }
             }
             if ($is_admin) {
                 $print_member[$member_id]['passed'] = $this->object->getMembersObject()->hasPassed($member_id) ? $this->lng->txt('crs_member_passed') : $this->lng->txt('crs_member_not_passed');
             }
             if ($privacy->enabledCourseAccessTimes()) {
                 if (isset($progress[$member_id]['ts']) and $progress[$member_id]['ts']) {
                     ilDatePresentation::setUseRelativeDates(false);
                     $print_member[$member_id]['access'] = ilDatePresentation::formatDate(new ilDateTime($progress[$member_id]['ts'], IL_CAL_UNIX));
                     ilDatePresentation::setUseRelativeDates(true);
                 } else {
                     $print_member[$member_id]['access'] = $this->lng->txt('no_date');
                 }
             }
             if ($this->show_tracking) {
                 if (in_array($member_id, $completed)) {
                     $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_COMPLETED);
                 } elseif (in_array($member_id, $in_progress)) {
                     $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_IN_PROGRESS);
                 } elseif (in_array($member_id, $failed)) {
                     $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_FAILED);
                 } else {
                     $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_NOT_ATTEMPTED);
                 }
             }
         }
     }
     switch ($_SESSION['crs_print_sort']) {
         case 'progress':
             return ilUtil::sortArray($print_member, 'progress', $_SESSION['crs_print_order'], false, true);
         case 'access_time':
             return ilUtil::sortArray($print_member, 'access', $_SESSION['crs_print_order'], false, true);
         case 'lastname':
             return ilUtil::sortArray($print_member, 'name', $_SESSION['crs_print_order'], false, true);
         case 'login':
             return ilUtil::sortArray($print_member, 'login', $_SESSION['crs_print_order'], false, true);
         case 'passed':
             return ilUtil::sortArray($print_member, 'passed', $_SESSION['crs_print_order'], false, true);
         case 'blocked':
         case 'notification':
             return ilUtil::sortArray($print_member, 'status', $_SESSION['crs_print_order'], false, true);
         default:
             return ilUtil::sortArray($print_member, 'name', $_SESSION['crs_print_order'], false, true);
     }
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:86,代码来源:class.ilObjCourseGUI.php

示例3: readMemberData

 protected function readMemberData($ids, $role = 'admin')
 {
     include_once './Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
     $privacy = ilPrivacySettings::_getInstance();
     if ($this->show_tracking) {
         include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
         $completed = ilLPStatusWrapper::_lookupCompletedForObject($this->object->getId());
         $in_progress = ilLPStatusWrapper::_lookupInProgressForObject($this->object->getId());
         $failed = ilLPStatusWrapper::_lookupFailedForObject($this->object->getId());
     }
     if ($privacy->enabledGroupAccessTimes()) {
         include_once './Services/Tracking/classes/class.ilLearningProgress.php';
         $progress = ilLearningProgress::_lookupProgressByObjId($this->object->getId());
     }
     foreach ($ids as $usr_id) {
         $name = ilObjUser::_lookupName($usr_id);
         $tmp_data['firstname'] = $name['firstname'];
         $tmp_data['lastname'] = $name['lastname'];
         $tmp_data['login'] = ilObjUser::_lookupLogin($usr_id);
         $tmp_data['notification'] = $this->object->members_obj->isNotificationEnabled($usr_id) ? 1 : 0;
         $tmp_data['usr_id'] = $usr_id;
         $tmp_data['login'] = ilObjUser::_lookupLogin($usr_id);
         if ($this->show_tracking) {
             if (in_array($usr_id, $completed)) {
                 $tmp_data['progress'] = LP_STATUS_COMPLETED;
             } elseif (in_array($usr_id, $in_progress)) {
                 $tmp_data['progress'] = LP_STATUS_IN_PROGRESS;
             } elseif (in_array($usr_id, $failed)) {
                 $tmp_data['progress'] = LP_STATUS_FAILED;
             } else {
                 $tmp_data['progress'] = LP_STATUS_NOT_ATTEMPTED;
             }
         }
         if ($privacy->enabledGroupAccessTimes()) {
             if (isset($progress[$usr_id]['ts']) and $progress[$usr_id]['ts']) {
                 $tmp_data['access_time'] = ilDatePresentation::formatDate($tmp_date = new ilDateTime($progress[$usr_id]['ts'], IL_CAL_UNIX));
                 $tmp_data['access_time_unix'] = $tmp_date->get(IL_CAL_UNIX);
             } else {
                 $tmp_data['access_time'] = $this->lng->txt('no_date');
                 $tmp_data['access_time_unix'] = 0;
             }
         }
         $members[$usr_id] = $tmp_data;
     }
     return $members ? $members : array();
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:46,代码来源:class.ilObjGroupGUI.php


注:本文中的ilLPStatusWrapper::_lookupInProgressForObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。