-
Notifications
You must be signed in to change notification settings - Fork 41
/
workshopper.js
45 lines (35 loc) · 1.05 KB
/
workshopper.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
var Adventure = require('./adventure')
var util = require('./util')
var inherits = require('util').inherits
module.exports = LegacyWorkshopper
function LegacyWorkshopper (options) {
if (!(this instanceof LegacyWorkshopper)) {
return new LegacyWorkshopper(options)
}
if (!options.header) {
if (options.showHeader === undefined || options.showHeader) {
options.header = require('./default/header')
}
}
if (options.hideRemaining === undefined) {
options.hideRemaining = false
}
if (options.requireSubmission === undefined) {
options.requireSubmission = true
}
if (options.pass === undefined) {
options.pass = require('./default/pass')
}
if (options.fail === undefined) {
options.fail = require('./default/fail')
}
if (options.execute === undefined) {
options.execute = 'immediatly'
}
Adventure.apply(this, [options])
var menuJson = util.getFile(options.menuJson || 'menu.json', this.options.exerciseDir)
if (menuJson) {
this.addAll(require(menuJson))
}
}
inherits(LegacyWorkshopper, Adventure)