Пример #1
0
				<th>' . get_lang('Progress') . '</th>
				<th>' . get_lang('Score') . '</th>
				<th>' . get_lang('AttendancesFaults') . '</th>
				<th>' . get_lang('Evaluations') . '</th>
				<th>' . get_lang('Details') . '</th>
			</tr>';
            if (!empty($courses)) {
                foreach ($courses as $courseId) {
                    $courseInfo = api_get_course_info_by_id($courseId);
                    $courseId = $courseInfo['real_id'];
                    $course_code = $courseInfo['code'];
                    if (CourseManager::is_user_subscribed_in_course($student_id, $course_code, true)) {
                        $course_info = CourseManager::get_course_information($course_code);
                        $time_spent_on_course = api_time_to_hms(Tracking::get_time_spent_on_the_course($user_info['user_id'], $courseId, $sessionId));
                        // get average of faults in attendances by student
                        $results_faults_avg = $attendance->get_faults_average_by_course($student_id, $course_code, $sessionId);
                        if (!empty($results_faults_avg['total'])) {
                            if (api_is_drh()) {
                                $attendances_faults_avg = '<a title="' . get_lang('GoAttendance') . '" href="' . api_get_path(WEB_CODE_PATH) . 'attendance/index.php?cidReq=' . $course_code . '&id_session=' . $sessionId . '&student_id=' . $student_id . '">' . $results_faults_avg['faults'] . '/' . $results_faults_avg['total'] . ' (' . $results_faults_avg['porcent'] . '%)</a>';
                            } else {
                                $attendances_faults_avg = $results_faults_avg['faults'] . '/' . $results_faults_avg['total'] . ' (' . $results_faults_avg['porcent'] . '%)';
                            }
                        } else {
                            $attendances_faults_avg = '0/0 (0%)';
                        }
                        // Get evaluations by student
                        $cats = Category::load(null, null, $course_code, null, null, $sessionId);
                        $scoretotal = array();
                        if (isset($cats) && isset($cats[0])) {
                            if (!empty($sessionId)) {
                                $scoretotal = $cats[0]->calc_score($student_id, null, $course_code, $sessionId);