aboutsummaryrefslogtreecommitdiff
path: root/CreateCourseGradeBook.tcl
blob: b521189eafb6ce13948d4b25eadb188657e87aa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
# (C) 2011 by Eugeniy Mikhailov, <evgmik@gmail.com>
# vim:set ft=tcl: \
exec tclsh "$0" "$@"

package require sqlite3
package require md5
source ./GradeBook_lib.tcl

if { $argc < 3 } {	
	puts {Usage:}
	puts "$argv0 database_name instructor_login instructor_password \[instructor_fname\] \[instructor_lname\]"
	exit
}

set dbfile [lindex $argv 0] 
set instructor_login [lindex $argv 1] 
set instructor_password [lindex $argv 2] 

if { $argc >= 4 } {
	set instructor_fname  [lindex $argv 3] 
} else {
	set instructor_fname {}
}

if { $argc >= 5 } {
	set instructor_lname  [lindex $argv 4] 
} else {
	set instructor_lname {}
}

sqlite3 db $dbfile


CreateGradesTable db
CreateAccessRightsTable db

#AddUserNonWeb  first_name last_name user_name password_hash group_name id_number section_num i
AddUserNonWeb  $instructor_fname  $instructor_lname $instructor_login [::md5::md5 -hex $instructor_password] instructor 

# reasonable defaults for hidden columns
set instructor_hidden_columns [list UserHiddenColums PasswordHash UserHiddenGroups IdNum]
UpdateColValue4GroupNameNonWeb UserHiddenColums instructor $instructor_hidden_columns

# vim: ts=2 sw=2 foldmethod=indent: