diff options
-rwxr-xr-x | GradeBook_lib.tcl | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index 7ba525e..d1d9942 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -395,6 +395,9 @@ proc htmlDBout {db permission_list user {sort_col {}}} { if { [SelectColValue4User $col _Col_Category_] in $UserHiddenGradeCategories } { set column_list [removeElementFromList $col $column_list] } + if { ( ($permission(GroupName) eq "student") || ($permission(GroupName) eq "dropped") ) && ( [SelectColValue4User $col _Visible_To_Students_] ne "true") } { + set column_list [removeElementFromList $col $column_list] + } } # add UserName column since a lot depends on it knowledge @@ -462,7 +465,12 @@ proc htmlDBout {db permission_list user {sort_col {}}} { if { $category eq "weighted_column" } { # modify actions for weighted_column } else { - lappend action_list changegrades "change grades" deletecolumn delete changecolumn "change column" + lappend action_list changegrades "change grades" deletecolumn delete changecolumn "change column" + } + if { [SelectColValue4User $col _Visible_To_Students_] eq "true" } { + lappend action_list hidecolfromstudents "hide from students" + } else { + lappend action_list unhidecolfromstudents "show to students" } } } @@ -736,6 +744,10 @@ proc ChoseAction {action permission_list user} { htmlDefaultView $permission_list $user } showcontrols { ShowControls $permission_list $user } + hidecolfromstudents { HideColumnFromStudents $permission_list $user + htmlDefaultView $permission_list $user } + unhidecolfromstudents { UnHideColumnFromStudents $permission_list $user + htmlDefaultView $permission_list $user } userhidecolumn { UserHideColumn $permission_list $user htmlDefaultView $permission_list $user } userunhidecolumn { UserUnHideColumn $permission_list $user @@ -974,6 +986,16 @@ proc UserHideGroup { permission_list user } { UpdateColValue4UserNameNonWeb UserHiddenGroups $user $currently_hidden_groups } +proc HideColumnFromStudents { permission_list user } { + set columnname [::ncgi::value columnname {}] + UpdateColValue4UserNameNonWeb $columnname _Visible_To_Students_ false +} + +proc UnHideColumnFromStudents { permission_list user } { + set columnname [::ncgi::value columnname {}] + UpdateColValue4UserNameNonWeb $columnname _Visible_To_Students_ true +} + proc UserHideColumn { permission_list user } { set columnname [::ncgi::value columnname {}] set currently_hidden_columns [SelectColValue4User UserHiddenColums $user] |