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


PHP Skill::get_count_skills_by_course方法代码示例

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


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

示例1: array

         }
     }
     break;
 case 'get_user_skill_ranking':
     $columns = array('photo', 'firstname', 'lastname', 'skills_acquired', 'currently_learning', 'rank');
     $result = $skill->get_user_list_skill_ranking($start, $limit, $sidx, $sord, $whereCondition);
     $result = ArrayClass::msort($result, 'skills_acquired', 'asc');
     $skills_in_course = array();
     if (!empty($result)) {
         foreach ($result as &$item) {
             $user_info = api_get_user_info($item['user_id']);
             $personal_course_list = UserManager::get_personal_session_course_list($item['user_id']);
             $count_skill_by_course = array();
             foreach ($personal_course_list as $course_item) {
                 if (!isset($skills_in_course[$course_item['code']])) {
                     $count_skill_by_course[$course_item['code']] = $skill->get_count_skills_by_course($course_item['code']);
                     $skills_in_course[$course_item['code']] = $count_skill_by_course[$course_item['code']];
                 } else {
                     $count_skill_by_course[$course_item['code']] = $skills_in_course[$course_item['code']];
                 }
             }
             $item['photo'] = Display::img($user_info['avatar_small'], $user_info['complete_name'], [], false);
             $item['currently_learning'] = !empty($count_skill_by_course) ? array_sum($count_skill_by_course) : 0;
         }
     }
     break;
 case 'get_course_announcements':
     $columns = array('title', 'username', 'insert_date', 'actions');
     $titleToSearch = isset($_REQUEST['title_to_search']) ? $_REQUEST['title_to_search'] : '';
     $userIdToSearch = isset($_REQUEST['user_id_to_search']) ? $_REQUEST['user_id_to_search'] : 0;
     $result = AnnouncementManager::getAnnouncements(null, null, false, $start, $limit, $sidx, $sord, $titleToSearch, $userIdToSearch);
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:model.ajax.php

示例2: indexAction


//.........这里部分代码省略.........
                 foreach ($result as $row) {
                     $row['training_hours'] = api_time_to_hms($row['training_hours']);
                     $row['average_hours_per_user'] = api_time_to_hms($row['average_hours_per_user']);
                     $new_result[] = $row;
                 }
                 $result = $new_result;
             }
             break;
         case 'get_user_course_report':
             $columns = array('course', 'user', 'time', 'certificate', 'progress_100', 'progress');
             $column_names = array(get_lang('Course'), get_lang('User'), get_lang('ManHours'), get_lang('CertificateGenerated'), get_lang('Approved'), get_lang('CourseAdvance'));
             $extra_fields = \UserManager::get_extra_fields(0, 100, null, null, true, true);
             if (!empty($extra_fields)) {
                 foreach ($extra_fields as $extra) {
                     $columns[] = $extra['1'];
                     $column_names[] = $extra['3'];
                 }
             }
             $result = \CourseManager::get_user_list_from_course_code(null, null, "LIMIT {$start}, {$limit}", " {$sidx} {$sord}", null, null, true);
             break;
         case 'get_user_skill_ranking':
             $columns = array('photo', 'firstname', 'lastname', 'skills_acquired', 'currently_learning', 'rank');
             $result = $skill->get_user_list_skill_ranking($start, $limit, $sidx, $sord, $where_condition);
             $result = \ArrayClass::msort($result, 'skills_acquired', 'asc');
             $skills_in_course = array();
             if (!empty($result)) {
                 //$counter = 1;
                 foreach ($result as &$item) {
                     $user_info = api_get_user_info($item['user_id']);
                     $personal_course_list = \UserManager::get_personal_session_course_list($item['user_id']);
                     $count_skill_by_course = array();
                     foreach ($personal_course_list as $course_item) {
                         if (!isset($skills_in_course[$course_item['code']])) {
                             $count_skill_by_course[$course_item['code']] = $skill->get_count_skills_by_course($course_item['code']);
                             $skills_in_course[$course_item['code']] = $count_skill_by_course[$course_item['code']];
                         } else {
                             $count_skill_by_course[$course_item['code']] = $skills_in_course[$course_item['code']];
                         }
                     }
                     $item['photo'] = \Display::img($user_info['avatar_small']);
                     $item['currently_learning'] = !empty($count_skill_by_course) ? array_sum($count_skill_by_course) : 0;
                 }
             }
             break;
         case 'get_work_user_list':
             if (isset($type) && $type == 'simple') {
                 $columns = array('type', 'firstname', 'lastname', 'username', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions');
             } else {
                 $columns = array('type', 'firstname', 'lastname', 'username', 'title', 'sent_date', 'actions');
             }
             $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $where_condition);
             break;
         case 'get_exercise_results':
             $course = api_get_course_info();
             //used inside get_exam_results_data()
             $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
             if ($is_allowedToEdit) {
                 $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score', 'status', 'lp', 'actions');
             } else {
                 //$columns = array('exe_duration', 'start_date', 'exe_date', 'score', 'status', 'actions');
             }
             $result = \ExerciseLib::get_exam_results_data($start, $limit, $sidx, $sord, $exercise_id, $where_condition);
             break;
         case 'get_hotpotatoes_exercise_results':
             $course = api_get_course_info();
             //used inside get_exam_results_data()
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:67,代码来源:ModelAjaxController.php


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