summaryrefslogtreecommitdiff
path: root/GradeBook_lib.tcl
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-03-06 00:15:28 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2011-03-06 00:15:28 -0500
commit254713e76e2c9eb6291cbed607d11c6b49863438 (patch)
tree277919f400a40ab2719f9f20522325c953d71b10 /GradeBook_lib.tcl
parentc42c03f3c1dcf81c5786635af13ce30217981b20 (diff)
downloadGradeBook-1.1.3.tar.gz
GradeBook-1.1.3.zip
added proper sorting for grades columnv1.1.3
Ignore-this: b270899f5c22bf6494e122c691eaf070 darcs-hash:20110306051528-067c0-1b217bdbc542fe63d1f99d3224b40aedf523a698.gz
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-xGradeBook_lib.tcl11
1 files changed, 10 insertions, 1 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl
index e5d0d96..d04d00e 100755
--- a/GradeBook_lib.tcl
+++ b/GradeBook_lib.tcl
@@ -228,8 +228,17 @@ proc htmlDBout {db permission_list user {sort_col {}}} {
default { dbg "Default must not be allowed to set table view port. Aborting. This line is never executed." 0; exit }
}
if { $sql_column_str ne "" } {
+ switch [SelectColValue4User $sort_col _Col_Category_] {
+ Quiz { set ordered_by_str [concat CAST(\"$sort_col\" AS REAL)] }
+ LabReport { set ordered_by_str [concat CAST(\"$sort_col\" AS REAL)] }
+ HomeWork { set ordered_by_str [concat CAST(\"$sort_col\" AS REAL)] }
+ MidTerm { set ordered_by_str [concat CAST(\"$sort_col\" AS REAL)] }
+ FinalExam { set ordered_by_str [concat CAST(\"$sort_col\" AS REAL)] }
+ FinalExam { set ordered_by_str [concat CAST(\"$sort_col\" AS REAL)] }
+ default { set ordered_by_str \"$sort_col\" }
+ }
# get all allowed columns and rows
- set eval_str [concat SELECT $sql_column_str FROM GradesTable $where_statement ORDER BY \"$sort_col\"]
+ set eval_str [concat SELECT $sql_column_str FROM GradesTable $where_statement ORDER BY $ordered_by_str]
set err [catch {
db eval $eval_str v {
if { $show_header } {