From d213fd0870e80ee1a19dbcab9b70dc0b290d5ad2 Mon Sep 17 00:00:00 2001 From: Eric Marguin Date: Wed, 28 Mar 2007 10:16:33 +0200 Subject: [PATCH] [svn r11738] the chapters are no longer counted to calculate the progress --- main/newscorm/learnpath.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index 637f0f75c1..36e3478c60 100644 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -1720,7 +1720,7 @@ class learnpath { if($this->debug>0){error_log('New LP - In learnpath::get_total_items_count_without_chapters()',0);} $total=0; foreach($this->items as $temp=>$temp2){ - if($temp2->get_type() != 'dokeos_chapter') $total++; + if(!in_array($temp2->get_type(), array('dokeos_chapter','chapter','dir'))) $total++; } return $total; } @@ -2233,7 +2233,8 @@ class learnpath { }else{ //get the number of items completed and the number of items total $tbl = Database::get_course_table('lp_item'); - $sql = "SELECT count(*) FROM $tbl WHERE lp_id = ".$lp_id; + $sql = "SELECT count(*) FROM $tbl WHERE lp_id = ".$lp_id." + AND item_type NOT IN('dokeos_chapter','chapter','dir')"; $res = api_sql_query($sql); $row = Database::fetch_array($res); $total = $row[0];