當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。