Discovered a bug with lesson grades. While calculating the grade, intval was used to truncate the decimals from the grade. intavl is now replaced with round. round will now round the grade to 5 decimal places. The database only holds int(3). So, this has been changed to float to hold decimal numbers. We have found this to be much more accurate when converting the stored percentage in the database back to a point value (before this fix, users were getting numbers like 46.5 points instead of their original 47 points due to an inaccurate percent value). Files changed for this fix include:

locallib.php
report.php
version.php
view.php
db/mysql.php
db/mysql.sql
db/postgres7.php
db/postgres7.sql
This commit is contained in:
michaelpenne
2005-06-09 21:24:17 +00:00
parent 338cfbb8f1
commit 71ba4dce3c
8 changed files with 16 additions and 10 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ CREATE TABLE prefix_lesson_grades (
id SERIAL8 PRIMARY KEY,
lessonid INT8 NOT NULL default '0',
userid INT8 NOT NULL default '0',
grade INT NOT NULL default '0',
grade real NOT NULL default '0',
late INT NOT NULL default '0',
completed INT8 NOT NULL default '0'
) ;