aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-03-09 17:32:36 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2011-03-09 17:32:36 -0500
commit9952d1ff3e77582d8b58323d872736fad3b78307 (patch)
treeb6dea358c48777e61d4379837f19ccab8dd87e99
parent32413af7d0bc32bd4b8038fe699d2732d82fe458 (diff)
downloadGradeBook-9952d1ff3e77582d8b58323d872736fad3b78307.tar.gz
GradeBook-9952d1ff3e77582d8b58323d872736fad3b78307.zip
added code for student visibility column toggle
Ignore-this: 762febad016243f530d8908b330b5d52 darcs-hash:20110309223236-067c0-bc2fc4dd5d841b809040a242f3056438b31897ee.gz
-rwxr-xr-xGradeBook_lib.tcl24
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]