diff options
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-x | GradeBook_lib.tcl | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index c9c4ccb..dcecce4 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -1516,11 +1516,24 @@ proc UpdateColumn { permission_list user } { set oldcolumnname [ColName2SqlSafeForm $oldcolumnname] set newcolumnname [ColName2SqlSafeForm $newcolumnname] + set needToRecalculateWeightedTotals false + # first we update category and maxpointpossible values of the old columnname - UpdateColValue4UserNameNonWeb $oldcolumnname _Col_Category_ $column_category - UpdateColValue4UserNameNonWeb $oldcolumnname _Max_Points_ $maxpointpossible + set old_column_category [SelectColValue4User $oldcolumnname _Col_Category_] + if { $old_column_category ne $column_category } { + UpdateColValue4UserNameNonWeb $oldcolumnname _Col_Category_ $column_category + set needToRecalculateWeightedTotals true + } - calculteWeightedTotals + set old_maxpointpossible [SelectColValue4User $oldcolumnname _Max_Points_] + if { $old_maxpointpossible ne $maxpointpossible } { + UpdateColValue4UserNameNonWeb $oldcolumnname _Max_Points_ $maxpointpossible + set needToRecalculateWeightedTotals true + } + + if { $needToRecalculateWeightedTotals } { + calculteWeightedTotals + } if { $newcolumnname eq $oldcolumnname } { # no need to mess with renaming |