diff options
-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} { |