From dad7641d99549373e8fe13b51943ff150255f78e Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Sat, 22 Jan 2011 23:21:54 -0500 Subject: added IsNum and SectionNum columns Ignore-this: 52d973effeadf22891c0a7e3433764e3 darcs-hash:20110123042154-067c0-35e2d99447ee125946b9b65b0007418ac154e77c.gz --- GradeBook.tcl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'GradeBook.tcl') 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" } -- cgit v1.2.3