diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2014-03-27 13:58:35 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2014-03-27 13:58:35 -0400 |
commit | 48427bb515d5ea718aa6e98da44eb51a8bef6717 (patch) | |
tree | d443db2d28f67adc626aa61eb447bf766be01558 /GradeBook_lib.tcl | |
parent | 59a3a93b62ac407eb7a9ecc1c77f5928ef7b6553 (diff) | |
download | GradeBook-48427bb515d5ea718aa6e98da44eb51a8bef6717.tar.gz GradeBook-48427bb515d5ea718aa6e98da44eb51a8bef6717.zip |
max point html table raw moved into separate proc
Diffstat (limited to 'GradeBook_lib.tcl')
-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>" |