forked from neuroergolab/stepup_raceiat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrace.js
131 lines (125 loc) · 5.25 KB
/
race.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
define(['pipAPI','https://cdn.jsdelivr.net/gh/baranan/minno-tasks@0.*/IAT/iat10.js'], function(APIConstructor, iatExtension){
let API = new APIConstructor();
//Randomly select which of two sets of category labels to use.
let raceSet = API.shuffle(['a','b'])[0];
let blackLabels = [];
let whiteLabels = [];
if (raceSet == 'a') {
blackLabels.push('African Americans');
whiteLabels.push('European Americans');
} else {
blackLabels.push('Black people');
whiteLabels.push('White people');
}
API.addGlobal({
raceiat:{},
raceSet:raceSet,
blackLabels:blackLabels,
whiteLabels:whiteLabels,
//Select randomly what attribute words to see.
//Based on Axt, Feng, & Bar-Anan (2021).
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'
])
});
let global = API.getGlobal();
return iatExtension({
category1 : {
name : global.blackLabels, //Will appear in the data.
title : {
media : {word : global.blackLabels}, //Name of the category presented in the task.
css : {color:'#31940F','font-size':'1.8em'}, //Style of the category title.
height : 4 //Used to position the "Or" in the combined block.
},
stimulusMedia : [ //Stimuli content as PIP's media objects
{image: 'bm1_nc.jpg'},
{image: 'bm2_nc.jpg'},
{image: 'bm3_nc.jpg'},
{image: 'bf1_nc.jpg'},
{image: 'bf2_nc.jpg'},
{image: 'bf3_nc.jpg'}
],
//Stimulus css (style)
stimulusCss : {color:'#31940F','font-size':'2.3em'}
},
category2 : {
name : global.whiteLabels, //Will appear in the data.
title : {
media : {word : global.whiteLabels}, //Name of the category presented in the task.
css : {color:'#31940F','font-size':'1.8em'}, //Style of the category title.
height : 4 //Used to position the "Or" in the combined block.
},
stimulusMedia : [ //Stimuli content as PIP's media objects
{image: 'wm1_nc.jpg'},
{image: 'wm2_nc.jpg'},
{image: 'wm3_nc.jpg'},
{image: 'wf1_nc.jpg'},
{image: 'wf2_nc.jpg'},
{image: 'wf3_nc.jpg'}
],
//Stimulus css (style)
stimulusCss : {color:'#31940F','font-size':'2.3em'}
},
attribute1 : {
name : 'Bad words',
title : {
media : {word : 'Bad words'},
css : {color:'#0000FF','font-size':'1.8em'},
height : 4 //Used to position the "Or" in the combined block.
},
stimulusMedia : [ //Stimuli content as PIP's media objects
{word: global.negWords[0]},
{word: global.negWords[1]},
{word: global.negWords[2]},
{word: global.negWords[3]},
{word: global.negWords[4]},
{word: global.negWords[5]},
{word: global.negWords[6]},
{word: global.negWords[7]}
],
//Stimulus css
stimulusCss : {color:'#0000FF','font-size':'2.3em'}
},
attribute2 : {
name : 'Good words',
title : {
media : {word : 'Good words'},
css : {color:'#0000FF','font-size':'1.8em'},
height : 4 //Used to position the "Or" in the combined block.
},
stimulusMedia : [ //Stimuli content as PIP's media objects
{word: global.posWords[0]},
{word: global.posWords[1]},
{word: global.posWords[2]},
{word: global.posWords[3]},
{word: global.posWords[4]},
{word: global.posWords[5]},
{word: global.posWords[6]},
{word: global.posWords[7]}
],
//Stimulus css
stimulusCss : {color:'#0000FF','font-size':'2.3em'}
},
base_url : {//Where are your images at?
image : 'https://baranan.github.io/minno-tasks/studies/datapipe.iat.examples/demo.iats/race.images/'
},
isTouch : global.$isTouch
});
});