diff options
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-x | GradeBook_lib.tcl | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index f2508c7..4f902e5 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -977,50 +977,50 @@ proc htmlFormatMaxPossibleRaw { sql_column_str hidden_columns } { proc htmlFormatTheHighestGradeRaw { sql_column_str hidden_columns } { # show max point values in html format - puts "<tr>" array set v [getColAndValForUserName _The_Highest_Grade_ $sql_column_str $hidden_columns] - foreach c $v(*) { - if { $c in $hidden_columns } continue - switch $c { - "FirstName" {set out_str "Class"} - "LastName" {set out_str "High"} - "GroupName" {set out_str ""} - "UserName" {set out_str "_Derived_"} + set html_str "<tr>\n" + foreach columnname $v(*) { + if { $columnname in $hidden_columns } continue + switch $columnname { + "FirstName" {set col_value "Class"} + "LastName" {set col_value "High"} + "UserName" {set col_value "_Derived_"} default { - if { ![info exists v($c)] } { - set out_str "N/A" + if { ![info exists v($columnname)] } { + set col_value "N/A" } else { - set out_str $v($c) + set col_value $v($columnname) } } } - puts "<td> <b>$out_str</b> </td>" + set html_str [join [list $html_str "\n" [htmlFormatColVal $col_value $columnname _The_Highest_Grade_ _The_Highest_Grade_ {} {b}] ] {}] } - puts "</tr>" + set html_str [join [list $html_str "\n" "</tr>"]] + return $html_str } proc htmlFormatTheLowestGradeRaw { sql_column_str hidden_columns } { # show max point values in html format - puts "<tr>" array set v [getColAndValForUserName _The_Lowest_Grade_ $sql_column_str $hidden_columns] - foreach c $v(*) { - if { $c in $hidden_columns } continue - switch $c { - "FirstName" {set out_str "Class"} - "LastName" {set out_str "Low"} - "GroupName" {set out_str ""} - "UserName" {set out_str "_Derived_"} + set html_str "<tr>\n" + foreach columnname $v(*) { + if { $columnname in $hidden_columns } continue + switch $columnname { + "FirstName" {set col_value "Class"} + "LastName" {set col_value "Low"} + "UserName" {set col_value "_Derived_"} default { - if { ![info exists v($c)] } { - set out_str "N/A" + if { ![info exists v($columnname)] } { + set col_value "N/A" } else { - set out_str $v($c) + set col_value $v($columnname) } } } - puts "<td> <b>$out_str</b> </td>" + set html_str [join [list $html_str "\n" [htmlFormatColVal $col_value $columnname _The_Lowest_Grade_ _The_Lowest_Grade_ {} {b}] ] {}] } - puts "</tr>" + set html_str [join [list $html_str "\n" "</tr>"]] + return $html_str } proc htmlFormatColVal { col_value columnname user user_shown permission_list {font_style {}} } { @@ -1166,8 +1166,8 @@ proc htmlDBout {db permission_list user {sort_col {}}} { set v_array_list [array get v] htmlGradesTableHeadersRaw $permission_list $user $sql_column_str $hidden_columns $v_array_list htmlFormatMaxPossibleRaw $sql_column_str $hidden_columns - htmlFormatTheHighestGradeRaw $sql_column_str $hidden_columns - htmlFormatTheLowestGradeRaw $sql_column_str $hidden_columns + puts [htmlFormatTheHighestGradeRaw $sql_column_str $hidden_columns] + puts [htmlFormatTheLowestGradeRaw $sql_column_str $hidden_columns] } puts "<tr>" |