From e7401c4dc00d3d0c738ae47a4efc84254e82677e Mon Sep 17 00:00:00 2001 From: Eric Marguin Date: Wed, 2 May 2007 23:55:23 +0200 Subject: [PATCH] [svn r12245] fix a bug in global datas of the user --- main/mySpace/myStudents.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/main/mySpace/myStudents.php b/main/mySpace/myStudents.php index c69736b790..9a2cb8bd69 100644 --- a/main/mySpace/myStudents.php +++ b/main/mySpace/myStudents.php @@ -188,14 +188,16 @@ if(!empty($_GET['student'])) $a_infosUser = UserManager::get_user_info_by_id($_GET['student']); $a_infosUser['name'] = $a_infosUser['firstname'].' '.$a_infosUser['lastname']; - // courses followed by user where we are coach - if(!isset($_GET['id_coach'])){ - $a_courses = Tracking :: get_courses_followed_by_coach($_user['user_id']); - } - else{ - $a_courses = Tracking :: get_courses_followed_by_coach($_GET['id_coach']); - } + $avg_student_progress = $avg_student_score = $nb_courses = 0; + $sql = 'SELECT course_code FROM '.$tbl_course_user.' WHERE user_id='.$a_infosUser['user_id']; + $rs = api_sql_query($sql, __FILE__, __LINE__); + $a_courses = array(); + while($row = Database :: fetch_array($rs)) + { + $a_courses[] = $row['course_code']; + } + foreach ($a_courses as $key=>$course_code) { if(!CourseManager::is_user_subscribed_in_course($a_infosUser['user_id'], $course_code, true)) @@ -768,6 +770,13 @@ if(!empty($_GET['student'])) 0) { $csv_content[] = array();