summaryrefslogtreecommitdiff
path: root/GradeBook_lib.tcl
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-03-07 00:32:36 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2011-03-07 00:32:36 -0500
commit166c5dc357f84bac876991fe4f49255a739564c1 (patch)
tree116878f48e86d85d79383f2f9d8da3e7428e684c /GradeBook_lib.tcl
parent2c95d16b772d23786ce4e2da6c4012b8f81241d2 (diff)
downloadGradeBook-166c5dc357f84bac876991fe4f49255a739564c1.tar.gz
GradeBook-166c5dc357f84bac876991fe4f49255a739564c1.zip
check for non numerical value during weighted column calculations
Ignore-this: 609c002210ddf2feb78e71b7712e258d darcs-hash:20110307053236-067c0-c1451a854526c911c7ffee5f2186cf5b74e171b9.gz
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-xGradeBook_lib.tcl4
1 files changed, 4 insertions, 0 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl
index 8ffc5bf..5605d72 100755
--- a/GradeBook_lib.tcl
+++ b/GradeBook_lib.tcl
@@ -119,6 +119,10 @@ proc calculteWeightedTotals { } {
if { $col_val eq "" } {
set col_val 0
}
+ if { ![string is double -strict $col_val] } {
+ htmlInfoMsg "the cell in column $col contains $col_val which is not number, using 0 instead"
+ set col_val 0
+ }
set points_sum [expr { $points_sum + $col_val}]
}
if { $max_points($category) != 0 } {