-
Notifications
You must be signed in to change notification settings - Fork 12
/
mgr.js
executable file
·159 lines (138 loc) · 4.24 KB
/
mgr.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
define(['managerAPI'], function(Manager) {
var API = new Manager();
API.setName('mgr');
API.addSettings('skip',true);
API.addSettings('skin','demo');
API.addSettings('logger',{type:'csv', url:'csv.php'});
var raceSet = API.shuffle(['a','b'])[0];
var blackLabels = [];
var whiteLabels = [];
if (raceSet == 'a') {
blackLabels.push('African Americans');
whiteLabels.push('European Americans');
} else {
blackLabels.push('Black people');
whiteLabels.push('White people');
}
API.save({
raceSet:raceSet,
blackLabels:blackLabels,
whiteLabels:whiteLabels
});
API.addGlobal({
raceiat:{},
//YBYB: change when copying back to the correct folder
baseURL: './study.race/images/',
raceSet:raceSet,
blackLabels:blackLabels,
whiteLabels:whiteLabels,
posWords : API.shuffle([
'Love', 'Cheer', 'Friend', 'Pleasure',
'Adore', 'Cheerful', 'Friendship', 'Joyful',
'Smiling','Cherish', 'Excellent', 'Glad',
'Joyous', 'Spectacular', 'Appealing', 'Delight',
'Excitement', 'Laughing', 'Attractive','Delightful',
'Fabulous', 'Glorious', 'Pleasing', 'Beautiful',
'Fantastic', 'Happy', 'Lovely', 'Terrific',
'Celebrate', 'Enjoy', 'Magnificent', 'Triumph'
]),
negWords : API.shuffle([
'Abuse', 'Grief', 'Poison', 'Sadness',
'Pain', 'Despise', 'Failure', 'Nasty',
'Angry', 'Detest', 'Horrible', 'Negative',
'Ugly', 'Dirty', 'Gross', 'Evil',
'Rotten','Annoy', 'Disaster', 'Horrific',
'Scorn', 'Awful', 'Disgust', 'Hate',
'Humiliate', 'Selfish', 'Tragic', 'Bothersome',
'Hatred', 'Hurtful', 'Sickening', 'Yucky'
])
});
API.addTasksSet({
instructions: [{
type: 'message',
piTemplate: true,
buttonText: 'Continue'
}],
realstart: [{
inherit: 'instructions',
name: 'realstart',
templateUrl: 'realstart.jst',
title: 'Consent',
header: 'Welcome'
}],
raceiat_instructions: [{
inherit: 'instructions',
name: 'raceiat_instructions',
templateUrl: 'raceiat_instructions.jst',
title: 'IAT Instructions',
header: 'Implicit Association Test'
}],
explicits: [{
type: 'quest',
name: 'explicits',
scriptUrl: 'explicits.js'
}],
raceiat: [{
type: 'time',
name: 'raceiat',
scriptUrl: 'raceiat.js'
}],
demographics: [{
type: 'quest',
name: 'demographics',
scriptUrl:'demographics.js'
}],
mrscale: [{
type: 'quest',
name: 'mrscale',
scriptUrl:'mrscale.js'
}],
rwascale: [{
type: 'quest',
name: 'rwascale',
scriptUrl:'rwascale.js'
}],
debriefing: [{
type: 'quest',
name: 'debriefing',
scriptUrl: 'debriefing.js'
}],
lastpage: [{
inherit: 'instructions',
templateUrl: 'lastpage.jst',
title: 'End',
buttonHide: true,
header: 'You have completed the study'
}]
});
API.addSequence([
{inherit: 'realstart'},
{
mixer:'random',
data:[
{inherit: 'explicits'},
{inherit: 'demographics'},
// force the instructions to preceed the iat
{
mixer: 'wrapper',
data: [
{inherit: 'raceiat_instructions'},
{inherit: 'raceiat'}
]
}
]
},
{
mixer:'choose',
n:1,
data:[
{ inherit: 'mrscale' },
{ inherit: 'rwascale' }
]
},
{inherit: 'debriefing'},
{ type:'postCsv'},
{inherit: 'lastpage'}
]);
return API.script;
});