-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpermea.html
609 lines (547 loc) · 30.1 KB
/
permea.html
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
<!--
~~~~ TO DO ~~~~
Qualtrics link (counterbalance?)
Adjust presentation time
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>exp</title>
<script src="jspsych-6.0.3/jspsych.js"></script>
<script src="jspsych-6.0.3/plugins/jspsych-fullscreen.js"></script>
<script src="jspsych-6.0.3/plugins/jspsych-html-keyboard-response.js"></script>
<script src="jspsych-6.0.3/plugins/jspsych-html-button-response.js"></script>
<script src="jspsych-6.0.3/plugins/jspsych-survey-text.js"></script>
<script src="js/jspsych-html-mouse-response.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/lodash.min.js"></script>
<script src="js/firebase.js"></script>
<link href="jspsych-6.0.3/css/jspsych.css" rel="stylesheet" type="text/css">
<style>
body {
cursor: default;
}
.jspsych-content-wrapper {
width: 800px;
height: 650px;
}
#yellow {
color: #ffc000;
margin-right: 120px;
}
#orange {
color: #ed7c31;
margin-left: 120px;
}
</style>
</head>
<body></body>
<script>
/* Parameters */
var itiSta = 400; // 400; inter-trial-interval for statements
var delaySta = 5500; // 5500; how long is each statement displayed
var dotTaskTrialDuration = 3000; // 3000
var loadingDuration = 7000; // 7000
var qlink = "https://uclpsychology.co1.qualtrics.com/jfe/form/SV_cVoaYbc68SO8Gxf";
/* Initial variables */
var timeline = [];
var HC = [];
var LC = [];
var preloadimages = [];
var id = jsPsych.data.getURLVariable("id");
var hghGrpClr = jsPsych.data.getURLVariable("hghGrpClr"); // high group
var permeaCond = jsPsych.data.getURLVariable("permeaCond"); // permeability condition
var underOver = jsPsych.data.getURLVariable("cond"); // "under" or "over" estimator
///////////// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
///////////// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
///////////// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
var delaySta = jsPsych.data.getURLVariable("delaySta") == null ? delaySta : jsPsych.data.getURLVariable("delaySta");
delaySta = parseInt(delaySta);
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Impression formation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* Generate statements */
var CP = ['CP1', 'CP2', 'CP3', 'CP4', 'CP5', 'CP6', 'CP7', 'CP8']; // C+
var CN = ['CN1', 'CN2', 'CN3', 'CN4', 'CN5', 'CN6', 'CN7', 'CN8']; // C-
var WP = ['WP1', 'WP2', 'WP3', 'WP4', 'WP5', 'WP6', 'WP7', 'WP8']; // W+
var WN = ['WN1', 'WN2', 'WN3', 'WN4', 'WN5', 'WN6', 'WN7', 'WN8']; // w-
// HC: 6C+, 2C-, 2W+, 2W-
HC = HC.concat(_.sampleSize(CP, 6), _.sampleSize(CN, 2), _.sampleSize(WP, 2), _.sampleSize(WN, 2));
// LC: 2C+, 6C-, 2W+, 2W-
var CPleft = _.difference(CP, HC);
var CNleft = _.difference(CN, HC);
var WPleft = _.difference(WP, HC);
var WNleft = _.difference(WN, HC);
LC = LC.concat(_.sampleSize(CPleft, 2), _.sampleSize(CNleft, 6), _.sampleSize(WPleft, 2), _.sampleSize(WNleft, 2));
HC = _.shuffle(HC);
LC = _.shuffle(LC);
// Assign group identity (B vs. G)
var hghGrpClr = hghGrpClr == null ? _.sample(['B', 'G']) : hghGrpClr;
var lowGrpClr = _.difference(['B', 'G'], [hghGrpClr])[0];
HC = HC.map(function (e) { return e + hghGrpClr });
LC = LC.map(function (e) { return e + lowGrpClr });
var hghFstSta = _.sample([true, false]);
if (hghFstSta) { var staOrd = HC.concat(LC) } else { var staOrd = LC.concat(HC) };
if (hghGrpClr == 'B') {
var HcolorHtml = "<span id='blue'>Blue group</span>";
var LcolorHtml = "<span id='green'>Green group</span>";
} else {
var HcolorHtml = "<span id='green'>Green group</span>";
var LcolorHtml = "<span id='blue'>Blue group</span>";
};
/* Statements */
var CP = [
"X won the yearly award for the employee who contributes most to the company’s profit.",
"X practiced the violin piece 20 times a day and after a month felt that he/she had it right.",
"X wrote a small computer program that solved a tough calculus integration problem.",
"X speaks fluently three different languages.",
"X presented his/her research at a chemistry congress.",
"X published a short story in a literary magazine while still in college.",
"X worked hard on the extra-credit assignment in linear algebra.",
"X is very careful when it comes to savings so that buying that first house will be possible."
];
var CN = [
"X went hiking in the mountains and had to be rescued because he/she wasn’t paying attention to where he/she was going.",
"X was fired from his/her job because he/she rarely got things done on time.",
"X’s bicycle was stolen several times because he/she forgets to set the lock.",
"X often gets lost when driving in the city, even though he/she has been living there for several years.",
"X’s electricity was turned off because he/she did not paid the bill on time.",
"X had trouble finding work because he/she was always late for job interviews.",
"X took almost an hour to find his/her car after parking it in a shopping mall.",
"X did not pass his/her driving test for the third time and ended up abandoning it."
];
var WP = [
"X spent hours with a friend whose dog died.",
"X loves to be with other people.",
"X helped a blind woman cross the street.",
"X always greets friends with a big hug.",
"X always smiles at strangers on the street just to make their day better.",
"X loves to hold hands while walking.",
"X enjoys having long conversations with friends.",
"X gave up his/her seat on the crowded bus when an elderly woman got on."
];
var WN = [
"X couldn’t be bothered to give directions to a stranger.",
"X decided that everyone at the party was pretty shallow and left early.",
"X prefers to go to the movie alone rather than with a friend.",
"X yelled at the driver who took the last parking space.",
"X rarely talked to the other people in the house that a bunch of them shared.",
"X did not want to congratulate the winner of the competition.",
"X didn’t go to his/her grandmother’s funeral because he/she was too busy with work.",
"X yelled at a little girl for coloring outside the lines."
];
staStim = {
CP1B: "<p id='blueSta'><b>Blue group</b></br></br>" + CP[0] + "</p>", CP1G: "<p id='greenSta'><b>Green group</b></br></br>" + CP[0] + "</p>",
CP2B: "<p id='blueSta'><b>Blue group</b></br></br>" + CP[1] + "</p>", CP2G: "<p id='greenSta'><b>Green group</b></br></br>" + CP[1] + "</p>",
CP3B: "<p id='blueSta'><b>Blue group</b></br></br>" + CP[2] + "</p>", CP3G: "<p id='greenSta'><b>Green group</b></br></br>" + CP[2] + "</p>",
CP4B: "<p id='blueSta'><b>Blue group</b></br></br>" + CP[3] + "</p>", CP4G: "<p id='greenSta'><b>Green group</b></br></br>" + CP[3] + "</p>",
CP5B: "<p id='blueSta'><b>Blue group</b></br></br>" + CP[4] + "</p>", CP5G: "<p id='greenSta'><b>Green group</b></br></br>" + CP[4] + "</p>",
CP6B: "<p id='blueSta'><b>Blue group</b></br></br>" + CP[5] + "</p>", CP6G: "<p id='greenSta'><b>Green group</b></br></br>" + CP[5] + "</p>",
CP7B: "<p id='blueSta'><b>Blue group</b></br></br>" + CP[6] + "</p>", CP7G: "<p id='greenSta'><b>Green group</b></br></br>" + CP[6] + "</p>",
CP8B: "<p id='blueSta'><b>Blue group</b></br></br>" + CP[7] + "</p>", CP8G: "<p id='greenSta'><b>Green group</b></br></br>" + CP[7] + "</p>",
CN1B: "<p id='blueSta'><b>Blue group</b></br></br>" + CN[0] + "</p>", CN1G: "<p id='greenSta'><b>Green group</b></br></br>" + CN[0] + "</p>",
CN2B: "<p id='blueSta'><b>Blue group</b></br></br>" + CN[1] + "</p>", CN2G: "<p id='greenSta'><b>Green group</b></br></br>" + CN[1] + "</p>",
CN3B: "<p id='blueSta'><b>Blue group</b></br></br>" + CN[2] + "</p>", CN3G: "<p id='greenSta'><b>Green group</b></br></br>" + CN[2] + "</p>",
CN4B: "<p id='blueSta'><b>Blue group</b></br></br>" + CN[3] + "</p>", CN4G: "<p id='greenSta'><b>Green group</b></br></br>" + CN[3] + "</p>",
CN5B: "<p id='blueSta'><b>Blue group</b></br></br>" + CN[4] + "</p>", CN5G: "<p id='greenSta'><b>Green group</b></br></br>" + CN[4] + "</p>",
CN6B: "<p id='blueSta'><b>Blue group</b></br></br>" + CN[5] + "</p>", CN6G: "<p id='greenSta'><b>Green group</b></br></br>" + CN[5] + "</p>",
CN7B: "<p id='blueSta'><b>Blue group</b></br></br>" + CN[6] + "</p>", CN7G: "<p id='greenSta'><b>Green group</b></br></br>" + CN[6] + "</p>",
CN8B: "<p id='blueSta'><b>Blue group</b></br></br>" + CN[7] + "</p>", CN8G: "<p id='greenSta'><b>Green group</b></br></br>" + CN[7] + "</p>",
WP1B: "<p id='blueSta'><b>Blue group</b></br></br>" + WP[0] + "</p>", WP1G: "<p id='greenSta'><b>Green group</b></br></br>" + WP[0] + "</p>",
WP2B: "<p id='blueSta'><b>Blue group</b></br></br>" + WP[1] + "</p>", WP2G: "<p id='greenSta'><b>Green group</b></br></br>" + WP[1] + "</p>",
WP3B: "<p id='blueSta'><b>Blue group</b></br></br>" + WP[2] + "</p>", WP3G: "<p id='greenSta'><b>Green group</b></br></br>" + WP[2] + "</p>",
WP4B: "<p id='blueSta'><b>Blue group</b></br></br>" + WP[3] + "</p>", WP4G: "<p id='greenSta'><b>Green group</b></br></br>" + WP[3] + "</p>",
WP5B: "<p id='blueSta'><b>Blue group</b></br></br>" + WP[4] + "</p>", WP5G: "<p id='greenSta'><b>Green group</b></br></br>" + WP[4] + "</p>",
WP6B: "<p id='blueSta'><b>Blue group</b></br></br>" + WP[5] + "</p>", WP6G: "<p id='greenSta'><b>Green group</b></br></br>" + WP[5] + "</p>",
WP7B: "<p id='blueSta'><b>Blue group</b></br></br>" + WP[6] + "</p>", WP7G: "<p id='greenSta'><b>Green group</b></br></br>" + WP[6] + "</p>",
WP8B: "<p id='blueSta'><b>Blue group</b></br></br>" + WP[7] + "</p>", WP8G: "<p id='greenSta'><b>Green group</b></br></br>" + WP[7] + "</p>",
WN1B: "<p id='blueSta'><b>Blue group</b></br></br>" + WN[0] + "</p>", WN1G: "<p id='greenSta'><b>Green group</b></br></br>" + WN[0] + "</p>",
WN2B: "<p id='blueSta'><b>Blue group</b></br></br>" + WN[1] + "</p>", WN2G: "<p id='greenSta'><b>Green group</b></br></br>" + WN[1] + "</p>",
WN3B: "<p id='blueSta'><b>Blue group</b></br></br>" + WN[2] + "</p>", WN3G: "<p id='greenSta'><b>Green group</b></br></br>" + WN[2] + "</p>",
WN4B: "<p id='blueSta'><b>Blue group</b></br></br>" + WN[3] + "</p>", WN4G: "<p id='greenSta'><b>Green group</b></br></br>" + WN[3] + "</p>",
WN5B: "<p id='blueSta'><b>Blue group</b></br></br>" + WN[4] + "</p>", WN5G: "<p id='greenSta'><b>Green group</b></br></br>" + WN[4] + "</p>",
WN6B: "<p id='blueSta'><b>Blue group</b></br></br>" + WN[5] + "</p>", WN6G: "<p id='greenSta'><b>Green group</b></br></br>" + WN[5] + "</p>",
WN7B: "<p id='blueSta'><b>Blue group</b></br></br>" + WN[6] + "</p>", WN7G: "<p id='greenSta'><b>Green group</b></br></br>" + WN[6] + "</p>",
WN8B: "<p id='blueSta'><b>Blue group</b></br></br>" + WN[7] + "</p>", WN8G: "<p id='greenSta'><b>Green group</b></br></br>" + WN[7] + "</p>",
};
stimStaOrd = []; // Ordered statements by group color
staOrd.map(function (sta) { stimStaOrd.push({ stimulus: staStim[sta] }) });
/* Consent */
var consent = {
type: 'fullscreen',
fullscreen_mode: true,
delay_after: 300,
button_label: "I agree to take part in this study",
message: function () {
html = "";
html += "<h1>Informed Consent</h1>";
html += "<p class='justify'>In this study about personality and cognitive styles you will be asked to ";
html += "take a test, read some statements, and fill in a survey. ";
html += "It is important that you remain <strong>concentrated throughout the task</strong>.</br></br>";
html += "Your participation is voluntary, does not imply any risks, your answers will be ";
html += "anonymous, and you are free to withdraw from the study at any moment. After full completion, ";
html += "you will receive a <strong>monetary compensation</strong> as stated in the Prolific ";
html += "description of this experiment.</br></br>";
html += "This study is administrated by Jennifer Bastart and Mathias Schmitz, researchers at the UCLouvain (Belgium).</br></br>";
html += "If you have any questions or comments please contact us at</br>";
html += "<b>[email protected]</b> or <b>[email protected]</b></p>";
return html;
}
};
/* PAXE cover story */
// Add PAXE images to preload
preloadimages.push('img/paxe.png');
preloadimages.push('img/paxe2.png');
var paxe1 = {
type: "html-button-response",
choices: ['continue'],
post_trial_gap: 200,
stimulus: function () {
var html = "";
html += "<img width='150' src='img/paxe.png'>";
html += "<p class='justify'>PAXE is a new aptitude test designed to characterize individuals ";
html += "depending on their personality traits and cognitive styles.</br></br>";
html += "Recent research conducted across a wide variety of countries around the world (Canada, USA, Europe, Japan, etc.) ";
html += "concludes that PAXE stands among the best predictors of academic and professional success. ";
html += "For instance, in the USA, the SAT score is highly correlated with the PAXE score. ";
html += "Similarly, yearly income in populations living in Europe and North America ";
html += "(Japanese data are still being collected) can also be predicted with high accuracy from this score.</br></br>";
html += "PAXE is not yet available on the market but its release is planned in the upcoming months. ";
html += "The aim of the present study is to improve the user’s experience of this tool before its final release.</br></br>";
html += "To do so, we will ask you to take the PAXE test and to give us your feedback and general impressions about it ";
html += "and about the groups in which people are assigned according to their PAXE scores.</p>";
return html;
},
};
var paxe2 = {
type: "html-button-response",
choices: ['start'],
post_trial_gap: 200,
stimulus: function () {
var html = "";
html += "<h1>Impression formation task</h1>";
html += "<p class='justify'>PAXE classifies individuals in two groups. For the sake of simplicity, ";
html += "we will label them the <span id='blue'>Blue group</span> and the ";
html += "<span id='green'>Green group</span>. Please note that the groups’ ";
html += "labels do not matter here. However, you should know that members of a given group are highly similar: ";
html += "They share similar ideas and beliefs, and their personalities and behaviors are usually alike. ";
html += "At the same time, members of one group differ quite markedly from the members of the other group. ";
html += "In order for you to become familiar with these two groups and to understand what they are like, ";
html += "we will give you a chance to complete a task to form an impression of each group.</br></br>";
html += "In a previous study, we tested a large sample of Americans with the PAXE test and ";
html += "asked them to list a series of behaviors that characterize them. ";
html += "Hereafter you will see some of these behaviors. These behaviors will be presented without identifying the actor, but ";
html += "you will still know if the behavior belongs to the ";
html += "<span id='blue'>Blue group</span> or to the <span id='green'>Green group</span> according to their PAXE score.</br></br>";
html += "Behaviors performed by <span id='blue'>Blue group</span> members will be displayed ";
html += "with a <span id='blue'>blue</span> background,</br>and behaviors performed by <span id='green'>Green group</span> ";
html += "members will be displayed with a <span id='green'>green</span> background.</br></br>";
html += "Your task is to <b>read</b> each of these behaviors and to do your best to <b>form an impression</b> ";
html += "about the two groups. ";
html += "Note that this is not a memory task. In addition, behaviors will be automatically paced. ";
html += "Please remain <b>concentrated</b>.</p>";
return html;
},
};
/* Statements randomised */
var staRandomised = {
timeline_variables: stimStaOrd,
randomize_order: true,
timeline: [{
type: 'html-keyboard-response',
stimulus: jsPsych.timelineVariable('stimulus'),
choices: jsPsych.NO_KEYS,
trial_duration: delaySta,
post_trial_gap: itiSta,
on_load: function () { $('body').css('cursor', 'none') },
}]
};
/* Sta ord instructions */
var staOrdInst = {
type: "html-button-response",
choices: ['start'],
post_trial_gap: 200,
stimulus: function () {
var html = "";
html += "<h1>Impression formation task</h1>";
html += "<p class='justify'>We will now present each behavior one last time.</br></br>";
html += "You will first see all the behaviors from one group and then those from the other.</br></br>";
html += "Your task is the same: <b>read</b> each behavior ";
html += "and do your best to <b>form an impression</b> about these two groups. ";
html += "The task will be automatically paced.</p>";
return html;
},
on_load: function () { $('body').css('cursor', 'default') },
on_finish: function () { $('body').css('cursor', 'none') },
};
/* Statements ordered */
var staOrdered = {
timeline_variables: stimStaOrd,
randomize_order: false,
timeline: [{
type: 'html-keyboard-response',
stimulus: jsPsych.timelineVariable('stimulus'),
choices: jsPsych.NO_KEYS,
trial_duration: delaySta - 300,
post_trial_gap: itiSta - 100
}]
};
/* Group description */
var hghFstDscrp = _.sample([true, false]);
var staDescription = {
type: 'survey-text',
preamble: 'Now, we will ask you to take one or two minutes to use the boxes below in order to write your general impressions about...',
questions: function () {
var G = "<span id='green'>GREEN</span>";
var B = "<span id='blue'>BLUE</span>";
function sendMsg(groupName) {
return 'the ' + groupName + ' group:' + "</br><span id='min2lines'>(between 2 and 5 lines)</span>";
};
if (hghGrpClr == 'B') { var HGname = B; var LGname = G; } else { var HGname = G; var LGname = B; };
if (hghFstDscrp) {
return [{ prompt: sendMsg(HGname), rows: 5, columns: 80 }, { prompt: sendMsg(LGname), rows: 5, columns: 80 }];
} else {
return [{ prompt: sendMsg(LGname), rows: 5, columns: 80 }, { prompt: sendMsg(HGname), rows: 5, columns: 80 }];
};
},
data: {task: "descriptions" },
on_load: function () { $('body').css('cursor', 'default') },
};
/* Transition 1 */
var transition1 = {
type: "html-button-response",
choices: ['continue'],
post_trial_gap: 200,
stimulus: function () {
var html = "";
html += "<p class='justify'>The impression formation task is now over. ";
html += "Next, you will perform one of PAXE’s tasks.</p>";
return html;
},
};
var mingrp1 = {
type: "html-button-response",
choices: ['continue'],
post_trial_gap: 200,
stimulus: function () {
var html = "";
html += "<h1>PAXE TEST</h1>";
html += "<p class='justify'>Now that you have a better representation of what the Blue and the Green groups are like, ";
html += "you will perform one of PAXE’s tasks. ";
html += "The overall PAXE score is a composite score based on performance on four separate tasks.</p>";
html += "<img width='200' src='img/paxe2.png'>";
html += "<p class='justify'>For the present study, you will only take the <b>Numerical Estimation task</b>, ";
html += "which is actually the most important of the four tasks.";
html += "This task is also called the dot estimation task. It is a psychological task based on the perception of visual stimuli.</br></br>";
html += "At the end of the test, a very precise algorithm that takes into account many factors like the dispersion, ";
html += "symmetry, color, distance, and size of the dots, will allow us determining if you are a numerical ";
html += "<b><u>under</u>estimator</b> or a numerical <b><u>over</u>estimator</b>.</p>"
return html;
},
on_load: function () { $('body').css('cursor', 'default') },
};
// Yellow orange key
var yelloworange = "";
yelloworange += "<span id='yellow'>more yellow dots</span>";
yelloworange += "<span id='orange'>more orange dots</span></br>";
yelloworange += "<span class='light-keys'><kbd>S</kbd></span>";
yelloworange += "                         ";
yelloworange += "                         ";
yelloworange += "                         ";
yelloworange += "    ";
yelloworange += "<span class='light-keys'><kbd>L</kbd></span>";
/* Minimal Group Assignment */
var mingrp2 = {
type: "html-button-response",
choices: ['start'],
post_trial_gap: 200,
stimulus: function () {
var html = "";
html += "<h1>NUMERICAL ESTIMATION TASK</h1>";
html += "<p class='justify'>Your goal is to estimate as best you can if there are more yellow or orange dots ";
html += "(while ignoring the size of the dots). For each trial, you will have a maximum of <b>3 seconds</b> to provide an answer. ";
html += "Note that it is often impossible to count all the dots, so we ask you to make a quick guess based on your intuition. ";
html += "No feedback will be given during the task. To record your response use the ";
html += "<span class='light-keys'><kbd>S</kbd></span> and <span class='light-keys'><kbd>L</kbd></span> ";
html += "keyboard keys as shown below:</p></br></br>";
html += yelloworange;
html += "</br></br>";
return html;
},
on_finish: function () { $('body').css('cursor', 'none') },
};
/* Dot estimation task */
var stimDots = _.range(1, 13).map(function (e) { return {img: 'img/dot' + e + '.png'} });
stimDots.map(function (e) {preloadimages.push(e.img)});
var dotsTask = {
timeline_variables: stimDots,
randomize_order: false,
timeline: [{
type: 'html-keyboard-response',
choices: ['s', 'l'],
trial_duration: dotTaskTrialDuration,
post_trial_gap: 200,
stimulus: function () {
var html = "";
html += "<img width='700px' src='" + jsPsych.timelineVariable('img', true) + "'></br>";
html += yelloworange;
html += "</br></br>";
return html;
},
}]
};
/* Fake loading score */
var loadScore = {
type: 'html-keyboard-response',
stimulus: "<p>Please wait a few seconds while we compute your score on the Numerical Estimation task...</p>" +
"<img width='350px' src='https://media0.giphy.com/media/3oEjI6SIIHBdRxXI40/giphy.gif'>",
choices: jsPsych.NO_KEYS,
trial_duration: loadingDuration,
post_trial_gap: 200,
};
/* PAXE results */
// Assign participants as under- or over-estimators
var underOver = underOver == null ? _.sample(['under', 'over']) : underOver;
var underOver = "under";
// Assign group identity (B vs. G)
var inGrpClr = lowGrpClr == "B" ? "B" : "G"; // ingroup always low-status
if(inGrpClr == hghGrpClr) {var inGrp = "H"};
if(inGrpClr == lowGrpClr) {var inGrp = "L"};
if(inGrpClr == 'G') { inGrpLabel = "<span id='green'>Green group</span>" } else { inGrpLabel = "<span id='blue'>Blue group</span>" };
var mingrp3 = {
type: "html-button-response",
choices: ['continue'],
post_trial_gap: 200,
stimulus: function () {
var html = "";
html += "<h1>NUMERICAL ESTIMATION TASK: RESULTS</h1>";
html += "<p class='justify'>As far as you are concerned, the responses reveal that you tend to <b><u>"+underOver+"</u>estimate</b> ";
html += "the number of dots presented on the screen.</br></br>";
html += "As it turns out, 95% of the <b><u>"+underOver+"</u>estimators</b> belong to the "+inGrpLabel+". ";
html += "Accordingly, you are very likely to belong to the "+inGrpLabel+".</p>";
return html;
},
on_load: function () { $('body').css('cursor', 'default') },
};
/* Permeability manipulation */
// Assign participants to permeable or impermeable condition
var permeaCond = permeaCond == null ? _.sample(['permeable', 'impermeable']) : permeaCond;
var permea1 = {
type: "html-button-response",
choices: ['continue'],
post_trial_gap: 200,
stimulus: function () {
var html = "";
html += "<h1>NUMERICAL ESTIMATION TASK: RESULTS</h1>";
html += "<p class='justify'>";
if (permeaCond == "impermeable") {
html += "It is important that you know that the tendency to overestimate or underestimate the number of objects ";
html += "in a visual display <b>is a stable and permanent characteristic of an individual</b>.</br></br>";
html += "Consequently, being categorized as an overestimator or underestimator can very much ";
html += "be considered as a <b>stable characteristic throughout life</b>.";
} else {
html += "It is important that you know that the tendency to overestimate or underestimate the number of objects ";
html += "in a visual display <b><u>is not</u> a stable and permanent characteristic of an individual</b>.</br></br>";
html += "Consequently, being categorized as an overestimator or underestimator can very much ";
html += "be considered as <b>likely to change over the life span</b>.";
};
html += "</p>";
return html;
},
};
var permea2 = {
type: "html-button-response",
choices: ['continue'],
post_trial_gap: 200,
stimulus: function () {
var html = "";
html += "<h1>NUMERICAL ESTIMATION TASK: RESULTS</h1>";
html += "<p class='justify'>";
if (permeaCond == "impermeable") {
html += "To sum up, based on your performances on the Numerical Estimation ";
html += "Task calculated by the algorithm, you are an <b><u>"+underOver+"</u>estimator</b>.</br></br>";
html += "95% of the <b><u>"+underOver+"</u>estimators</b> belong to the "+inGrpLabel+" according to their total score on the PAXE.</br></br>";
html += "Numerical underestimation (your characteristic) <b><u>is</u> a stable and permanent ";
html += "characteristic</b> and is <b>unlikely to change over the life span</b>.";
} else {
html += "To sum up, based on your performances on the Numerical Estimation ";
html += "Task calculated by the algorithm, you are an <b><u>"+underOver+"</u>estimator</b>.</br></br>";
html += "95% of the <b><u>"+underOver+"</u>estimators</b> belong to the "+inGrpLabel+" according to their total score on the PAXE.</br></br>";
html += "Numerical underestimation (your characteristic) <b><u>is not</u> a stable and permanent ";
html += "characteristic</b> and is <b>likely to change over the life span</b>.";
};
html += "</p>";
return html;
},
};
/* TIMELINES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
timeline.push(consent);
timeline.push(paxe1);
timeline.push(paxe2);
timeline.push(staRandomised);
timeline.push(staOrdInst);
timeline.push(staOrdered);
timeline.push(staDescription);
timeline.push(transition1);
timeline.push(mingrp1);
timeline.push(mingrp2);
timeline.push(dotsTask);
timeline.push(loadScore);
timeline.push(mingrp3);
timeline.push(permea1);
timeline.push(permea2);
timeline = _.flattenDeep(timeline);
/* INITIALISE EXP ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
jsPsych.init({
timeline: timeline,
preload_images: preloadimages,
max_load_time: 300 * 1000,
exclusions: {
min_width: 800,
min_height: 650,
},
on_finish: function (data) {
$("#jspsych-content").html("<img src='https://i.gifer.com/4V0b.gif'>");
/* Initialize Firebase */
var config = {
apiKey: "AIzaSyD4r9uWI4icto61fm2tC9neKdEiOUWzMJ8",
databaseURL: "https://biatw-68fe6.firebaseio.com/"
};
firebase.initializeApp(config);
var database = firebase.database();
if (id == null) { id = jsPsych.randomization.randomID(15) }; // if no id provided, generate a Firebase id
/* Qualtrics url parameters */
qlink += "?id=" + id;
qlink += "&hghGrpClr=" + hghGrpClr;
qlink += "&inGrpClr=" + inGrpClr;
qlink += "&inGrp=" + inGrp;
qlink += "&underOver=" + underOver;
qlink += "&permeaCond=" + permeaCond;
qlink += "&hghFstDscrp=" + hghFstDscrp;
qlink += "&windWidth=" + window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
qlink += "&windHeight=" + window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
qlink += "&screenWidth=" + screen.width || 0;
qlink += "&screenHeight=" + screen.height || 0;
qlink += "&userAgent=" + navigator.userAgent;
qlink += "&jsTime=" + jsPsych.totalTime();
/* jsPsych: add data to every trial */
jsPsych.data.addProperties({
id: id,
hghGrpClr: hghGrpClr, // H-group color: "G" | "B"
inGrpClr: inGrpClr, // Ingroup color: "G" | "B"
inGrp: inGrp, // Ingroup status: "H" | "L"
underOver: underOver, // Ingroup is under- or over-estimator: "under" | "over"
permeaCond: permeaCond, // permeability condition: "permeable" | "impermeable"
hghFstSta: hghFstSta, //
hghFstDscrp: hghFstDscrp, //
});
var dataPermea = data.filter({ task: 'descriptions' }).csv();
//jsPsych.data.displayData();
/* Send data to Firebase and redirect to Qualtrics */
database.ref("permea/" + id + "/").update({ dataPermea }).then(function () {
console.log("data sent!");
window.location = qlink; // redirect to qualtrics
});
}
});
</script>
</html>