37
37
worksheetid SERIAL PRIMARY KEY,
38
38
offeringid INT4 REFERENCES offering (offeringid) NOT NULL,
39
39
identifier VARCHAR NOT NULL,
42
assessable BOOLEAN NOT NULL,
42
45
UNIQUE (offeringid, identifier)
45
48
CREATE TABLE worksheet_problem (
46
worksheetid INT4 REFERENCES worksheet (worksheetid) NOT NULL,
47
problemid TEXT REFERENCES problem (identifier) NOT NULL,
49
PRIMARY KEY (worksheetid, problemid)
49
ws_prob_id SERIAL PRIMARY KEY,
50
worksheetid INT4 REFERENCES worksheet (worksheetid) NOT NULL,
51
problemid TEXT REFERENCES problem (identifier) NOT NULL,
52
57
CREATE TABLE problem_attempt (
53
problemid TEXT REFERENCES problem (identifier) NOT NULL,
54
58
loginid INT4 REFERENCES login (loginid) NOT NULL,
55
worksheetid INT4 REFERENCES worksheet (worksheetid) NOT NULL,
59
ws_prob_id INT4 REFERENCES worksheet_problem (ws_prob_id) NOT NULL,
56
60
date TIMESTAMP NOT NULL,
57
61
attempt VARCHAR NOT NULL,
58
62
complete BOOLEAN NOT NULL,
59
63
active BOOLEAN NOT NULL DEFAULT true,
60
PRIMARY KEY (problemid,loginid,worksheetid,date)
64
PRIMARY KEY (loginid,ws_prob_id,date)
63
67
CREATE TABLE problem_save (
64
problemid TEXT REFERENCES problem (identifier) NOT NULL,
65
68
loginid INT4 REFERENCES login (loginid) NOT NULL,
66
worksheetid INT4 REFERENCES worksheet (worksheetid) NOT NULL,
69
ws_prob_id INT4 REFERENCES worksheet_problem (ws_prob_id) NOT NULL,
67
70
date TIMESTAMP NOT NULL,
68
71
text TEXT NOT NULL,
69
PRIMARY KEY (problemid,loginid, worksheetid)
72
PRIMARY KEY (loginid, ws_prob_id)
72
75
CREATE TABLE test_suite (