From a976043e8738e9c23d69ac29b8569edf16307504 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Wed, 9 Mar 2011 00:39:44 -0500 Subject: code for hide/unhide grades category added Ignore-this: 867a8d5de7b95f4c668cb8b45dad0c8c darcs-hash:20110309053944-067c0-bd4b1ab7a545ee4b456f7f7d2166229a428c75c9.gz --- GradeBook_lib.tcl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'GradeBook_lib.tcl') diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index c2c8cb0..f23a82a 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -943,8 +943,17 @@ proc UpdateCourseInfo { db permission_list user } { } proc UserHideGradeCategory { permission_list user } { + set ctg_name [::ncgi::value grades_category {}] + set currently_UserHiddenGradeCategories [SelectColValue4User UserHiddenGradeCategories $user] + lappend currently_UserHiddenGradeCategories $ctg_name + UpdateColValue4UserNameNonWeb UserHiddenGradeCategories $user $currently_UserHiddenGradeCategories } + proc UserUnHideGradeCategory { permission_list user } { + set ctg_name [::ncgi::value grades_category {}] + set currently_UserHiddenGradeCategories [SelectColValue4User UserHiddenGradeCategories $user] + set currently_UserHiddenGradeCategories [removeElementFromList $ctg_name $currently_UserHiddenGradeCategories] + UpdateColValue4UserNameNonWeb UserHiddenGradeCategories $user $currently_UserHiddenGradeCategories } proc UserUnHideGroup { permission_list user } { @@ -1227,10 +1236,10 @@ proc DeleteColumn { permission_list user } { DeleteColumnNonWeb $columnname } -proc AddColumnNonWeb { columnname2add column_category maxpointpossible } { +proc AddColumnNonWeb { columnname2add column_category maxpointpossible {sql_type {text}} } { if { $columnname2add != "" } { - set eval_str [concat ALTER TABLE GradesTable ADD \"$columnname2add\" text] + set eval_str [concat ALTER TABLE GradesTable ADD \"$columnname2add\" $sql_type] set err [catch {db eval $eval_str } errStat] if { $err } { htmlErrorMsg $errStat @@ -1333,8 +1342,7 @@ proc ShowControls { permission_list user } { # hide user grades category set grades_category_for_hide $grades_category - #set currently_hidden_grades_category [SelectColValue4User UserHiddenGradeCategories $user] - set currently_hidden_grades_category Quiz; #debug + set currently_hidden_grades_category [SelectColValue4User UserHiddenGradeCategories $user] # remove already hidden category from offering foreach grd_category $currently_hidden_grades_category { set grades_category_for_hide [removeElementFromList $grd_category $grades_category_for_hide] -- cgit v1.2.3