summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 } {