summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-04-15 20:40:06 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2011-04-15 20:40:06 -0400
commit5b2d35448899a128148c2614cb6203d8c5986de0 (patch)
tree9b266bccf087e3aa04cb48fe5e9b39300e63a610
parentf0a034754528c975e6170307337e13c25e3c9b6c (diff)
downloadGradeBook-5b2d35448899a128148c2614cb6203d8c5986de0.tar.gz
GradeBook-5b2d35448899a128148c2614cb6203d8c5986de0.zip
need total calculation now taken from the Category table
Ignore-this: 85a89f35b58eb7195a5fa0e6cd814a1f darcs-hash:20110416004006-067c0-a469eb9fd0dc2a3d7f9e925b7542f31a5d1e78d5.gz
-rwxr-xr-xGradeBook_lib.tcl18
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 } {