-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1032 lines (891 loc) · 56.5 KB
/
index.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
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<title>FYP_Extended</title>
<script src="https://unpkg.com/[email protected]"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<script src="https://unpkg.com/@jspsych-contrib/plugin-pipe"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<link href="https://unpkg.com/[email protected]/css/jspsych.css" rel="stylesheet" type="text/css" />
</head>
<body></body>
<script>
// experiment ID from DataPipe
const expID = "mpvQSL8NChQb";
// intialize jsPsych
var jsPsych = initJsPsych({
// on_finish: function() {
// jsPsych.data.displayData();
// }
});
//To run the experiment without Prolific website
// const subject_id = jsPsych.randomization.randomID(10);
// jsPsych.data.addProperties({subject_id: subject_id});
//To run the experiment from Prolific website
// capture info from Prolific
// var subject_id = jsPsych.data.getURLVariable('PROLIFIC_PID');
// var study_id = jsPsych.data.getURLVariable('STUDY_ID');
// var session_id = jsPsych.data.getURLVariable('SESSION_ID');
// jsPsych.data.addProperties({
// subject_id: subject_id,
// study_id: study_id,
// session_id: session_id
// });
const subject_id = jsPsych.randomization.randomID(10);
jsPsych.data.addProperties({subject_id: subject_id});
var timeline = [];
var tr_duration = 30000;
var Maze_Linear = ['Maze_Map_Linear.png'];
var Maze_Diverse = ['Maze_Map_Diverse.png'];
//preloading the map linear
var preload = {
type: jsPsychPreload,
images: [Maze_Linear, Maze_Diverse],
};
timeline.push(preload);
// Change to full screen mode
var run_fullscreen = {
type: jsPsychFullscreen,
fullscreen_mode: true,
}
timeline.push(run_fullscreen);
//check the screen size
var screen_check = {
type: jsPsychBrowserCheck,
minimum_width: 1100,
minimum_height: 760,
exclusion_message: (data) => {
if(data.mobile){
return '<p>You must use a desktop/laptop computer to participate in this experiment.</p>'+
' Please return the experiment to Prolific.</p>';
}
else{
return '<p>The size of your browser window does not meet the requirements to participate in this experiment.'+
' Please return the experiment to Prolific.</p>';
}
}
};
timeline.push(screen_check);
// welcoming message
var greeting = {
type: jsPsychHtmlKeyboardResponse,
stimulus: "Welcome to the experiment! Press any key to start.",
};
timeline.push(greeting);
var consent_form = {
type: jsPsychInstructions,
pages: [
'<p style="font-size:24px;font-weight:bold;">CONSENT TO PARTICIPATE IN A RESEARCH STUDY<p> ' +
'<p style="class=positivefeedback; text-align:left; font-size:18px">'+
'<b>Study Title: Reasoning and Learning</b><p>' +
'<p style="text-align:left"><b>Investigator Name, Department, Telephone Number:</b>'+
'<p style="text-align:left">Prof. Tyler Marghetis, Cognitive and Information Sciences, 619-252-7798<p>'+
'<p style="text-align:left"><b>PURPOSE</b>'+
'<p style="text-align:left">You are being asked to participate in a research study conducted by Prof. Tyler Marghetis'+
' at the University of California, Merced. We hope to learn about how people reason about abstract concepts and complex topics.'+
'<p style="text-align:left"><b>PROCEDURES</b><p>'+
'<p style="text-align:left">If you choose to be in the study, you will be asked to answer questions, solve puzzles, and/or describe your reasoning.'+
' You will respond by writing, speaking, typing, and/or clicking on a computer screen. We may record your responses, '+
'including all interactions with the computer. These tasks allow us to better understand how people learn and reason.'+
' This should take between 5 minutes and one hour. The study will be completed either in-person or online on your computer.'+
' You can stop the study at any time. Approximately 5,000 people will participate in this study.'+
'<p style="text-align:left"><b>ALTERNATIVES </b>'+
'<p style="text-align:left">If you are receiving extra credit in connection with or as part of a course, your instructor must offer you other options for obtaining credit, if you decline to participate.'+
'<p style="text-align:left"><b>RISKS</b>'+
'<p style="text-align:left">Participants should generally not experience any risks beyond those of daily living and computer use. One potential risk is frustration when trying to solve more difficult reasoning problems.'+
'<p style="text-align:left"><b>BENEFITS</b>'+
'<p style="text-align:left">It is possible that you will not benefit directly by participating in this study. '+
'<p style="text-align:left"><b>CONFIDENTIALITY</b>'+
'<p style="text-align:left">Absolute confidentiality cannot be guaranteed, since research documents are not protected from subpoena. We will not ask for any identifiable information.'+
' The data collected in this study could be used for future research studies or distributed to other investigators for future research studies without additional informed consent from the subject or legally authorized representative.'+
' The information collected during this study may be presented at conferences, published in scientific journals, and shared with other researchers.'+
' Identifiable information will be removed before the data is shared. Individual privacy will be maintained and identities will not be disclosed.'+
'<p style="text-align:left"><b>COSTS/COMPENSATION</b>'+
'<p style="text-align:left">There is no cost to you beyond the time and effort required to complete the procedure(s) described above.'+
'<p style="text-align:left"><b>RIGHT TO REFUSE OR WITHDRAW</b>'+
'<p style="text-align:left">Participation is completely voluntary. You may refuse to participate in this study. You may change your mind about being in the study and quit after the study has started.'+
'<p style="text-align:left"><b>QUESTIONS</b>'+
'<p style="text-align:left">If you have any questions about this research project please contact Prof. Tyler Marghetis, who will answer them at 619-252-7798 or [email protected]'+
'For questions about your rights while taking part in this study call the Office of Research at (209) 228-4613 or write to the Office of Research,5200 North Lake Rd, UC Merced, Merced, CA 95343.'+
' The Office of Research will inform the Institutional Review Board which is a group of people who review the research to protect your rights. If you have any complaints or concerns about this study, you may address them to Rose Scott, Chair of the IRB at (209) 228-4362, [email protected].'+
'<p style="text-align:left"><b>CONSENT</b>'+
'<p style="text-align:left"><b>By choosing to continue to the next screen, you indicate that you have decided to participate as a research subject and that you have read and understood the information provided above. You may save a copy of this form to keep for your records. </b><p>'
],
show_clickable_nav: true,
button_label_next: 'Agree & Continue'
};
timeline.push(consent_form)
var let_set = [
"<b>ab</b>",
"<b>da</b>",
"<b>ea</b>",
"<b>gl</b>",
"<b>gr</b>",
"<b>le</b>",
"<b>mi</b>",
"<b>pr</b>",
"<b>st</b>",
"<b>zo</b>",
];
var shuffled_let_set = jsPsych.randomization.repeat(let_set, 1);
var CRAP_set = [
'<b>pie' + '\xa0\xa0\xa0\xa0' + 'luck' + '\xa0\xa0\xa0\xa0' + 'belly</b>',
'<b>opera' + '\xa0\xa0\xa0\xa0' + 'hand' + '\xa0\xa0\xa0\xa0' + 'dish</b>',
'<b>dust' + '\xa0\xa0\xa0\xa0' + 'cereal' + '\xa0\xa0\xa0\xa0' + 'fish</b>',
'<b>light' + '\xa0\xa0\xa0\xa0' + 'birthday' + '\xa0\xa0\xa0\xa0' + 'stick</b>',
'<b>palm' + '\xa0\xa0\xa0\xa0' + 'shoe' + '\xa0\xa0\xa0\xa0' + 'house</b>',
'<b>sage' + '\xa0\xa0\xa0\xa0' + 'paint' + '\xa0\xa0\xa0\xa0' + 'hair</b>',
'<b>french' + '\xa0\xa0\xa0\xa0' + 'car' + '\xa0\xa0\xa0\xa0' + 'shoe</b>',
'<b>carpet' + '\xa0\xa0\xa0\xa0' + 'alert' + '\xa0\xa0\xa0\xa0' + 'ink</b>',
'<b>mouse' + '\xa0\xa0\xa0\xa0' + 'bear' + '\xa0\xa0\xa0\xa0' + 'sand</b>',
'<b>show' + '\xa0\xa0\xa0\xa0' + 'life' + '\xa0\xa0\xa0\xa0' + 'row</b>',
];
var shuffled_CRAP_set = jsPsych.randomization.repeat(CRAP_set, 1);
var Venice1_prompt_linear = [
"<p>Imagine there are five items on the red dots. Deliver the items from the red spots to the follwoing location (hold <b>Ctrl</b> to draw):<p> <b>94<b> <p>",
"<p>Imagine there are five items on the red dots. Deliver the items from the red spots to the follwoing location (hold <b>Ctrl</b> to draw):<p> <b>34<b> <p>",
"<p>Imagine there are five items on the red dots. Deliver the items from the red spots to the follwoing location (hold <b>Ctrl</b> to draw):<p> <b>89<b> <p>",
"<p>Imagine there are five items on the red dots. Deliver the items from the red spots to the follwoing location (hold <b>Ctrl</b> to draw):<p> <b>72<b> <p>",
"<p>Imagine there are five items on the red dots. Deliver the items from the red spots to the follwoing location (hold <b>Ctrl</b> to draw):<p> <b>31<b> <p>",
"<p>Imagine there are five items on the red dots. Deliver the items from the red spots to the follwoing location (hold <b>Ctrl</b> to draw):<p> <b>41<b> <p>",
"<p>Imagine there are five items on the red dots. Deliver the items from the red spots to the follwoing location (hold <b>Ctrl</b> to draw):<p> <b>76<b> <p>",
"<p>Imagine there are five items on the red dots. Deliver the items from the red spots to the follwoing location (hold <b>Ctrl</b> to draw):<p> <b>18<b> <p>",
"<p>Imagine there are five items on the red dots. Deliver the items from the red spots to the follwoing location (hold <b>Ctrl</b> to draw):<p> <b>57<b> <p>",
"<p>Imagine there are five items on the red dots. Deliver the items from the red spots to the follwoing location (hold <b>Ctrl</b> to draw):<p> <b>22<b> <p>",
];
var Venice1_prompt_diverse = [
"<p>Imagine there are five items on the red dot. Deliver the items from the red spot to the following locations (hold <b>Ctrl</b> to draw):<p> <b>41, 89, 76, 26, 94<b> <p>",
"<p>Imagine there are five items on the red dot. Deliver the items from the red spot to the following locations (hold <b>Ctrl</b> to draw):<p> <b>22, 78, 34, 29, 14<b> <p>",
"<p>Imagine there are five items on the red dot. Deliver the items from the red spot to the following locations (hold <b>Ctrl</b> to draw):<p> <b>10, 22, 99, 52, 75<b> <p>",
"<p>Imagine there are five items on the red dot. Deliver the items from the red spot to the following locations (hold <b>Ctrl</b> to draw):<p> <b>13, 16, 62, 19, 45<b> <p>",
"<p>Imagine there are five items on the red dot. Deliver the items from the red spot to the following locations (hold <b>Ctrl</b> to draw):<p> <b>15, 59, 37, 92, 61<b> <p>",
"<p>Imagine there are five items on the red dot. Deliver the items from the red spot to the following locations (hold <b>Ctrl</b> to draw):<p> <b>62, 32, 44, 93, 10<b> <p>",
"<p>Imagine there are five items on the red dot. Deliver the items from the red spot to the following locations (hold <b>Ctrl</b> to draw):<p> <b>23, 18, 31, 40, 12<b> <p>",
"<p>Imagine there are five items on the red dot. Deliver the items from the red spot to the following locations (hold <b>Ctrl</b> to draw):<p> <b>48, 57, 72, 29, 39<b> <p>",
"<p>Imagine there are five items on the red dot. Deliver the items from the red spot to the following locations (hold <b>Ctrl</b> to draw):<p> <b>23, 81, 12, 39, 41<b> <p>",
"<p>Imagine there are five items on the red dot. Deliver the items from the red spot to the following locations (hold <b>Ctrl</b> to draw):<p> <b>71, 16, 38, 80, 53<b> <p>",
];
// between task message
var task1_done = {
type: jsPsychInstructions,
pages: [
'<p style="font-size:32px;font-weight:bold;">End of Task 1<p> ' +
'<p style="class=positivefeedback;font-size:24px">'+
'You have finished the first of two tasks. Whenever you are ready to continue, please click Next to start the second half of the experiment.'
],
show_clickable_nav: true,
on_start: function() {
jsPsych.pluginAPI.clearAllTimeouts();
},
};
var video_instruction_linear = {
type: jsPsychVideoKeyboardResponse,
prompt: "Reminder: Hold <b>Ctrl</b> on your keyboard to draw. <P> When the video has finished, hit <b>Enter</b> to start the task.",
stimulus: [
'Linear_final.mp4'
],
width: window.innerWidth,
height: window.innerHeight,
// choices: "Enter",
// trial_ends_after_video: true,
// controls: true,
response_allowed_while_playing: false,
};
var video_instruction_diverse = {
type: jsPsychVideoKeyboardResponse,
prompt: "Reminder: Hold <b>Ctrl</b> on your keyboard to draw. <P> When the video has finished, hit <b>Enter</b> to start the task.",
stimulus: [
'Diverse_final.mp4'
],
width: window.innerWidth,
height: window.innerHeight,
// choices: "Enter",
// trial_ends_after_video: true,
// controls: true,
response_allowed_while_playing: false,
};
async function createExperiment(){
const condition = await jsPsychPipe.getCondition(expID);
//linear condition 'if'
if(condition == 0) {
var Venice1_counter = -1;
var Venice1_task = {
type: jsPsychSketchpad,
prompt: function(){
Venice1_counter +=1;
return Venice1_prompt_linear[Venice1_counter]
},
prompt_location:'abovecanvas',
background_image: Maze_Linear,
key_to_draw: 'Control',
finished_button_label: 'Continue',
canvas_width: 1080,
canvas_height: 750,
canvas_border_width: 3,
save_strokes: false,
show_clear_button: false,
on_start: function() {
let_counter += 1;
jsPsych.pluginAPI.clearAllTimeouts();
},
on_finish: function(data){
const filename = `${subject_id}_${jsPsych.getProgress().current_trial_global}_image.png`;
jsPsychPipe.saveBase64Data(expID, filename, data.png);
// delete the base64 data to save space. store the filename instead.
data.png = filename;
},
};
var let_counter = -1;
var let_set_task = {
type: jsPsychSurveyHtmlForm,
preamble: function(){
return shuffled_let_set[let_counter]
},
autofocus: 'test-resp-box',
button_label: "Enter",
timeline: [
{html: '<p> <input name="let_linear" type="text" id="test-resp-box" /></p>',},
],
sample: {
type: 'fixed-repetitions',
size: 25
},
}
var let_set_procedures = {
timeline: [Venice1_task, let_set_task],
repetitions: let_set.length,
on_start: function() {
jsPsych.pluginAPI.setTimeout(function() {
jsPsych.endCurrentTimeline();
jsPsych.finishTrial({Response: "timeout"});
}, tr_duration);
}
}
var Venice2_counter = -1;
var Venice2_task = {
type: jsPsychSketchpad,
prompt: function(){
Venice2_counter +=1;
return Venice1_prompt_linear[Venice2_counter]
},
prompt_location:'abovecanvas',
background_image: Maze_Linear,
key_to_draw: 'Control',
finished_button_label: 'Continue',
canvas_width: 1080,
canvas_height: 750,
canvas_border_width: 3,
save_strokes: false,
show_clear_button: false,
on_start: function() {
jsPsych.pluginAPI.clearAllTimeouts();
},
on_finish: function(data){
const filename = `${subject_id}_${jsPsych.getProgress().current_trial_global}_image.png`;
jsPsychPipe.saveBase64Data(expID, filename, data.png);
// delete the base64 data to save space. store the filename instead.
data.png = filename;
},
};
var CRAP_counter = -1;
var CRAP_set_task = {
type: jsPsychSurveyHtmlForm,
preamble: function(){
CRAP_counter += 1;
return shuffled_CRAP_set[CRAP_counter]},
html:
'<p> <input name="CRAP_linear" type="text" id="test-resp-box" style="width:200px;height:50px;" /></p>',
autofocus: 'test-resp-box',
button_label: "Enter",
on_start: function() {
jsPsych.pluginAPI.clearAllTimeouts();
jsPsych.pluginAPI.setTimeout(function() {
jsPsych.finishTrial({Response: "timeout"});
}, tr_duration);
},
};
var CRAP_procedures = {
timeline: [Venice2_task, CRAP_set_task],
repetitions: CRAP_set.length,
}
// Use the randomization plugin to randomly choose which function to push first
var functionOrder = jsPsych.randomization.shuffle([let_set_procedures, CRAP_procedures]);
// Push the functions into the timeline in the randomly determined order
if(functionOrder[0] == let_set_procedures){
var let_set_instruction_linear1 = {
type: jsPsychInstructions,
pages: [
'<p style="font-size:32px;font-weight:bold;">Instructions<p> ' +
'<p style="class=positivefeedback;font-size:24px">'+
'In this task, you will see the first two letters of possible words. For each pair of letters,' +
' you will have <b>30 seconds</b> to type in as many English words as you can that begin with those letters. ' +
'For example, for <b>lo</b>, you can write down words such as love, low, lobster, lord,' +
' locomotion, and so on.<p>' +
'<p style="font-size:24px;">You <b>cannot</b> use proper nouns, such as names of places or people (e. g. London, Lora). You can' +
' be specific in your responses, but do not waste your time by adding different suffixes. For example, '+
'love, lover, lovely and loved will be counted just once. Keep in mind that wrong words do not ' +
'have negative points; so, if you doubt whether a word is acceptable, just type it in, hit Enter to be saved instantly, and continue ' +
'searching for more words.',
'<p style="font-size:24px;">Before each trial, you will be shown the following map in which you need to deliver some items from the starting points ' +
'(the red dots on the map) to a location. To do this, simply draw five lines, one by one, from the red dots to the location that will be mentioned above the map;'+
' To draw a line hold <b>Ctrl</b> button on your keyboard and move your mouse cursor. ' +
'You should draw the lines oonly through the roads and without crossing over the bulidings, and then click on the <b>continue</b> button ' +
'to see the next trial.'+
' Do not rush in delivering the items as your 30 seconds time to complete a trial will begin only after ' +
'pushing the Continue button. You will see a video as an example of how to deliver the items.' + '<br>' +
'<img src="Maze_Map_Linear.png"></img>'
],
show_clickable_nav: true
};
timeline.push(let_set_instruction_linear1)
timeline.push(video_instruction_linear);
timeline.push(functionOrder[0]);
timeline.push(task1_done);
var CRAP_instruction_linear2 = {
type: jsPsychInstructions,
pages: [
'<p style="font-size:32px;font-weight:bold;">Instructions<p> ' +
'<p style="class=positivefeedback;font-size:24px">'+
'In this task, you will see three words and your job is to find the fourth word that makes a common'+
' two-word phrase with each of them. For example, if you saw “aid rubber wagon”, then the correct'
+' fourth word that makes a common two-word phrase with each of them is “band” — as in band-aid, rubber'+
' band, and bandwagon. Another example is “cream skate water”. What word makes a common two-word '+
'phrase with each of them? It is ice — as in, ice cream, ice skate, and ice water. '+
'<p style="class=positivefeedback;font-size:24px">'+
'For each set of three words, you will have up to <b>30 seconds</b> to come up with your solution.'+
' Please type your solution and hit Enter right away.',
'<p style="font-size:24px;">Like the previous task, before each trial, you will be shown the following map'+
' in which you need to deliver some items from the starting points ' +
'(the red dots on the map) to a location. To do this, simply draw five lines, one by one,'+
' from the red dots to the location that will be mentioned above the map;'+
' To draw a line hold <b>Ctrl</b> button on your keyboard and move your mouse cursor. ' +
'You should draw the lines only through the roads and without crossing over the bulidings,'+
' and then click on the <b>Continue</b> button to see the next trial.'+
' Do not rush in delivering the items as your 30 seconds time to complete a trial will begin only after ' +
'pushing the Continue button.' + '<br>' +
'<img src="Maze_Map_Linear.png"></img>'
],
show_clickable_nav: true
};
timeline.push(CRAP_instruction_linear2)
timeline.push(functionOrder[1]);
}
if(functionOrder[0] == CRAP_procedures){
var CRAP_instruction_linear1 = {
type: jsPsychInstructions,
pages: [
'<p style="font-size:32px;font-weight:bold;">Instructions<p> ' +
'<p style="class=positivefeedback;font-size:24px">'+
'In this task, you will see three words and your job is to find the fourth word that makes a common'+
' two-word phrase with each of them. For example, if you saw “aid rubber wagon”, then the correct'
+' fourth word that makes a common two-word phrase with each of them is “band” — as in band-aid, rubber'+
' band, and bandwagon. Another example is “cream skate water”. What word makes a common two-word '+
'phrase with each of them? It is ice — as in, ice cream, ice skate, and ice water. '+
'<p style="class=positivefeedback;font-size:24px">'+
'For each set of three words, you will have up to <b>30 seconds</b> to come up with your solution.'+
' Please type your solution and hit Enter right away.',
'<p style="font-size:24px;">Before each trial, you will be shown the following map'+
' in which you need to deliver some items from the starting points ' +
'(the red dots on the map) to a location. To do this, simply draw five lines, one by one,'+
' from the red dots to the location that will be mentioned above the map;'+
' To draw a line hold <b>Ctrl</b> button on your keyboard and move your mouse cursor. ' +
'You should draw the lines only through the roads and without crossing over the bulidings,'+
' and then click on the <b>Continue</b> button to see the next trial.'+
' Do not rush in delivering the items as your 30 seconds time to complete a trial will begin only after ' +
'pushing the Continue button. You will see a video as an example of how to deliver the items.' + '<br>' +
'<img src="Maze_Map_Linear.png"></img>'
],
show_clickable_nav: true
};
timeline.push(CRAP_instruction_linear1)
timeline.push(video_instruction_linear);
timeline.push(functionOrder[0]);
timeline.push(task1_done);
var let_set_instruction_linear2 = {
type: jsPsychInstructions,
pages: [
'<p style="font-size:32px;font-weight:bold;">Instructions<p> ' +
'<p style="class=positivefeedback;font-size:24px">'+
'In this task, you will see the first two letters of possible words. For each pair of letters,' +
' you will have <b>30 seconds</b> to type in as many English words as you can that begin with those letters. ' +
'For example, for <b>lo</b>, you can write down words such as love, low, lobster, lord,' +
' locomotion, and so on.<p>' +
'<p style="font-size:24px;">You <b>cannot</b> use proper nouns, such as names of places or people (e. g. London, Lora). You can' +
' be specific in your responses, but do not waste your time by adding different suffixes. For example, '+
'love, lover, lovely and loved will be counted just once. Keep in mind that wrong words do not ' +
'have negative points; so, if you doubt whether a word is acceptable, just type it in, hit Enter to be saved instantly, and continue ' +
'searching for more words.',
'<p style="font-size:24px;">Like the previous task, before each trial, you will be shown the following map in which you need to deliver some items from the starting points ' +
'(the red dots on the map) to a location. To do this, simply draw five lines, one by one, from the red dots to the location that will be mentioned above the map;'+
' To draw a line hold <b>Ctrl</b> button on your keyboard and move your mouse cursor. ' +
'You should draw the lines through the roads and without crossing over the bulidings, and then click on the <b>continue</b> button ' +
'to see the next trial.'+
' Do not rush in delivering the items as your 30 seconds time to complete a trial will begin only after ' +
'pushing the Continue button.' + '<br>' +
'<img src="Maze_Map_Linear.png"></img>'
],
show_clickable_nav: true
};
timeline.push(let_set_instruction_linear2);
timeline.push(functionOrder[1]);
}
};
//diverse condition 'if'
if(condition == 1) {
var Venice1_counter = -1;
var Venice1_task = {
type: jsPsychSketchpad,
prompt: function(){
Venice1_counter +=1;
return Venice1_prompt_diverse[Venice1_counter]
},
prompt_location:'abovecanvas',
background_image: Maze_Diverse,
key_to_draw: 'Control',
finished_button_label: 'Continue',
canvas_width: 1080,
canvas_height: 750,
canvas_border_width: 3,
save_strokes: false,
show_clear_button: false,
on_start: function() {
let_counter += 1;
jsPsych.pluginAPI.clearAllTimeouts();
},
on_finish: function(data){
const filename = `${subject_id}_${jsPsych.getProgress().current_trial_global}_image.png`;
jsPsychPipe.saveBase64Data(expID, filename, data.png);
// delete the base64 data to save space. store the filename instead.
data.png = filename;
},
};
var let_counter = -1;
var let_set_task = {
type: jsPsychSurveyHtmlForm,
preamble: function(){
return shuffled_let_set[let_counter]
},
autofocus: 'test-resp-box',
button_label: "Enter",
timeline: [
{html: '<p> <input name="let_diverse" type="text" id="test-resp-box" /></p>',},
],
sample: {
type: 'fixed-repetitions',
size: 25
},
}
var let_set_procedures = {
timeline: [Venice1_task, let_set_task],
repetitions: let_set.length,
on_start: function() {
jsPsych.pluginAPI.setTimeout(function() {
jsPsych.endCurrentTimeline();
jsPsych.finishTrial({Response: "timeout"});
}, tr_duration);
}
}
var Venice2_counter = -1;
var Venice2_task = {
type: jsPsychSketchpad,
prompt: function(){
Venice2_counter +=1;
return Venice1_prompt_diverse[Venice2_counter]
},
prompt_location:'abovecanvas',
background_image: Maze_Diverse,
key_to_draw: 'Control',
finished_button_label: 'Continue',
canvas_width: 1080,
canvas_height: 750,
canvas_border_width: 3,
save_strokes: false,
show_clear_button: false,
on_start: function() {
jsPsych.pluginAPI.clearAllTimeouts();
},
on_finish: function(data){
const filename = `${subject_id}_${jsPsych.getProgress().current_trial_global}_image.png`;
jsPsychPipe.saveBase64Data(expID, filename, data.png);
// delete the base64 data to save space. store the filename instead.
data.png = filename;
},
};
var CRAP_counter = -1;
var CRAP_set_task = {
type: jsPsychSurveyHtmlForm,
preamble: function(){
CRAP_counter += 1;
return shuffled_CRAP_set[CRAP_counter]},
html:
'<p> <input name="CRAP_diverse" type="text" id="test-resp-box" style="width:200px;height:50px;" /></p>',
autofocus: 'test-resp-box',
button_label: "Enter",
on_start: function() {
jsPsych.pluginAPI.clearAllTimeouts();
jsPsych.pluginAPI.setTimeout(function() {
jsPsych.finishTrial({Response: "timeout"});
}, tr_duration);
},
};
var CRAP_procedures = {
timeline: [Venice2_task, CRAP_set_task],
repetitions: CRAP_set.length,
}
// Use the randomization plugin to randomly choose which function to push first
var functionOrder = jsPsych.randomization.shuffle([let_set_procedures, CRAP_procedures]);
// Push the functions into the timeline in the randomly determined order
if(functionOrder[0] == let_set_procedures){
var let_set_instruction_diverse1 = {
type: jsPsychInstructions,
pages: [
'<p style="font-size:32px;font-weight:bold;">Instructions<p> ' +
'<p style="class=positivefeedback;font-size:24px">'+
'In this task, you will see the first two letters of possible words. For each pair of letters,' +
' you will have <b>30 seconds</b> to type in as many English words as you can that begin with those letters. ' +
'For example, for <b>lo</b>, you can write down words such as love, low, lobster, lord,' +
' locomotion, and so on.<p>' +
'<p style="font-size:24px;">You <b>cannot</b> use proper nouns, such as names of places or people (e. g. London, Lora). You can' +
' be specific in your responses, but do not waste your time by adding different suffixes. For example, '+
'love, lover, lovely and loved will be counted just once. Keep in mind that wrong words do not ' +
'have negative points; so, if you doubt whether a word is acceptable, just type it in, hit Enter to be saved instantly, and continue ' +
'searching for more words.',
'<p style="font-size:24px;">Before each trial, you will be shown the following map in which you need to deliver some items from the starting point ' +
'(the red dot on the map) to different locations. To do this, simply draw five lines, one by one,'+
' from the red dot to the locations that will be mentioned above the map;'+
' To draw a line hold <b>Ctrl</b> button on your keyboard and move your mouse cursor. ' +
'You should draw the lines only through the roads and without crossing over the bulidings, and then click on the <b>Continue</b> button ' +
'to see the next trial. Do not rush in delivering the items as your 30 seconds time to complete a trial will begin only after ' +
'pushing the Continue button. You will see a video as an example of how to deliver the items.' + '<br>' +
'<img src="Maze_Map_Diverse.png"></img>'
],
show_clickable_nav: true
};
timeline.push(let_set_instruction_diverse1);
timeline.push(video_instruction_diverse);
timeline.push(functionOrder[0]);
timeline.push(task1_done);
var CRAP_instruction_diverse2 = {
type: jsPsychInstructions,
pages: [
'<p style="font-size:32px;font-weight:bold;">Instructions<p> ' +
'<p style="class=positivefeedback;font-size:24px">'+
'In this task, you will see three words and your job is to find the fourth word that makes a common'+
' two-word phrase with each of them. For example, if you saw “aid rubber wagon”, then the correct'
+' fourth word that makes a common two-word phrase with each of them is “band” — as in band-aid, rubber'+
' band, and bandwagon. Another example is “cream skate water”. What word makes a common two-word '+
'phrase with each of them? It is ice — as in, ice cream, ice skate, and ice water. '+
'<p style="class=positivefeedback;font-size:24px">'+
'For each set of three words, you will have up to <b>30 seconds</b> to come up with your solution.'+
' Please type your solution and hit Enter right away.',
'<p style="font-size:24px;">Like the previous task, before each trial, you will be shown the following map'+
' in which you need to deliver some items from the starting point ' +
'(the red dot on the map) to different locations. To do this, simply draw five lines, one by one,'+
' from the red dot to the locations that will be mentioned above the map;'+
' To draw a line hold <b>Ctrl</b> button on your keyboard and move your mouse cursor. ' +
'You should draw the lines only through the roads and without crossing over the bulidings,'+
' and then click on the <b>Continue</b> button to see the next trial. Do not rush in'+
' delivering the items as your 30 seconds time to complete a trial will begin only after ' +
'pushing the Continue button.' + '<br>' +
'<img src="Maze_Map_Diverse.png"></img>'
],
show_clickable_nav: true
};
timeline.push(CRAP_instruction_diverse2);
timeline.push(functionOrder[1]);
}
if(functionOrder[0] == CRAP_procedures){
var CRAP_instruction_diverse1 = {
type: jsPsychInstructions,
pages: [
'<p style="font-size:32px;font-weight:bold;">Instructions<p> ' +
'<p style="class=positivefeedback;font-size:24px">'+
'In this task, you will see three words and your job is to find the fourth word that makes a common'+
' two-word phrase with each of them. For example, if you saw “aid rubber wagon”, then the correct'
+' fourth word that makes a common two-word phrase with each of them is “band” — as in band-aid, rubber'+
' band, and bandwagon. Another example is “cream skate water”. What word makes a common two-word '+
'phrase with each of them? It is ice — as in, ice cream, ice skate, and ice water. '+
'<p style="class=positivefeedback;font-size:24px">'+
'For each set of three words, you will have up to <b>30 seconds</b> to come up with your solution.'+
' Please type your solution and hit Enter right away.',
'<p style="font-size:24px;">Before each trial, you will be shown the following map'+
' in which you need to deliver some items from the starting point ' +
'(the red dot on the map) to different locations. To do this, simply draw five lines, one by one,'+
' from the red dot to the locations that will be mentioned above the map;'+
' To draw a line hold <b>Ctrl</b> button on your keyboard and move your mouse cursor. ' +
'You should draw the lines only through the roads and without crossing over the bulidings,'+
' and then click on the <b>Continue</b> button to see the next trial. Do not rush in'+
' delivering the items as your 30 seconds time to complete a trial will begin only after ' +
'pushing the Continue button. You will see a video as an example of how to deliver the items.' + '<br>' +
'<img src="Maze_Map_Diverse.png"></img>'
],
show_clickable_nav: true
};
timeline.push(CRAP_instruction_diverse1);
timeline.push(video_instruction_diverse);
timeline.push(functionOrder[0]);
timeline.push(task1_done);
var let_set_instruction_diverse2 = {
type: jsPsychInstructions,
pages: [
'<p style="font-size:32px;font-weight:bold;">Instructions<p> ' +
'<p style="class=positivefeedback;font-size:24px">'+
'In this task, you will see the first two letters of possible words. For each pair of letters,' +
' you will have <b>30 seconds</b> to type in as many English words as you can that begin with those letters. ' +
'For example, for <b>lo</b>, you can write down words such as love, low, lobster, lord,' +
' locomotion, and so on.<p>' +
'<p style="font-size:24px;">You <b>cannot</b> use proper nouns, such as names of places or people (e. g. London, Lora). You can' +
' be specific in your responses, but do not waste your time by adding different suffixes. For example, '+
'love, lover, lovely and loved will be counted just once. Keep in mind that wrong words do not ' +
'have negative points; so, if you doubt whether a word is acceptable, just type it in, hit Enter to be saved instantly, and continue ' +
'searching for more words.',
'<p style="font-size:24px;">Like the previous task, before each trial, you will be shown the following map in which you need to deliver some items from the starting point ' +
'(the red dot on the map) to different locations. To do this, simply draw five lines, one by one,'+
' from the red dot to the locations that will be mentioned above the map;'+
' To draw a line hold <b>Ctrl</b> button on your keyboard and move your mouse cursor. ' +
'You should draw the lines only through the roads and without crossing over the bulidings, and then click on the <b>Continue</b> button ' +
'to see the next trial. Do not rush in delivering the items as your 30 seconds time to complete a trial will begin only after ' +
'pushing the Continue button.' + '<br>' +
'<img src="Maze_Map_Diverse.png"></img>'
],
show_clickable_nav: true
};
timeline.push(let_set_instruction_diverse2);
timeline.push(functionOrder[1]);
}
};
// After the main two tasks message
var tasks_finished = {
type: jsPsychInstructions,
pages: [
'<p style="font-size:32px;font-weight:bold;">End of Task 2<p> ' +
'<p style="class=positivefeedback;font-size:24px">'+
'Great! The experiment is almost done! Next, you will see a list of names. Some of them are authors of books or novels, and some are not.'+
' Please put a check mark next to the names that you know <b>for sure</b> are authors. There is a penalty '+
'for guessing, so you should check only those names about which you are absolutely certain.'
],
show_clickable_nav: true,
on_start: function() {
jsPsych.pluginAPI.clearAllTimeouts();
},
};
timeline.push(tasks_finished);
//Author Recognition Test
var ART = {
type: jsPsychSurvey,
pages:
[
[
{
type: 'multi-select',
prompt: "Which of these names are authors? Select all that apply.",
options: [
'Patrick Banville', 'Harry Coltheart', 'Virginia Woolf', 'Tony Hillerman',
'Kristen Steinke', 'Gary Curwen', 'John Landau', 'Amy R. Baskin',
'Ernest Hemingway', 'Herman Wouk', 'Toni Morrison', 'James Clavell',
'Clive Cussler', 'Geoffrey Pritchett', 'Harriet Troudeau', 'Salmon Rushdie',
'Hiroyuki Oshita', 'Ray Bradbury', 'Roswell Strong', 'Maryann Phillips',
'Kurt Vonnegut', 'Jay Peter Holmes', 'J.R.R. Tolkien', 'Scott Alexander',
'Anne McCaffrey', 'Christina Johnson', 'Margaret Atwood', 'Ayn Rand',
'Elinor Harring', 'Jean M. Auel', 'Seamus Huneven', 'Alex D. Miles',
'Sue Grafton', 'Judith Stanley', 'Harper Lee', 'Margaret Mitchell',
'Lisa Woodward', 'Gloria McCumber', 'Chris Schwartz', 'Leslie Kraus',
'David Harper Townsend', 'James Joyce', 'Walter LeMour', 'Ralph Ellison',
'Anna Tsing', 'Robert Ludlum', 'Alice Walker', 'Sidney Sheldon',
'T.C. Boyle', 'Larry Applegate', 'Elizabeth Engle', 'Brian Herbert',
'Jonathan Kellerman', 'Keith Cartwright', 'T.S. Elliot', 'Sue Hammond',
'Cameron McGrath', 'Jackie Collins', 'Marvin Benoit', 'Jared Gibbons',
'F. Scott Fitzgerald', 'Umberto Eco', 'Joyce Carol Oates', 'Michael Ondaatje',
'A.C. Kelly', 'David Ashley', 'Jessica Ann Lewis', 'Thomas Wolfe',
'Peter Flaegerty', 'Jack London', 'Nelson Demille', 'Jeremy Weissman',
'Kazuo Ishiguro', 'Seth Bakis', 'Arturo Garcia Perez', 'Willa Cather',
'Jane Smiley', 'Padraig Oseaghdha', 'S.L. Holloway', 'J.D. Salinger',
'James Patterson', 'E.B. White', 'John Irving', 'Antonia Cialdini',
'Martha Farah', 'Giles Mallon', 'Stephen Houston', 'Lisa Hong Chan',
'Craig DeLord', 'Raymond Chandler', 'Marcus Lecherou', 'Samuel Beckett',
'Nora Ephron', 'Isabel Allende', 'Valerie Cooper', 'Beatrice Dobkin',
'Ann Beattie', 'Amy Graham', 'Tom Clancy', 'Wally Lamb',
'Stewart Simon', 'Marion Coles Snow', 'Vladimir Nabokov', 'Katherine Kreutz',
'Danielle Steel', 'George Orwell', 'Pamela Lovejoy', 'James Michener',
'Dick Francis', 'Maya Angelou', 'Vikram Roy', 'William Faulkner',
'Ted Mantel', 'Bernard Malamud', 'Saul Bellow', 'Isaac Asimov',
'I.K. Nachbar', 'John Grisham', 'Stephen King', 'Lindsay Carter',
'Judith Krantz', 'Erich Fagles', 'Elizabeth May Kenyon', 'Paul Theroux',
'Thomas Pynchon', 'Walter Dorris', 'Frederick Mundow', 'Francine Preston',
'Wayne Fillback', 'Gabriel Garcia Marquez'
],
columns: 5,
name: 'Author',
}
]
],
}
timeline.push(ART);
//Collecting demographic information
var demographic_info = {
type: jsPsychSurvey,
pages: [
[
{
type: 'multi-choice',
prompt: "Are you a native English Speaker?",
options: ['Yes','No'],
name: 'Langauge',
required: true,
},
{
type: 'text',
prompt: 'Do you know a second language, besides English? If so, enter it here:',
placeholder: 'Example: Spanish',
name: '2ndLanguage'
},
{
type: 'likert',
prompt: 'Please rate your fluency in your second language:',
name: '2nd_lg_fluency',
likert_scale_min_label: 'Beginner',
likert_scale_max_label: 'Fluent',
likert_scale_values: [
{value: 1},
{value: 2},
{value: 3},
{value: 4},
{value: 5}
]
},
{
type: 'text',
prompt: 'Do you know a third language? If so, enter it here',
name: 'SecondLanguage'
},
{
type: 'likert',
prompt: 'Please rate your fluency in your third language:',
name: '3rd_lg_fluency',
likert_scale_min_label: 'Beginner',
likert_scale_max_label: 'Fluent',
likert_scale_values: [
{value: 1},
{value: 2},
{value: 3},
{value: 4},
{value: 5}
]
},
],
[
{
type: 'text',
prompt: "How old are you in years?",
name: 'age',
textbox_columns: 5,
required: true,
},
{
type: 'multi-choice',
prompt: "What is the highest level of education that you have completed?",
options: [
'Less than high school degree','High school graduate (high school diploma or equivalent including GED)',
'Some college but no degree', 'Associate degree in college (2-year)',
'Bachelors degree in college (4-year)', 'Masters degree',
'Doctoral degree (e.g., PhD, MD, JD)'
],
name: 'Highest_degree',
required: true,
},
{
type: 'multi-choice',
prompt: "What is your dominant hand?",
options:[
'Right', 'Left', 'Ambidextrous (Equally well with both hands)'
],
name: 'Handedness',
required: true,
},
],
[
{
type: 'multi-select',
prompt: 'What is your race? (choose all that apply) ',
options:[
'White', 'Spanish, Hispanic, or Latino', 'Black or African American', 'American Indian or Alaska Native',
'Asian','Native Hawaiian or Pacific Islander','Not listed or prefer not to say'
],
name: 'Race',
required: true,
},
{
type: 'multi-choice',
prompt: "Which of the following best describes your sexual orientation?",
options: [
'straight (heterosexual)','gay or lesbian (homosexual)', 'bisexual', 'queer',
'asexual', 'not listed or prefer not to respond'
],
name: 'sexual_orientation',
required: true,
},
{
type: 'multi-choice',
prompt: "Which of the following best describes your gender identity? ",
options: [
'man', 'woman', 'non-binary', 'transgender woman', 'transgender man', 'genderqueer',
'not listed', 'prefer not to respond'
],
name: 'gender',
required: true,
},
],
],
title: 'Please enter the following information',
button_label_finish: 'Submit',
};
timeline.push(demographic_info);
var final_comment = {
type: jsPsychSurvey,
pages: [
[
{
type: 'text',
prompt: "Do you have any comments on this study? If you don't have comments, just click NEXT to continue.",
name: 'final_comment',
textbox_columns: 80,
textbox_rows: 10,
},
],
],
button_label_finish: 'NEXT',
};
timeline.push(final_comment);
var Exp_Done = {
type: jsPsychHtmlKeyboardResponse,
stimulus: "Please press Enter for your results to be saved. Do not close this window; you will be informed when we receive your results."+