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


PHP ilChangeEvent::hasAccessed方法代码示例

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


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

示例1: determineStatus

 /**
  * Determine status
  *
  * @param	integer		object id
  * @param	integer		user id
  * @param	object		object (optional depends on object type)
  * @return	integer		status
  */
 function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
 {
     $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
     include_once "Services/Tracking/classes/class.ilChangeEvent.php";
     if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id)) {
         $status = self::LP_STATUS_IN_PROGRESS_NUM;
         include_once "Modules/LearningModule/classes/class.ilLMTracker.php";
         $tracker = ilLMTracker::getInstanceByObjId($a_obj_id, $a_user_id);
         if ($tracker->getAllQuestionsCorrect()) {
             $status = self::LP_STATUS_COMPLETED_NUM;
         }
     }
     return $status;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:22,代码来源:class.ilLPStatusQuestions.php

示例2: determineStatus

 /**
  * Determine status
  *
  * @param	integer		object id
  * @param	integer		user id
  * @param	object		object (optional depends on object type)
  * @return	integer		status
  */
 function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
 {
     global $ilObjDataCache, $ilDB;
     $status = LP_STATUS_NOT_ATTEMPTED_NUM;
     switch ($ilObjDataCache->lookupType($a_obj_id)) {
         case 'lm':
             if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id)) {
                 $status = LP_STATUS_IN_PROGRESS_NUM;
                 // completed?
                 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
                 $tlt = $status_info['tlt'];
                 include_once './Services/Tracking/classes/class.ilChangeEvent.php';
                 $re = ilChangeEvent::_lookupReadEvents($a_obj_id, $a_user_id);
                 if ($re[0]['spent_seconds'] >= $tlt) {
                     $status = LP_STATUS_COMPLETED_NUM;
                 }
             }
             break;
     }
     return $status;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:29,代码来源:class.ilLPStatusTypicalLearningTime.php

示例3: determineStatus

 /**
  * Determine status
  *
  * @param	integer		object id
  * @param	integer		user id
  * @param	object		object (optional depends on object type)
  * @return	integer		status
  */
 function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
 {
     global $ilObjDataCache, $ilDB;
     $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
     switch ($ilObjDataCache->lookupType($a_obj_id)) {
         case 'dbk':
         case 'lm':
         case 'htlm':
             include_once "./Services/Tracking/classes/class.ilChangeEvent.php";
             if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id)) {
                 $status = self::LP_STATUS_IN_PROGRESS_NUM;
                 // completed?
                 $set = $ilDB->query($q = "SELECT usr_id FROM ut_lp_marks " . "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " . "AND usr_id = " . $ilDB->quote($a_user_id, 'integer') . " " . "AND completed = '1' ");
                 if ($rec = $ilDB->fetchAssoc($set)) {
                     $status = self::LP_STATUS_COMPLETED_NUM;
                 }
             }
             break;
     }
     return $status;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:29,代码来源:class.ilLPStatusManual.php

示例4: determineStatus

 /**
  * Determine status
  *
  * @param	integer		object id
  * @param	integer		user id
  * @param	object		object (optional depends on object type)
  * @return	integer		status
  */
 function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
 {
     global $ilObjDataCache;
     $status = LP_STATUS_NOT_ATTEMPTED_NUM;
     switch ($ilObjDataCache->lookupType($a_obj_id)) {
         case 'exc':
             include_once './Services/Tracking/classes/class.ilChangeEvent.php';
             include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
             if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id) || ilExerciseMembers::_hasReturned($a_obj_id, $a_user_id)) {
                 $status = LP_STATUS_IN_PROGRESS_NUM;
             }
             $ex_stat = ilExerciseMembers::_lookupStatus($a_obj_id, $a_user_id);
             if ($ex_stat == "passed") {
                 $status = LP_STATUS_COMPLETED_NUM;
             }
             if ($ex_stat == "failed") {
                 $status = LP_STATUS_FAILED_NUM;
             }
             break;
     }
     return $status;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:30,代码来源:class.ilLPStatusExerciseReturned.php

