From 888301f7c5ef4a305406bd87a65feefbe8556139 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Wed, 12 Feb 2020 16:02:28 -0500 Subject: do not do stats for Note and Info categories --- GradeBook_lib.tcl | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'GradeBook_lib.tcl') 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] -- cgit v1.2.3