diff options
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>" |