aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-03-08 17:27:08 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2011-03-08 17:27:08 -0500
commitbf5818c9ab0bf12db73fe40fd90be18debf059cb (patch)
tree088b3cbb90428263e84857dff126bb6e7f24ac38
parent56dd6967e4400125ac8951607ebac0457c1438c4 (diff)
downloadGradeBook-bf5818c9ab0bf12db73fe40fd90be18debf059cb.tar.gz
GradeBook-bf5818c9ab0bf12db73fe40fd90be18debf059cb.zip
added buttons to hide unhide grades category to the control block
Ignore-this: 2efb1c07f078ebac1b3ba90c64c75318 darcs-hash:20110308222708-067c0-6a4c600bd192969cd77464e8cd321a28137d5308.gz
-rwxr-xr-xGradeBook_lib.tcl29
1 files changed, 29 insertions, 0 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl
index b52792f..7b7fd7f 100755
--- a/GradeBook_lib.tcl
+++ b/GradeBook_lib.tcl
@@ -1248,6 +1248,7 @@ proc AddColumnRequest { permission_list user } {
proc ShowControls { permission_list user } {
array set permission $permission_list
global script_name
+ global grades_category
dbg "outputing contol list"
puts "<div class=\"controls\">"
set action_list [ list \
@@ -1299,6 +1300,34 @@ 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
+ # 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]
+ }
+ # output grades category to hide offering
+ if { [isActionGranted userhidegroup $permission_list $user] } {
+ if { $grades_category_for_hide ne "" } {
+ puts "<br>"
+ puts "Hide grades in category: "
+ foreach ctgry $grades_category_for_hide {
+ puts "<span class=\"controls\"><a href=\"$script_name?action=userhidegradecategory&grades_category=[::ncgi::encode $ctgry]\">$ctgry</a></span>"
+ }
+ }
+ }
+ if { [isActionGranted userunhidegroup $permission_list $user] } {
+ if { $currently_hidden_grades_category ne "" } {
+ puts "<br>"
+ puts {Unhide grades in category: }
+ foreach ctgry $currently_hidden_grades_category {
+ puts "<span class=\"controls\"><a href=\"$script_name?action=userunhidegradecategory&grades_category=[::ncgi::encode $ctgry]\">$ctgry</a></span>"
+ }
+ }
+ }
puts "</div>"
}