示例5: determineStatus

 /**
  * Determine status
  *
  * @param	integer		object id
  * @param	integer		user id
  * @param	object		object (optional depends on object type)
  * @return	integer		status
  */
 function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
 {
     global $ilObjDataCache, $ilDB, $ilLog;
     $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
     // if the user has accessed the scorm object
     // the status is at least "in progress"
     include_once "./Services/Tracking/classes/class.ilChangeEvent.php";
     if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id)) {
         $status = self::LP_STATUS_IN_PROGRESS_NUM;
     }
     //$ilLog->write("-".$status."-");
     // Which sco's determine the status
     include_once './Services/Object/classes/class.ilObjectLP.php';
     $olp = ilObjectLP::getInstance($a_obj_id);
     $collection = $olp->getCollectionInstance();
     if ($collection) {
         $scos = $collection->getItems();
         if (sizeof($scos)) {
             include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
             $subtype = ilObjSAHSLearningModule::_lookupSubType($a_obj_id);
             switch ($subtype) {
                 case 'hacp':
                 case 'aicc':
                 case 'scorm':
                     include_once "./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php";
                     $scorm_status = ilObjSCORMTracking::_getCollectionStatus($scos, $a_obj_id, $a_user_id);
                     break;
                 case 'scorm2004':
                     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Tracking.php";
                     $scorm_status = ilSCORM2004Tracking::_getCollectionStatus($scos, $a_obj_id, $a_user_id);
                     break;
             }
             switch ($scorm_status) {
                 case "in_progress":
                     $status = self::LP_STATUS_IN_PROGRESS_NUM;
                     break;
                 case "completed":
                     $status = self::LP_STATUS_COMPLETED_NUM;
                     break;
                 case "failed":
                     $status = self::LP_STATUS_FAILED_NUM;
                     break;
             }
         }
     }
     //$ilLog->write("-".$status."-");
     return $status;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:56,代码来源:class.ilLPStatusSCORM.php

示例6: determineStatus

 /**
  * Determine status
  *
  * @param	integer		object id
  * @param	integer		user id
  * @param	object		object (optional depends on object type)
  * @return	integer		status
  */
 function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
 {
     global $ilObjDataCache, $ilDB;
     // the status completed depends on:
     // $status_info['num_objectives'] (ilLPStatusWrapper::_getStatusInfo($a_obj_id);)
     // - ilCourseObjective::_getObjectiveIds($a_obj_id);
     // - table crs_objectives manipulated in
     // - ilCourseObjective
     // $status_info['objective_result']  (ilLPStatusWrapper::_getStatusInfo($a_obj_id);)
     // table crs_objective_status (must not contain a dataset)
     // ilCourseObjectiveResult -> added ilLPStatusWrapper::_updateStatus()
     $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
     switch ($ilObjDataCache->lookupType($a_obj_id)) {
         case "crs":
             include_once "./Services/Tracking/classes/class.ilChangeEvent.php";
             if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id)) {
                 $status = self::LP_STATUS_IN_PROGRESS_NUM;
                 include_once 'Modules/Course/classes/class.ilCourseObjective.php';
                 $objectives = ilCourseObjective::_getObjectiveIds($a_obj_id);
                 if ($objectives) {
                     $set = $ilDB->query("SELECT count(objective_id) cnt FROM crs_objective_status " . "WHERE " . $ilDB->in('objective_id', $objectives, false, 'integer') . " AND user_id = " . $ilDB->quote($a_user_id, "integer"));
                     if ($rec = $ilDB->fetchAssoc($set)) {
                         if ($rec["cnt"] == count($objectives)) {
                             $status = self::LP_STATUS_COMPLETED_NUM;
                         }
                     }
                 }
             }
             break;
     }
     return $status;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:40,代码来源:class.ilLPStatusObjectives.php

示例7: determineStatus

 /**
  * Determine status
  *
  * @param	integer		object id
  * @param	integer		user id
  * @param	object		object (optional depends on object type)
  * @return	integer		status
  */
 function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
 {
     global $ilObjDataCache;
     $status['completed'] = true;
     $status['failed'] = false;
     $status['in_progress'] = false;
     switch ($ilObjDataCache->lookupType($a_obj_id)) {
         case "crs":
         case "fold":
         case "grp":
             include_once "./Services/Tracking/classes/class.ilChangeEvent.php";
             if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id)) {
                 $status['in_progress'] = true;
             }
             include_once './Services/Object/classes/class.ilObjectLP.php';
             $olp = ilObjectLP::getInstance($a_obj_id);
             $collection = $olp->getCollectionInstance();
             if ($collection) {
                 $grouped_items = $collection->getGroupedItemsForLPStatus();
             }
             if (!sizeof($grouped_items)) {
                 // #11513 - empty collections cannot be completed
                 $status['completed'] = false;
             } else {
                 foreach ($grouped_items as $grouping_id => $grouping) {
                     $isGrouping = $grouping_id ? true : false;
                     $status = self::determineGroupingStatus($status, $grouping, $a_user_id, $isGrouping);
                 }
             }
             if ($status['completed']) {
                 return self::LP_STATUS_COMPLETED_NUM;
             }
             if ($status['failed']) {
                 return self::LP_STATUS_FAILED_NUM;
             }
             if ($status['in_progress']) {
                 return self::LP_STATUS_IN_PROGRESS_NUM;
             }
             break;
     }
     return self::LP_STATUS_NOT_ATTEMPTED_NUM;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:50,代码来源:class.ilLPStatusCollection.php

