forked from elinorbengayev/elinorbengayev.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathskinIAT.js
152 lines (141 loc) · 4.79 KB
/
skinIAT.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
define(['pipAPI', 'https://cdn.jsdelivr.net/gh/baranan/minno-tasks@0.*/IAT/qualtrics/quiat8.js'], function(APIConstructor, iatExtension){
var API = new APIConstructor();
var set = API.shuffle(['A','B'])[0];
var lightImages = [];
var darkImages = [];
var lightImagesLabel = [];
var darkImagesLabel = [];
var baseURL = 'https://baranan.github.io/minno-tasks/images/';
//Fill the sets of words and images for the gay categories, based on the gay-set condition
if (set == 'A')
{
darkImages.push('tone0031b.jpg');
darkImages.push('tone0051b.jpg');
darkImages.push('tone0061b.jpg');
darkImages.push('tone0081b.jpg');
darkImages.push('tone0111b.jpg');
darkImages.push('tone0121b.jpg');
lightImages.push('tone0041a.jpg');
lightImages.push('tone0071a.jpg');
lightImages.push('tone0091a.jpg');
lightImages.push('tone0101a.jpg');
lightImages.push('tone0131a.jpg');
lightImages.push('tone0141a.jpg');
lightImagesLabel = 'label2a.jpg';
darkImagesLabel = 'label1b.jpg';
}
else if (set == 'B')
{
darkImages.push('tone0071b.jpg');
darkImages.push('tone0131b.jpg');
darkImages.push('tone0091b.jpg');
darkImages.push('tone0101b.jpg');
darkImages.push('tone0141b.jpg');
darkImages.push('tone0041b.jpg');
lightImages.push('tone0081a.jpg');
lightImages.push('tone0031a.jpg');
lightImages.push('tone0061a.jpg');
lightImages.push('tone0111a.jpg');
lightImages.push('tone0051a.jpg');
lightImages.push('tone0121a.jpg');
lightImagesLabel ='label1a.jpg';
darkImagesLabel ='label2b.jpg';
}
var 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']);
var 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']);
var darkMedia = [];
for(var dImage = 0; dImage < darkImages.length; dImage++)
{
darkMedia.push({image:darkImages[dImage]});
}
var lightMedia = [];
for(var lImage = 0; lImage < lightImages.length; lImage++)
{
lightMedia.push({image:lightImages[lImage]});
}
return iatExtension({
category1 : {
name : 'Dark Skinned People', //Will appear in the data.
title : {
media : {image:darkImagesLabel}, //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 : darkMedia,
//Stimulus css (style)
stimulusCss : {color:'#31940F','font-size':'2.3em'}
},
category2 : {
name : 'Light Skinned People', //Will appear in the data.
title : {
media : {image:lightImagesLabel}, //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 : lightMedia,
//Stimulus css (style)
stimulusCss : {color:'#31940F','font-size':'2.3em'}
},
attribute1 :
{
name : 'Bad',
title : {
media : {word : 'Bad'},
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: negWords[0]},
{word: negWords[1]},
{word: negWords[2]},
{word: negWords[3]},
{word: negWords[4]},
{word: negWords[5]},
{word: negWords[6]},
{word: negWords[7]}
],
//Stimulus css
stimulusCss : {color:'#0000FF','font-size':'2.3em'}
},
attribute2 :
{
name : 'Good',
title : {
media : {word : 'Good'},
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: posWords[0]},
{word: posWords[1]},
{word: posWords[2]},
{word: posWords[3]},
{word: posWords[4]},
{word: posWords[5]},
{word: posWords[6]},
{word: posWords[7]}
],
//Stimulus css
stimulusCss : {color:'#0000FF','font-size':'2.3em'}
},
base_url : {//Where are your images at?
image : baseURL
}
});
});