From 947d23a824cfe0cbc267717593457f652f05d94c Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Tue, 3 May 2011 00:07:48 -0400 Subject: students seem max possible points Ignore-this: fb8d27bfe11f5ffa0d8167154e7d8c41 darcs-hash:20110503040748-067c0-ee25664d90c965d7856ce59860cd22e6f1dd1490.gz --- GradeBook_lib.tcl | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index efdc181..516ca5b 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -671,8 +671,8 @@ proc htmlDBout {db permission_list user {sort_col {}}} { switch $permission(GroupName) { instructor { set hidden_columns {} } ta { set hidden_columns [list UserName PasswordHash GroupName UserHiddenColums UserHiddenGroups UserHiddenGradeCategories IdNum] } - student { set hidden_columns [list FirstName LastName UserName PasswordHash GroupName UserHiddenColums UserHiddenGroups UserHiddenGradeCategories IdNum SectionNum] } - dropped { set hidden_columns [list FirstName LastName UserName PasswordHash GroupName UserHiddenColums UserHiddenGroups UserHiddenGradeCategories IdNum SectionNum] } + student { set hidden_columns [list UserName PasswordHash GroupName UserHiddenColums UserHiddenGroups UserHiddenGradeCategories IdNum SectionNum] } + dropped { set hidden_columns [list UserName PasswordHash GroupName UserHiddenColums UserHiddenGroups UserHiddenGradeCategories IdNum SectionNum] } guest { set hidden_columns $column_list } default { set hidden_columns $column_list } } @@ -689,7 +689,11 @@ proc htmlDBout {db permission_list user {sort_col {}}} { 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] + switch $col { + FirstName {; #nothing bad to see first name} + LastName {; #nothing bad to see last name} + default { set column_list [removeElementFromList $col $column_list]} + } } } @@ -798,6 +802,30 @@ proc htmlDBout {db permission_list user {sort_col {}}} { puts "" } puts "" + # show max point values + puts "" + set eval_str_MP [concat SELECT $sql_column_str FROM GradesTable WHERE UserName=\"_Max_Points_\"] + set errMaxPoints [catch { + db eval $eval_str_MP v_MP { + foreach c $v_MP(*) { + if { $c in $hidden_columns } continue + switch $c { + "FirstName" {set MaxPointsStr "Max"} + "LastName" {set MaxPointsStr "Possible"} + "GroupName" {set MaxPointsStr ""} + "UserName" {set MaxPointsStr "_Derived_"} + default {set MaxPointsStr $v_MP($c)} + } + puts " $MaxPointsStr " + } + } + } errStat_MP ] + if { $errMaxPoints } { + dbg "we should never be here if UserName: _Max_Points_ exist in the table" 1 + dbg $errStat_MP 1 + htmlErrorMsg $errStat_MP + } + puts "" puts "" } else { puts "" -- cgit v1.2.3