From 1c4662ca0ff732b8f658042c7cfa3e7b72cb2d32 Mon Sep 17 00:00:00 2001 From: Eric Marguin Date: Mon, 4 Jun 2007 10:28:12 +0200 Subject: [PATCH] [svn r12529] the global progress wasn't calculated with the courses accessed by sessions --- main/mySpace/myStudents.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main/mySpace/myStudents.php b/main/mySpace/myStudents.php index 2e6b7bec25..51b3362eb7 100644 --- a/main/mySpace/myStudents.php +++ b/main/mySpace/myStudents.php @@ -195,9 +195,18 @@ if(!empty($_GET['student'])) $a_courses = array(); while($row = Database :: fetch_array($rs)) { - $a_courses[] = $row['course_code']; + $a_courses[$row['course_code']] = $row['course_code']; } + // get the list of sessions where the user is subscribed as student + $sql = 'SELECT DISTINCT course_code FROM '.Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER).' WHERE id_user='.intval($a_infosUser['user_id']); + $rs = api_sql_query($sql, __FILE__, __LINE__); + while($row = Database :: fetch_array($rs)) + { + $a_courses[$row['course_code']] = $row['course_code']; + } + + foreach ($a_courses as $key=>$course_code) { if(!CourseManager::is_user_subscribed_in_course($a_infosUser['user_id'], $course_code, true))