aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-01-22 23:21:54 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2011-01-22 23:21:54 -0500
commitdad7641d99549373e8fe13b51943ff150255f78e (patch)
tree4bca78434c801390ed006de85ba5d6da46d6a408
parent9051d3a5f3dcb4a9cd995e772ed4e5377088e3f2 (diff)
downloadGradeBook-dad7641d99549373e8fe13b51943ff150255f78e.tar.gz
GradeBook-dad7641d99549373e8fe13b51943ff150255f78e.zip
added IsNum and SectionNum columns
Ignore-this: 52d973effeadf22891c0a7e3433764e3 darcs-hash:20110123042154-067c0-35e2d99447ee125946b9b65b0007418ac154e77c.gz
-rwxr-xr-xGradeBook.tcl9
1 files changed, 5 insertions, 4 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl
index d212f34..fb3bcd5 100755
--- a/GradeBook.tcl
+++ b/GradeBook.tcl
@@ -52,8 +52,8 @@ proc ColName2SqlSafeForm {colname} {
return $colname
}
-proc AddUserNonWeb { first_name last_name user_name password_hash {group_name {guest}} } {
- set eval_str [concat INSERT INTO GradesTable (FirstName, LastName, UserName, PasswordHash, GroupName) VALUES('$first_name', '$last_name', '$user_name', '$password_hash', '$group_name')]
+proc AddUserNonWeb { first_name last_name user_name password_hash {group_name {guest}} {id_number {}} {section_num {} } } {
+ set eval_str [concat INSERT INTO GradesTable (FirstName, LastName, UserName, PasswordHash, GroupName, IdNum, SectionNum) VALUES('$first_name', '$last_name', '$user_name', '$password_hash', '$group_name', '$id_number', '$section_num')]
set err [catch {db eval $eval_str } errStat]
if { $err } {
htmlErrorMsg $errStat
@@ -62,7 +62,7 @@ proc AddUserNonWeb { first_name last_name user_name password_hash {group_name {g
}
proc CreateGradesTable {db} {
- set err [catch {db eval {CREATE TABLE GradesTable(FirstName text, LastName text, UserName text, PasswordHash text, GroupName text, UserHiddenColums text, UserHiddenGroups text, IdNum text)} } errStat]
+ set err [catch {db eval {CREATE TABLE GradesTable(FirstName text, LastName text, UserName text, PasswordHash text, GroupName text, UserHiddenColums text, UserHiddenGroups text, IdNum text, SectionNum text)} } errStat]
if { $err } {
htmlErrorMsg $errStat
dbg "the following error happen: $errStat" 1
@@ -159,7 +159,7 @@ proc htmlDBout {db permission_list user {sort_col {}}} {
switch $permission(GroupName) {
instructor { set hidden_columns {} }
ta { set hidden_columns [list UserName PasswordHash GroupName UserHiddenColums UserHiddenGroups IdNum] }
- student { set hidden_columns [list FirstName LastName UserName PasswordHash GroupName UserHiddenColums UserHiddenGroups IdNum] }
+ student { set hidden_columns [list FirstName LastName UserName PasswordHash GroupName UserHiddenColums UserHiddenGroups IdNum SectionNum] }
guest { set hidden_columns $column_list }
default { set hidden_columns $column_list }
}
@@ -214,6 +214,7 @@ proc htmlDBout {db permission_list user {sort_col {}}} {
UserHiddenGroups { }
IdNum { }
GroupName { }
+ SectionNum { }
default {
lappend action_list changegrades "change grades" deletecolumn delete changecolumn "change column"
}