aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"
}