diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-21 00:18:02 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-21 00:18:02 -0500 |
commit | 5aba490b683b5aec1da9c69948a68c07e071995c (patch) | |
tree | bb35a6cba3691906db03ba2584e275737f922c8b /GradeBook.tcl | |
parent | 08cd10af8dfd75c3b4c80e106c40497d80064999 (diff) | |
download | GradeBook-5aba490b683b5aec1da9c69948a68c07e071995c.tar.gz GradeBook-5aba490b683b5aec1da9c69948a68c07e071995c.zip |
stdents see grades through the same proc as ta and instructor
Ignore-this: 185d6a4e20e8f14c2ccfc7aad1fe12bd
darcs-hash:20110121051802-067c0-bb0bd62f95f6e216fd4bf5d3bde460a41c3d9b6a.gz
Diffstat (limited to 'GradeBook.tcl')
-rwxr-xr-x | GradeBook.tcl | 52 |
1 files changed, 1 insertions, 51 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl index 34c04fb..68bf1a7 100755 --- a/GradeBook.tcl +++ b/GradeBook.tcl @@ -720,63 +720,13 @@ proc AccessGroupRights {db user password } { return $permission_list } -proc htmlStudentGrades { db user } { - set defSortCol LastName - global script_name - set sort_col $defSortCol - - - puts {<div class="gradestable">} - set show_header 1 - - set do_not_show_columns [list FirstName LastName UserName PasswordHash GroupName] - set cols_to_show [getColListFromTable GradesTable] - foreach col $do_not_show_columns { - set cols_to_show [removeElementFromList $col $cols_to_show] - } - set sql_column_str [colList2sqlColStr $cols_to_show] - - # show the table with grades - set eval_str [concat SELECT $sql_column_str FROM GradesTable WHERE UserName='$user' ORDER BY $sort_col] - set err [catch { - db eval $eval_str v { - if { $show_header } { - set show_header 0 - puts {<table class="gradestable" border="1">} - puts "<tr>" - foreach col $v(*) { - puts -nonewline "<th>$col</th>" - } - puts "</tr>" - puts "<tr>" - } else { - puts "<tr>" - } - foreach index $v(*) { - if { $index != "*" } { - set col_value [htmlReplaceEmptyString $v($index)] - puts -nonewline "<td>$col_value</td>" - } - } - puts "</tr>" - } - } errStat ] - if { $err } { - dbg "we should never be here if $sortCol and $user exist in the table" 1 - dbg $errStat 1 - - } - puts "</table>" - puts {</div>} -} - proc htmlGradesTable {db permission_list user} { array set permission $permission_list global sortCol switch $permission(GroupName) { guest { } - student { htmlStudentGrades db $user} + student { htmlDBout db $permission_list $user $sortCol} ta { htmlDBout db $permission_list $user $sortCol} instructor { htmlDBout db $permission_list $user $sortCol} default { } |