From 5b2d35448899a128148c2614cb6203d8c5986de0 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Fri, 15 Apr 2011 20:40:06 -0400 Subject: need total calculation now taken from the Category table Ignore-this: 85a89f35b58eb7195a5fa0e6cd814a1f darcs-hash:20110416004006-067c0-a469eb9fd0dc2a3d7f9e925b7542f31a5d1e78d5.gz --- GradeBook_lib.tcl | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'GradeBook_lib.tcl') 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 } { -- cgit v1.2.3