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


PHP ilCourseParticipants::_updatePassed方法代码示例

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


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

示例1: handleEvent

 /**
  * Handle an event in a listener.
  *
  * @param	string	$a_component	component, e.g. "Modules/Forum" or "Services/User"
  * @param	string	$a_event		event e.g. "createUser", "updateUser", "deleteUser", ...
  * @param	array	$a_parameter	parameter array (assoc), array("name" => ..., "phone_office" => ...)
  */
 static function handleEvent($a_component, $a_event, $a_parameter)
 {
     global $ilUser;
     if ($a_component == "Services/Tracking" && $a_event == "updateStatus") {
         // #13905
         include_once "Services/Tracking/classes/class.ilObjUserTracking.php";
         if (!ilObjUserTracking::_enabledLearningProgress()) {
             return;
         }
         $obj_id = $a_parameter["obj_id"];
         $user_id = $a_parameter["usr_id"];
         $status = $a_parameter["status"];
         if ($obj_id && $user_id) {
             if (ilObject::_lookupType($obj_id) != "crs") {
                 return;
             }
             // determine couse setting only once
             if (!isset(self::$course_mode[$obj_id])) {
                 include_once "./Modules/Course/classes/class.ilObjCourse.php";
                 $crs = new ilObjCourse($obj_id, false);
                 if ($crs->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP) {
                     include_once './Services/Object/classes/class.ilObjectLP.php';
                     $olp = ilObjectLP::getInstance($obj_id);
                     $mode = $olp->getCurrentMode();
                 } else {
                     $mode = false;
                 }
                 self::$course_mode[$obj_id] = $mode;
             }
             $is_completed = $status == ilLPStatus::LP_STATUS_COMPLETED_NUM;
             // we are NOT using the members object because of performance issues
             switch (self::$course_mode[$obj_id]) {
                 case ilLPObjSettings::LP_MODE_MANUAL_BY_TUTOR:
                     // #11600
                     include_once "Modules/Course/classes/class.ilCourseParticipants.php";
                     ilCourseParticipants::_updatePassed($obj_id, $user_id, $is_completed, true);
                     break;
                 case ilLPObjSettings::LP_MODE_COLLECTION:
                 case ilLPObjSettings::LP_MODE_OBJECTIVES:
                     // overwrites course passed status if it was set automatically (full sync)
                     // or toggle manually set passed status to completed (1-way-sync)
                     $do_update = $is_completed;
                     include_once "Modules/Course/classes/class.ilCourseParticipants.php";
                     if (!$do_update) {
                         $part = new ilCourseParticipants($obj_id);
                         $passed = $part->getPassedInfo($user_id);
                         if (!is_array($passed) || $passed["user_id"] == -1) {
                             $do_update = true;
                         }
                     }
                     if ($do_update) {
                         ilCourseParticipants::_updatePassed($obj_id, $user_id, $is_completed);
                     }
                     break;
             }
         }
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:65,代码来源:class.ilCourseAppEventListener.php

示例2: handleEvent

 /**
  * Handle an event in a listener.
  *
  * @param	string	$a_component	component, e.g. "Modules/Forum" or "Services/User"
  * @param	string	$a_event		event e.g. "createUser", "updateUser", "deleteUser", ...
  * @param	array	$a_parameter	parameter array (assoc), array("name" => ..., "phone_office" => ...)
  */
 static function handleEvent($a_component, $a_event, $a_parameter)
 {
     global $ilUser;
     if ($a_component == "Services/Tracking" && $a_event == "updateStatus") {
         $obj_id = $a_parameter["obj_id"];
         $user_id = $a_parameter["usr_id"];
         $status = $a_parameter["status"];
         if ($obj_id && $user_id) {
             if (ilObject::_lookupType($obj_id) != "crs") {
                 return;
             }
             // determine couse setting only once
             if (!isset(self::$course_mode[$obj_id])) {
                 include_once "./Modules/Course/classes/class.ilObjCourse.php";
                 $crs = new ilObjCourse($obj_id, false);
                 if ($crs->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP) {
                     include_once './Services/Tracking/classes/class.ilLPObjSettings.php';
                     $lp_settings = new ilLPObjSettings($obj_id);
                     $mode = $lp_settings->getMode();
                 } else {
                     $mode = false;
                 }
                 self::$course_mode[$obj_id] = $mode;
             }
             $is_completed = $status == LP_STATUS_COMPLETED_NUM;
             // we are NOT using the members object because of performance issues
             switch (self::$course_mode[$obj_id]) {
                 case LP_MODE_MANUAL_BY_TUTOR:
                     include_once "Modules/Course/classes/class.ilCourseParticipants.php";
                     ilCourseParticipants::_updatePassed($obj_id, $user_id, $is_completed, $ilUser->getId());
                     break;
                 case LP_MODE_COLLECTION:
                 case LP_MODE_OBJECTIVES:
                     if ($is_completed) {
                         include_once "Modules/Course/classes/class.ilCourseParticipants.php";
                         ilCourseParticipants::_updatePassed($obj_id, $user_id, $is_completed, -1);
                     }
                     break;
             }
         }
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:49,代码来源:class.ilCourseAppEventListener.php


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