diff options
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 } { |