diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2020-02-12 16:02:28 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2020-02-12 16:02:28 -0500 |
commit | 888301f7c5ef4a305406bd87a65feefbe8556139 (patch) | |
tree | e32bfc68c4b0e2dc9b7438071b1ebd74528ce0c6 /GradeBook_lib.tcl | |
parent | a3c223ba7921e5c8da338573e81b055fb8aa7cda (diff) | |
download | GradeBook-888301f7c5ef4a305406bd87a65feefbe8556139.tar.gz GradeBook-888301f7c5ef4a305406bd87a65feefbe8556139.zip |
do not do stats for Note and Info categories
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-x | GradeBook_lib.tcl | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index 270c7a1..9ff8e28 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -419,7 +419,15 @@ proc calculteSumOfPointsForStudentInCategory { student category } { set col_val 0 } } - if { !$isItExcuse } { + # some special category are just notes + # no need to do stats on them + set doNotNeedStats false + switch $category { + Note {set doNotNeedStats true; set col_val 0} + Info {set doNotNeedStats true; set col_val 0} + default { } + } + if { !($isItExcuse || $doNotNeedStats) } { lappend list_col_val $col_val lappend list_col_max $col_max_possible } @@ -506,6 +514,15 @@ proc calculteWeightedTotals { } { foreach student $students_list { set grand_total($student) 0 foreach {category weight} [getGradingWeights] { + # some special category are just notes + # no need to do stats on them + set doNotNeedStats false + switch $category { + Note {set doNotNeedStats true} + Info {set doNotNeedStats true} + default { } + } + if { $doNotNeedStats } { continue } if { ![info exist max_points($category)] } { set tmpList [ calculteMaxPointsInCategory $category ] set max_points($category) [lindex $tmpList 0] |