diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-20 23:10:36 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-20 23:10:36 -0500 |
commit | 072cc2cef36c92c97d8bf09597ef601bf97ac1ae (patch) | |
tree | 215dc296346b24840224a6704c91a634a0db4590 | |
parent | 9c4d839673d7c4e20164452f036dc292b561a3bf (diff) | |
download | GradeBook-072cc2cef36c92c97d8bf09597ef601bf97ac1ae.tar.gz GradeBook-072cc2cef36c92c97d8bf09597ef601bf97ac1ae.zip |
CREATE TABLE GradesTable proc redone with AddUserNonWeb
Ignore-this: 48affcbbc7b2ea8d9df3686729bd6612
darcs-hash:20110121041036-067c0-4327f39301c90e74875326047f3423616a6aa996.gz
-rwxr-xr-x | GradeBook.tcl | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl index aa6b112..5ae7470 100755 --- a/GradeBook.tcl +++ b/GradeBook.tcl @@ -69,18 +69,20 @@ proc AddUserNonWeb { first_name last_name user_name password_hash {group_name {g } proc CreateGradesTable {db} { - db eval {CREATE TABLE GradesTable(FirstName text, LastName text, UserName text, HW01 real)} + set err [catch {db eval {CREATE TABLE GradesTable(FirstName text, LastName text, UserName text, PassWordHash text, GroupName text)} } errStat] + if { $err } { + htmlErrorMsg $errStat + dbg "the following error happen: $errStat" 1 + } - set eval_str [list INSERT INTO GradesTable VALUES('','', '_Col_Category_', '')] - db eval $eval_str - set eval_str [list INSERT INTO GradesTable VALUES('','', '_Max_Points_', '')] - db eval $eval_str - set eval_str [list INSERT INTO GradesTable VALUES('John','Lname1', 'jhn', 7)] - db eval $eval_str - set eval_str [list INSERT INTO GradesTable VALUES('Ale','Lname2', 'ale', 5)] - db eval $eval_str - set eval_str [list INSERT INTO GradesTable VALUES('Dan','Lname3', 'dan', 3)] - db eval $eval_str + # add special users aka special info rows + AddUserNonWeb {} {} _Col_Category_ {} infocolumn + AddUserNonWeb {} {} _Max_Points_ {} infocolumn + + # dummy users + AddUserNonWeb Dan "Dandanovich" dan [::md5::md5 -hex qwerty] student + AddUserNonWeb Ale "Alevna" ale [::md5::md5 -hex qwerty] student + AddUserNonWeb Jon "Jonovich" jon [::md5::md5 -hex qwerty] student } proc CreateAccessRightsTable {db} { |