示例8: determineStatus

 /**
  * Determine status
  *
  * @param	integer		object id
  * @param	integer		user id
  * @param	object		object (optional depends on object type)
  * @return	integer		status
  */
 function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
 {
     global $ilObjDataCache, $ilDB;
     // the status completed depends on:
     // $status_info['num_objectives'] (ilLPStatusWrapper::_getStatusInfo($a_obj_id);)
     // - ilCourseObjective::_getObjectiveIds($a_obj_id);
     // - table crs_objectives manipulated in
     // - ilCourseObjective
     // $status_info['objective_result']  (ilLPStatusWrapper::_getStatusInfo($a_obj_id);)
     // table crs_objective_status (must not contain a dataset)
     // ilCourseObjectiveResult -> added ilLPStatusWrapper::_updateStatus()
     $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
     switch ($ilObjDataCache->lookupType($a_obj_id)) {
         case "crs":
             include_once "./Services/Tracking/classes/class.ilChangeEvent.php";
             if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id)) {
                 // change_event is of no use when no objective has been tried
                 // $status = self::LP_STATUS_IN_PROGRESS_NUM;
                 include_once 'Modules/Course/classes/class.ilCourseObjective.php';
                 $objectives = ilCourseObjective::_getObjectiveIds($a_obj_id, true);
                 if ($objectives) {
                     // #14051 - getSummarizedObjectiveStatusForLP() might return null
                     include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
                     $status = (int) ilLOUserResults::getSummarizedObjectiveStatusForLP($objectives, $a_user_id);
                 }
             }
             break;
     }
     return $status;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:38,代码来源:class.ilLPStatusObjectives.php

示例9: determineStatus

 /**
  * Determine status
  *
  * @param	integer		object id
  * @param	integer		user id
  * @param	object		object (optional depends on object type)
  * @return	integer		status
  */
 function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
 {
     global $ilObjDataCache, $ilDB;
     $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
     switch ($ilObjDataCache->lookupType($a_obj_id)) {
         case "crs":
         case "grp":
         case "exc":
             // completed?
             $set = $ilDB->query($q = "SELECT usr_id,mark FROM ut_lp_marks " . "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " . "AND usr_id = " . $ilDB->quote($a_user_id, 'integer') . " " . "AND completed = '1' ");
             $grade = $ilDB->fetchAssoc($ilDB->query("SELECT passing_grade FROM rubric WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer')));
             if ($rec = $ilDB->fetchAssoc($set)) {
                 if ($rec['mark'] < $grade['passing_grade']) {
                     $status = self::LP_STATUS_FAILED_NUM;
                 } else {
                     $status = self::LP_STATUS_COMPLETED_NUM;
                 }
             } else {
                 include_once './Services/Tracking/classes/class.ilChangeEvent.php';
                 if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id)) {
                     $status = self::LP_STATUS_IN_PROGRESS_NUM;
                 }
             }
             break;
     }
     return $status;
 }
开发者ID:JKN-INC,项目名称:SHELBY-ILIAS,代码行数:35,代码来源:class.ilLPStatusRubric.php

示例10: determineStatus

 /**
  * Determine status
  *
  * @param	integer		object id
  * @param	integer		user id
  * @param	object		object (optional depends on object type)
  * @return	integer		status
  */
 function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
 {
     global $ilObjDataCache;
     $status['completed'] = true;
     $status['failed'] = false;
     $status['in_progress'] = false;
     $status['not_attempted'] = true;
     switch ($ilObjDataCache->lookupType($a_obj_id)) {
         case "crs":
         case "fold":
         case "grp":
             include_once "./Services/Tracking/classes/class.ilChangeEvent.php";
             if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id)) {
                 $status['in_progress'] = true;
             }
             include_once './Services/Tracking/classes/class.ilLPCollectionCache.php';
             foreach (ilLPCollectionCache::getGroupedItems($a_obj_id, true) as $grouping_id => $grouping) {
                 $isGrouping = $grouping_id ? true : false;
                 $status = self::determineGroupingStatus($status, $grouping, $a_user_id, $isGrouping);
             }
             if ($status['completed']) {
                 return LP_STATUS_COMPLETED_NUM;
             }
             if ($status['failed']) {
                 return LP_STATUS_FAILED_NUM;
             }
             if ($status['in_progress']) {
                 return LP_STATUS_IN_PROGRESS_NUM;
             }
             return LP_STATUS_NOT_ATTEMPTED_NUM;
     }
     return LP_STATUS_NOT_ATTEMPTED_NUM;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:41,代码来源:class.ilLPStatusCollection.php


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