summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-03-09 00:39:44 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2011-03-09 00:39:44 -0500
commita976043e8738e9c23d69ac29b8569edf16307504 (patch)
tree4d2f68d095abc31027ebc9ee2f5faa79d1bdb705
parent2a62c27f658ee43a93a55258584d66dec42bbda2 (diff)
downloadGradeBook-a976043e8738e9c23d69ac29b8569edf16307504.tar.gz
GradeBook-a976043e8738e9c23d69ac29b8569edf16307504.zip
code for hide/unhide grades category added
Ignore-this: 867a8d5de7b95f4c668cb8b45dad0c8c darcs-hash:20110309053944-067c0-bd4b1ab7a545ee4b456f7f7d2166229a428c75c9.gz
-rwxr-xr-xGradeBook_lib.tcl16
1 files changed, 12 insertions, 4 deletions
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]