diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-05-03 00:07:48 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-05-03 00:07:48 -0400 |
commit | 947d23a824cfe0cbc267717593457f652f05d94c (patch) | |
tree | dea7dad78688e6e1ef13473bd819927a4f50db50 /GradeBook_lib.tcl | |
parent | c1e62f4ba2a71f148badf1fa0fb1975be042aa30 (diff) | |
download | GradeBook-947d23a824cfe0cbc267717593457f652f05d94c.tar.gz GradeBook-947d23a824cfe0cbc267717593457f652f05d94c.zip |
students seem max possible points
Ignore-this: fb8d27bfe11f5ffa0d8167154e7d8c41
darcs-hash:20110503040748-067c0-ee25664d90c965d7856ce59860cd22e6f1dd1490.gz
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-x | GradeBook_lib.tcl | 34 |
1 files 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 "</tr>" + # show max point values + puts "<tr>" + 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 "<td> <b>$MaxPointsStr</b> </td>" + } + } + } 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 "</tr>" puts "<tr>" } else { puts "<tr>" |