Browse Source

[svn r18520] Minor - showing 2 decimal points see FS#3510

Julio Montoya 16 years ago
parent
commit
9dda2cbb82
3 changed files with 11 additions and 14 deletions
  1. 3 3
      main/auth/my_progress.php
  2. 4 7
      main/inc/lib/tracking.lib.php
  3. 4 4
      main/mySpace/myStudents.php

+ 3 - 3
main/auth/my_progress.php

@@ -336,9 +336,9 @@ foreach($Courses as $enreg)
 								$exe_id = $a_score['exe_id'];
 							}					
 							
-							if  ($weighting>0)
-							{							
-								$pourcentageScore = round(($score*100)/$weighting,1);
+							if  ($weighting>0) {
+								// i.e 10.50%							
+								$pourcentageScore = round(($score*100)/$weighting,2);
 							}
 							else
 							{

+ 4 - 7
main/inc/lib/tracking.lib.php

@@ -308,10 +308,7 @@ class Tracking {
 		$table_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
 		
 		$tbl_stats_exercices = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
-		$tbl_stats_attempts= Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
-		
-
-		
+		$tbl_stats_attempts= Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);	
 		
 		$course = CourseManager :: get_course_information($course_code);
 		if(!empty($course['db_name']))
@@ -444,9 +441,9 @@ class Tracking {
 			$totalScore = $lp_scorm_score_total;
 	
 			$pourcentageScore = 0;
-			if($lp_scorm_weighting_total>0)
-			{
-				$pourcentageScore = round(($totalScore * 100) / $lp_scorm_weighting_total);
+			if($lp_scorm_weighting_total>0) {
+				//i.e 10.52
+				$pourcentageScore = round( (($totalScore * 100) / $lp_scorm_weighting_total),2);
 				return $pourcentageScore;
 			}	
 			else

+ 4 - 4
main/mySpace/myStudents.php

@@ -1,4 +1,4 @@
-<?php //$Id: myStudents.php 17987 2009-01-24 01:59:15Z cfasanando $
+<?php //$Id: myStudents.php 18520 2009-02-16 17:14:35Z juliomontoya $
 /* For licensing terms, see /dokeos_license.txt */
 /**
  * Implements the tracking of students in the Reporting pages
@@ -775,9 +775,9 @@ if(!empty($_GET['student']))
 							$exe_id = $a_score['exe_id'];
 						}
 						$pourcentageScore = 0;
-						if($weighting!=0)
-						{
-							$pourcentageScore = round(($score*100)/$weighting,1);
+						if($weighting!=0) {
+							//i.e 10.50 
+							$pourcentageScore = round(($score*100)/$weighting,2);
 						}
 		
 						$weighting = 0;