-
Notifications
You must be signed in to change notification settings - Fork 3
/
quizzer.js
54 lines (44 loc) · 1.88 KB
/
quizzer.js
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
46
47
48
49
50
51
52
53
(function () {
function run () {
// (reads from quizServer.cfg and mypwd.txt)
var config = require('./lib/config').config;
var optsModule = require('./lib/opts.js');
var optsClass = new optsModule.optsClass(config);
var opts = optsClass.getOpts();
if (!opts) {
return;
} else if (opts.save_parameters) {
console.log("Save parameters!");
}
var mailerModule = require('./lib/mailer.js');
var mailerClass = new mailerModule.mailerClass(opts);
var mailer = mailerClass.getMailer();
if (!mailer) {
return;
}
var scheduleModule = require('./lib/scheduler.js');
var scheduler = new scheduleModule.scheduleClass(opts,mailer);
// (creates subdirs and sqlite3 database if necessary,
// migrates to sqlite3 db from old CSV files, and removes
// CSV and their subdirs after validation)
var initModule = require('./lib/init.js');
var initClass = new initModule.initClass(opts,mailer,scheduler);
var init = initClass.getInit();
var sysModule = require('./lib/sys.js');
var sysClass = new sysModule.sysClass(opts,mailer);
var sys = sysClass.getSys();
var utilModule = require('./lib/util.js');
var utilClass = new utilModule.utilClass(sys);
var utils = utilClass.getUtils();
var cogsModule = require('./lib/cogs.js');
var cogsClass = new cogsModule.cogsClass(sys,utils);
var cogs = cogsClass.getCogs();
var apiModule = require('./lib/api.js');
var apiClass = new apiModule.apiClass(sys,cogs);
var api = apiClass.getApi();
var serverModule = require('./lib/server.js');
var serverClass = new serverModule.serverClass(sys,api,utils);
serverClass.runServer();
}
exports.run = run;
})();