aboutsummaryrefslogtreecommitdiff
path: root/db.js
diff options
context:
space:
mode:
Diffstat (limited to 'db.js')
-rw-r--r--db.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/db.js b/db.js
index 16f2970..49caabd 100644
--- a/db.js
+++ b/db.js
@@ -40,6 +40,7 @@ class DB {
"INSERT INTO class (name) VALUES ('TGM13.1'), ('TGM13.2'), ('TGTM13.1'), ('TGI13.1'), ('TGI13.2'), ('teacher')"
);
+ // User polls
fs.readFile(__dirname + "/poll.txt", "utf8", (err, data) => {
if (err) throw err;
@@ -53,6 +54,7 @@ class DB {
});
});
+ // Motto votes
fs.readFile(__dirname + "/mottos.txt", "utf8", (err, data) => {
if (err) throw err;
@@ -64,6 +66,15 @@ class DB {
});
});
+ fs.readFile(__dirname + "/profile.txt", "utf8", (err, data) => {
+ if (err) throw err;
+
+ const questions = data.split("\n");
+ questions.forEach((question) => {
+ if (question) this.query("INSERT INTO profile_questions (question) VALUE (?)", [question]);
+ });
+ });
+
const classes = data.split("--");
const userPasswords = {};
console.log("Generating users");