Can ask questions during live sessions

This commit is contained in:
nemunaire 2022-03-01 15:26:30 +01:00
parent d440d85dc1
commit fe79033d51
5 changed files with 264 additions and 2 deletions

14
db.go
View file

@ -154,6 +154,20 @@ CREATE TABLE IF NOT EXISTS student_corrected(
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
}
if _, err := db.Exec(`
CREATE TABLE IF NOT EXISTS survey_asks(
id_ask INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
id_survey INTEGER NOT NULL,
id_user INTEGER NOT NULL,
date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
content TEXT NOT NULL,
answered BOOLEAN NOT NULL DEFAULT FALSE,
FOREIGN KEY(id_user) REFERENCES users(id_user),
FOREIGN KEY(id_survey) REFERENCES surveys(id_survey)
) DEFAULT CHARACTER SET = utf8 COLLATE = utf8_bin;
`); err != nil {
return err
}