diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-04-15 20:40:06 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-04-15 20:40:06 -0400 |
commit | 5b2d35448899a128148c2614cb6203d8c5986de0 (patch) | |
tree | 9b266bccf087e3aa04cb48fe5e9b39300e63a610 /GradeBook_lib.tcl | |
parent | f0a034754528c975e6170307337e13c25e3c9b6c (diff) | |
download | GradeBook-5b2d35448899a128148c2614cb6203d8c5986de0.tar.gz GradeBook-5b2d35448899a128148c2614cb6203d8c5986de0.zip |
need total calculation now taken from the Category table
Ignore-this: 85a89f35b58eb7195a5fa0e6cd814a1f
darcs-hash:20110416004006-067c0-a469eb9fd0dc2a3d7f9e925b7542f31a5d1e78d5.gz
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-x | GradeBook_lib.tcl | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index 267af15..a8a959a 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -61,20 +61,16 @@ proc getGradingWeights { } { } proc isCalculateTotalForCategorySet { category } { - if {![db exists {SELECT 1 FROM GradesCategoryTable WHERE CategoryName=$category}]} { + if {![existsColumnWithRowvalueInTable GradesCategoryTable CategoryName $category ]} { dbg "Category: $category does not exists in the GradesCategoryTable, setting CalculateTotal to false" 3 return false } - switch $category { - "unset" {set flag false} - Quiz {set flag true} - HomeWork {set flag true} - LabReport {set flag true} - MidTerm {set flag false} - FinalExam {set flag false} - default {set flag false} - } - return $flag + set flag [SelectColvalueFromTable GradesCategoryTable NeedsTotal CategoryName $category] + if { $flag } { + return true + } else { + return false + } } proc allUserNamesInGroup { group } { |