Add correction steps
This commit is contained in:
parent
1d8c4a375c
commit
7201c3d02a
5 changed files with 577 additions and 29 deletions
11
db.go
11
db.go
|
@ -137,6 +137,17 @@ CREATE TABLE IF NOT EXISTS correction_templates(
|
|||
score_explanation TEXT,
|
||||
FOREIGN KEY(id_question) REFERENCES survey_quests(id_question)
|
||||
) DEFAULT CHARACTER SET = utf8 COLLATE = utf8_bin;
|
||||
`); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := db.Exec(`
|
||||
CREATE TABLE IF NOT EXISTS student_corrected(
|
||||
id_correction INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
id_user INTEGER NOT NULL,
|
||||
id_template INTEGER NOT NULL,
|
||||
FOREIGN KEY(id_user) REFERENCES users(id_user),
|
||||
FOREIGN KEY(id_template) REFERENCES correction_templates(id_template)
|
||||
) DEFAULT CHARACTER SET = utf8 COLLATE = utf8_bin;
|
||||
`); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Reference in a new issue