diff options
-rwxr-xr-x | GradeBook_lib.tcl | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index 87ff2ab..6f914c8 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -838,6 +838,33 @@ proc number2letter_grade { num } { return "NA" } +proc htmlFormatMaxPossibleRaw { sql_column_str hidden_columns } { + # show max point values in html format + 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" msg_level_critical + dbg $errStat_MP msg_level_critical + htmlErrorMsg $errStat_MP + } + puts "</tr>" +} + proc htmlDBout {db permission_list user {sort_col {}}} { array set permission $permission_list global GradebookServerConfig @@ -990,30 +1017,7 @@ 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" msg_level_critical - dbg $errStat_MP msg_level_critical - htmlErrorMsg $errStat_MP - } - puts "</tr>" + htmlFormatMaxPossibleRaw $sql_column_str $hidden_columns puts "<tr>" } else { puts "<tr>" |