-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1324 lines (1231 loc) · 86.4 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>Cards</title>
<!-- online run-->
<script src="lib/vendors/jspsych-7.1.2/jspsych.js"></script>
<script src="lib/vendors/jspsych-7.1.2/plugin-html-keyboard-response.js"></script>
<script src="lib/vendors/jspsych-7.1.2/plugin-html-button-response.js"></script>
<script src="lib/vendors/jspsych-7.1.2/plugin-preload.js"></script>
<script src="lib/vendors/jspsych-7.1.2/plugin-fullscreen.js"></script>
<script src="lib/vendors/jspsych-7.1.2/plugin-instructions.js"></script>
<script src="lib/vendors/jspsych-7.1.2/plugin-survey-likert.js"></script>
<script src="lib/vendors/jspsych-7.1.2/plugin-survey-text.js"></script>
<script src="lib/vendors/jspsych-7.1.2/plugin-survey-multi-choice.js"></script>
<script src="lib/vendors/jspsych-7.1.2/plugin-survey.js"></script>
<link rel="stylesheet" href="lib/vendors/jspsych-7.1.2/jspsych.css">
<link href="./css/my_exp.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="lib/jspsych-7-pavlovia-2022.1.1.js"></script>
<!-- local run
<script src="jspsych/dist/jspsych.js"></script>
<script src="jspsych/dist/plugin-html-keyboard-response.js"></script>
<script src="jspsych/dist/plugin-html-button-response.js"></script>
<script src="jspsych/dist/plugin-preload.js"></script>
<script src="jspsych/dist/plugin-instructions.js"></script>
<script src="jspsych/dist/plugin-survey-likert.js"></script>
<script src="jspsych/dist/plugin-survey-text.js"></script>
<script src="jspsych/dist/plugin-survey-multi-choice.js"></script>
<script src="jspsych/dist/plugin-survey.js"></script>
<script src="jspsych/dist/plugin-fullscreen.js"></script>
<script src="jspsych/dist/plugin-html-slider-response.js"></script>
<link href="jspsych/dist/jspsych.css" rel="stylesheet" type="text/css" />
<link href="css/my_exp.css" rel="stylesheet" type="text/css"/>-->
</head>
<body>
<script>
var jsPsych = initJsPsych({
on_finish: function () {
download_csv(jsPsych.data.get().csv());
}
});
/*this defines the css properties according to the window_screen_size*/
var root = document.documentElement;
var vis_angle_px = 105
var square_width = 51.4
root.style.setProperty('--top_middle', window.screen.height / 2 + "px");
root.style.setProperty('--left_middle', window.screen.width / 2 - (square_width / 2) + "px");
root.style.setProperty('--top_a', window.screen.height / 2 - vis_angle_px + "px");
root.style.setProperty('--left_a', window.screen.width / 2 - vis_angle_px + "px");
root.style.setProperty('--top_b', window.screen.height / 2 - 2 * vis_angle_px + "px");
root.style.setProperty('--left_b', window.screen.width / 2 - 2 * vis_angle_px + "px");
root.style.setProperty('--top_c', window.screen.height / 2 - 3 * vis_angle_px + "px");
root.style.setProperty('--left_c', window.screen.width / 2 - 3 * vis_angle_px + "px");
root.style.setProperty('--top_d', window.screen.height / 2 - vis_angle_px + "px");
root.style.setProperty('--right_d', window.screen.width / 2 - vis_angle_px + "px");
root.style.setProperty('--top_e', window.screen.height / 2 - 2 * vis_angle_px + "px");
root.style.setProperty('--right_e', window.screen.width / 2 - 2 * vis_angle_px + "px");
root.style.setProperty('--top_f', window.screen.height / 2 - 3 * vis_angle_px + "px");
root.style.setProperty('--right_f', window.screen.width / 2 - 3 * vis_angle_px + "px");
root.style.setProperty('--bottom_g', window.screen.height / 2 - vis_angle_px + "px");
root.style.setProperty('--right_g', window.screen.width / 2 - vis_angle_px + "px");
root.style.setProperty('--bottom_h', window.screen.height / 2 - 2 * vis_angle_px + "px");
root.style.setProperty('--right_h', window.screen.width / 2 - 2 * vis_angle_px + "px");
root.style.setProperty('--bottom_i', window.screen.height / 2 - 3 * vis_angle_px + "px");
root.style.setProperty('--right_i', window.screen.width / 2 - 3 * vis_angle_px + "px");
root.style.setProperty('--bottom_j', window.screen.height / 2 - vis_angle_px + "px");
root.style.setProperty('--left_j', window.screen.width / 2 - vis_angle_px + "px");
root.style.setProperty('--bottom_k', window.screen.height / 2 - 2 * vis_angle_px + "px");
root.style.setProperty('--left_k', window.screen.width / 2 - 2 * vis_angle_px + "px");
root.style.setProperty('--bottom_l', window.screen.height / 2 - 3 * vis_angle_px + "px");
root.style.setProperty('--left_l', window.screen.width / 2 - 3 * vis_angle_px + "px");
root.style.setProperty('--upper1', window.screen.height / 2 - 3 * vis_angle_px + "px");
root.style.setProperty('--upper2', window.screen.height / 2 - 2 * vis_angle_px + "px");
root.style.setProperty('--upper3', window.screen.height / 2 - vis_angle_px + "px");
root.style.setProperty('--lower1', window.screen.height / 2 - 3 * vis_angle_px + "px");
root.style.setProperty('--lower2', window.screen.height / 2 - 2 * vis_angle_px + "px");
root.style.setProperty('--lower3', window.screen.height / 2 - vis_angle_px + "px");
//---------------------------------------------------------------------------------------------
root.style.setProperty('--left_card', window.screen.width / 2 - 2 * vis_angle_px + "px");
root.style.setProperty('--right_card', window.screen.width / 2 - 2 * vis_angle_px + "px");
root.style.setProperty('--top_card', window.screen.height / 2 - 90 + "px");
root.style.setProperty('--top_reward', window.screen.height / 2 + "px");
root.style.setProperty('--left_reward', window.screen.width / 2 + "px");
/*----------------------------------------------------
Variabels for card game
------------------------------------------------------*/
var instructions_images = ['images/group_shapes.jpg', 'images/reward_example.jpg','images/no_reward_example.jpg']
var practice_deck_images = ['images/practice/1.jpg','images/practice/2.jpg','images/practice/3.jpg','images/practice/4.jpg','images/practice/5.jpg','images/practice/6.jpg','images/practice/7.jpg','images/practice/8.jpg','images/practice/9.jpg','images/practice/10.jpg' ]
var test_deck_images = ['images/test/1.jpg', 'images/test/2.jpg', 'images/test/3.jpg', 'images/test/4.jpg', 'images/test/5.jpg','images/test/6.jpg',
'images/test/7.jpg', 'images/test/8.jpg', 'images/test/9.jpg', 'images/test/10.jpg', 'images/test/11.jpg', 'images/test/12.jpg', 'images/test/13.jpg',
'images/test/14.jpg', 'images/test/15.jpg', 'images/test/16.jpg','images/test/17.jpg', 'images/test/18.jpg', 'images/test/19.jpg', 'images/test/20.jpg', 'images/test/21.jpg',
'images/test/22.jpg', 'images/test/23.jpg', 'images/test/24.jpg', 'images/test/25.jpg', 'images/test/26.jpg', 'images/test/27.jpg', 'images/test/28.jpg',
'images/test/29.jpg', 'images/test/30.jpg', 'images/test/31.jpg', 'images/test/32.jpg', 'images/test/33.jpg', 'images/test/34.jpg', 'images/test/35.jpg', 'images/test/36.jpg',
'images/test/37.jpg', 'images/test/38.jpg', 'images/test/39.jpg', 'images/test/40.jpg']
var reward_images = ['images/zero_coins.png', 'images/won1-no-back1.png']
var fixation = '<div class="fixation">+</div>'
var FB_matrix = [0.4, 0.6, 0.4, 0.6];
var current_cards_practice_trial = 0;
var current_cards_exp_trial = 0;
var block = 0;
var blocks = 10;
var draw_cards;
var drawn_cards;
var left_card;
var right_card;
var selected;
var reward;
var rewards_for_block = 0;
/*----------------------------------------------------
Variabels for squares game
------------------------------------------------------*/
/*randomly assigning the mapping of the response-keys to be ks or sk */ //cr: what does it mean? ks? sk?
mapping = jsPsych.randomization.sampleWithoutReplacement(['sk', 'ks'], 1)[0];
/* getting the images to display */
var change_detection_images = ['images/squares/black.png', 'images/squares/blue.png', 'images/squares/brown.png', 'images/squares/cyan.png', 'images/squares/green.png', 'images/squares/magenta.png', 'images/squares/orange.png', 'images/squares/red.png', 'images/squares/yellow.png']
/* setting the locations to randomize from */
var locations = ["<img class='a' src=", "<img class='b' src=", "<img class='c' src=", "<img class='d' src=", "<img class='e' src=", "<img class='f' src=", "<img class='g' src=", "<img class='h' src=", "<img class='i' src=", "<img class='j' src=", "<img class='k' src=", "<img class='l' src=",]
var locations_setsize1 = ["<img class='upper1' src=", "<img class='upper2' src=", "<img class='upper3' src=", "<img class='lower1' src=", "<img class='lower2' src=", "<img class='lower3' src="]
/*----------------------------------------------------
Variabels for icar
------------------------------------------------------*/
var icar_images = ['images/icar/1.jpg', 'images/icar/2.jpg','images/icar/3.jpg','images/icar/4.jpg','images/icar/5.jpg','images/icar/6.jpg','images/icar/7.jpg','images/icar/8.jpg']
var preload = {
type: jsPsychPreload,
images: [practice_deck_images, test_deck_images, reward_images, instructions_images,change_detection_images]
};
/*----------------------------------------------------
Functions for card game
------------------------------------------------------*/
function draw_show_cards(current_trial,deck) {
if (current_trial%2==0){
drawn_cards=jsPsych.randomization.shuffle([deck[0],deck[1]])
}
else{
drawn_cards=jsPsych.randomization.shuffle([deck[2],deck[3]])
}
left_card = drawn_cards[0];
right_card = drawn_cards[1];
left_with_tag = "<img class='card_left' src='" + left_card + "'>"
right_with_tag = "<img class='card_right' src='" + right_card + "'>"
return left_with_tag + right_with_tag + fixation;
}
function show_choice() {
last_choice = jsPsych.data.getLastTrialData().values()[0].response
if (last_choice == 's') {
selected = 0
card_to_show = "<img class='card_left' src='" + left_card + "'>"
}
else if (last_choice == 'k') {
selected = 1
card_to_show = "<img class='card_right' src='" + right_card + "'>"
}
else if (last_choice == null) {
selected = null
reward = 0
return '<div style="font-size:40px;">Please respond faster!</div>'
}
else {
selected = -1
reward = 0
return '<div style="font-size:40px;">wrong key!</div><br><br><div style="font-size:20px;">Please use the ‘K’ and ‘S’ keys to select the left or right card respectively. </div>'
}
return card_to_show + fixation
}
function show_reward(current_trial_num) {
key_selected = jsPsych.data.getLastTrialData().values()[0].key_selected
if (key_selected == 0) {
card_to_show = "<img class='card_left' src='" + left_card + "'>"
}
else if (key_selected == 1) {
card_to_show = "<img class='card_right' src='" + right_card + "'>"
}
else if (key_selected == null) {
return '<div style="font-size:40px;">Please respond faster!</div>'
}
else {
return '<div style="font-size:40px;">wrong key!</div><br><br><div style="font-size:20px;">Please use the ‘K’ and ‘S’ keys to select the left or right card respectively. </div>'
}
card_selected = jsPsych.data.getLastTrialData().values()[0].card_selected
prob_reward = FB_matrix[card_selected];
prob_unreward = 1 - prob_reward;
reward = jsPsych.randomization.sampleWithReplacement([0, 1], 1, [prob_unreward, prob_reward])[0];
reward_to_show = "<img class=reward src='" + reward_images[reward] + "'>"
return card_to_show + reward_to_show
}
function images_for_block_start() {
images = test_deck_images.slice(block * 4, block * 4 + 4)
return images
}
/*----------------------------------------------------
Functions for squares game
------------------------------------------------------*/
//This function decides on a random location for the test square
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
//This function picks random squares to show
function get_squares(images, number_of_images) {
return jsPsych.randomization.sampleWithoutReplacement(change_detection_images, number_of_images)
}
/*This function picks the locations in which the squares will be shown
It also takes care of equally randomizing the different quadrants */
function get_locations(locations_arr, number_of_images, locations_arr1) {
random_locations = [];
if (number_of_images == 1) {
return jsPsych.randomization.sampleWithoutReplacement(locations_arr1, 1)
}
for (var i = 0; i < 4; i++) {
random_2_locations = jsPsych.randomization.sampleWithoutReplacement(locations_arr.slice(i * 3, i * 3 + 3), 2)
random_locations.push(random_2_locations[0])
if (number_of_images > 4) {
random_locations.push(random_2_locations[1])
}
}
return random_locations
}
/*This function combines the squares and the locations that were randomly chosen */
function generate_random_squares(condition) {
number_of_images = parseInt(condition[0])
change_detection_images = jsPsych.randomization.shuffle(change_detection_images)
current_locations = get_locations(locations, number_of_images, locations_setsize1)
squares = '';
for (index = 0; index < number_of_images; index++) {
squares += current_locations[index] + change_detection_images[index] + ">"
}
return squares + fixation;
}
var condition_squares_exp = jsPsych.randomization.sampleWithoutReplacement(['4same', '4diff', '8same', '8diff'], 1)[0]
/*----------------------------------------------------
Card game starts
------------------------------------------------------*/
/*full screen */
var enter_fullscreen = {
type: jsPsychFullscreen,
message: '<p>This experiment will be in fullscreen mode. <br> <b>Please make sure your browser is on 100% zoom, and your keyboard is on the English language.</b></p>',
fullscreen_mode: true
}
var consent = {
type: jsPsychHtmlButtonResponse,
choices: ["I have read, understand, and agree to the above"],
stimulus:
"<p><b>Consent to participate in a research:</b></p>"+
"<p><u>A study of reward learning and information processing</u></p>"+
"<p>A research team led by Dr. Nitzan Shahar at Tel-Aviv University and Dr. Liron Rozenkrantz at Bar-Ilan University is running this study, via Prolific, a web-based research study platform.</p>"+
"<p><strong>Purpose</strong></p>"+
"<p>Previous studies find that some types of reward learning and information processing may differ in individuals with and without a diagnosis of autism, but the mechanisms underlying these differences are not yet known. In order to test that, we will investigate the processing of information and rewards across individuals with and without an autism diagnosis.</p>"+
"<p><strong>Procedures</strong></p>"+
"<p>In this online study, you will be asked to complete an online task and self-report questionnaires about your daily behaviors, experiences, and habits. In the task, you will be asked to choose shapes to gain monetary rewards. In each trial, the computer offers two for participants to choose from. Each shape leads to a reward according to a to be learned probability. You will need to do your best to gain as much coins as possible. Bonus payment will be added based on your performance.</p>"+
"<p>During the experiment, you will be asked to complete questionnaires and surveys, as described above. This should take about 30 minutes for the task and 30 minutes for the surveys.</p>"+
"<p><strong>Participation</strong></p>"+
"<p>You are free to choose whether to be in this study. If you choose to participate, it’s okay to stop and discontinue the study at any point during the session, although we ask that you complete each section of the study (the task and the questionnaires) in one seating.</p>"+
"<p><strong>Will there be any risk or discomfort to me?</strong></p>"+
"<p>There is no risk involved in this study. You will complete several questionnaires and surveys in an online manner. You will have time for breaks whenever you feel tired. If you feel any discomfort during the study, you can stop the activity at any time.</p>"+
"<p><strong>Will I benefit by being in this research?</strong></p>"+
"<p>This study’s goal is to learn about reward learning and information processing in people with and without a diagnosis of autism. You will not benefit directly from this research; however, we hope that the results will ultimately improve our scientific understanding of information processing.</p>"+
"<p><strong>Payment</strong></p>"+
"<p>You will receive compensation for your participation. You may also receive an additional bonus based on your performance in the shapes game. There are no additional benefits anticipated for you for participation in this research study.</p>"+
"<p><strong>Data collection</strong></p>"+
"<p>During the session, your responses will be recorded. Your responses are sent securely to our lab. Data is stored securely by researchers at Tel Aviv University. However, there is always a small risk that data transmitted over the internet may be intercepted or that the security of stored data may be compromised.</p>"+
"<p><strong>Use of data</strong></p>"+
"<p>The research group led by Dr. Nitzan Shahar at Tel-Aviv University and Dr. Liron Rozenkrantz at Bar-Ilan University will have access to data collected during this session.</p>"+
"<p><strong>Publication of results</strong></p>"+
"<p>The results of the research may be presented at scientific meetings or published in scientific journals. We never publish any identifying information including birthdates or names, and we never publish your demographic data.</p>"+
"<p><strong>Researcher contact information</strong></p>"+
"<p>This study is run by Dr. Nitzan Shahar at Tel-Aviv University and Dr. Liron Rozenkrantz at Bar-Ilan University. If you have any questions or concerns about this study, or in the very unlikely event of a research-related injury, please contact Dr. Shahar at [email protected] or Dr. Rozenkrantz at [email protected].</p>"+
"<p> <b><u>Click the button below to continue</b></u></p>" }
/*----------------------------------------------------
Start instructions
------------------------------------------------------*/
var instructions_cards = {
on_start: function () {
if (document.querySelector('#cursor-toggle') != null) {
document.querySelector('#cursor-toggle').remove()
}
},
type: jsPsychInstructions,
pages: ["<p><b><u>Welcome to the shapes game</u></b></p>"
+ "<p style='text-align:left'>Your winnings in this game will earn you additional payment bonus for participating in the study."
+ " If you do not earn any extra money in the game, you will still receive <b>£5 per hour</b> for completing this session of the study."
+ " However, you can gain up to an <b>extra £1 based on winnings in the game.</b></p>"
+ "<u>Feel free to go back and forth between the screens using the keyboard left and right arrows or the buttons below.</u><br><br>"
,
"<p style='text-align:left'> We will now provide instructions regarding the game. <b>Please read them carefully.</b> <br></p>"
,
"<p style='text-align:left'>Once you finished reading the instructions, <b>we will ask you to take a quick quiz</b> to make sure you understood everything correctly.</p>",
"<p style='text-align:left'>On each step of the game, you will be presented with a choice between two shapes."
+" To select the <b>left shape</b>, press 's' on your keyboard, and to select the <b>right card</b>, press 'k'.</p>"
+ "<img class='example' src= " + instructions_images[0] + ">",
"<p style='text-align:left'>Once you made your selection, you will <b>see the <u>selected shape</u> alongside a coin outcome</b> displayed in the center of the screen. <br>The outcome can either be <b>winning a golden coin</b>, as illustrated below, or...</p>"
+"<br> <img class='reward_example' src= " + instructions_images[1] + ">",
"<p style='text-align:left'>it could be <b>not winning a coin, as presented here</b></p>"
+ "<br> <img class='reward_example' src= " + instructions_images[2] + ">",
"<b>Some shapes give golden coins more often</b> than others. <br> Your task is to <b>learn this and choose accordingly.</b> <br><br><u>These golden coins translate to your money bonus</u>. ",
"Please note that <b>each shape has its own winning chances</b>.<br><br> Learning about one shape tells you nothing about the other shapes. Finding out that one shape gives you coins often, doesn't mean the other one would not.</p>",
"In this task you will play <b>10 rounds</b> with <b>20 shape choices</b> in each round. On each round you will see a <b>total of 4 different shapes.</b>"
,"<p style='text-align:left'><u>Three important things to remember:</u><br>"
+ "1. <b>How good a shape is will not change during the round</b> - it's just that bad shapes can sometimes bring you a golden coin and vice versa."
+ "<br><br>2.<b> Only the shapes matter when you choose - </b> the location of the shape and the response key you used to select it do not influence the chances of winning a coin.<br><br>"
+ " 3. <b>Each shape has its own winning chances - </b> you can't learn about one shape from the rewards you got for the other."
+ " <br><br><u>Please do your best to earn as many coins as you can, while responding quickly as possible.</u><br><br></p>"],
show_clickable_nav: true
};
var start_instructions_test = {
on_start: function () {
if (document.querySelector('#cursor-toggle') != null)
document.querySelector('#cursor-toggle').remove()
},
type: jsPsychHtmlKeyboardResponse,
stimulus: "<p> <br><br> You will now move on to a quick quiz to make sure you understood the instructions. <b>If you will have a mistake you will need to go again through the instructions.</b> <br>Make sure you scroll down until you answer all questions. <br><br> <b> Press any key to continue</b></p>"
}
var Q1_2_options = ["2", "4", "6"];
var Q3_options = ["Click on it", "Press the LEFT or RIGHT arrow keys", "Press the `S` or `K` key with your LEFT or RIGHT hand."];
var Q4_5_6_7_options = ["True", "False"];
var Q8_options = ["The goal is to win as many coins as possible", "The goal is to answer the questions as quickly as possible"]
var Q9_options = ["True","False - what I learn about one shape does not tell me anything about the others. I can only learn whether a shape is good or not by choosing it."];
var Q10_options = ["True - the response keys are related to the winning chances", "False - you won't win more or less using RIGHT or LEFT response keys. Only the shapes are related to your chances of winning."];
var instructions_test = {
type: jsPsychSurveyMultiChoice,
questions: [
{ prompt: "How many shapes are presented on each choice?", name: 'cards_step', correct: '2', options: Q1_2_options, required: true },
{ prompt: "How many shapes in total are there in each round?", name: 'deck_size', correct: '4', options: Q1_2_options, required: true },
{ prompt: "How do you choose a shape?", name: 'choose_card', correct: 'Press the `S` or `K` key with your LEFT or RIGHT hand.', options: Q3_options, required: true },
{ prompt: "Money bonus depends on the number of golden coins I obtain", name: 'block_stakes', correct: "True", options: Q4_5_6_7_options, required: true },
{ prompt: "Some shapes are better than others.", name: 'better_cards', correct: 'True', options: Q4_5_6_7_options, required: true },
{ prompt: "How `good` or `bad` a shape is will change along the round.", name: 'value_change', correct: 'False', options: Q4_5_6_7_options, required: true },
{ prompt: "What is the goal of the game?", name: 'game_goal', correct: "The goal is to win as many coins as possible", options: Q8_options, required: true },
{ prompt: "If one shape often leads to winning coins, then the other ones are less likely to lead to winning coins.", name: 'value_independence',
correct: "False - what I learn about one shape does not tell me anything about the others. I can only learn whether a shape is good or not by choosing it.", options: Q9_options, required: true },
{ prompt: "If you use the RIGHT and not the LEFT response keys, you might win more.", name: 'location_value',
correct: "False - you won't win more or less using RIGHT or LEFT response keys. Only the shapes are related to your chances of winning.", options: Q10_options, required: true },
],
};
var if_trial = {
type: jsPsychHtmlButtonResponse,
stimulus: "<p>Sorry. You made a mistake.<br>"
+ "Let`s go back to the instructions. "
+ "Please read them carefully before submitting your answers. <br>"
+ "Thank you!",
choices: ['Back to instructions']
}
var to_repeat;
var check_answers = {
timeline: [if_trial],
conditional_function: function () {
to_repeat = false;
var responses_to_test = jsPsych.data.get().filter({ trial_type: 'survey-multi-choice' }).last(1).select('response').values[0]
for (i = 0; i < instructions_test.questions.length; i++) {
current_name = instructions_test.questions[i].name;
current_correct = instructions_test.questions[i].correct
if (current_correct != responses_to_test[current_name]) {
to_repeat = true;
return to_repeat
}
else {
to_repeat = false;
}
}
return to_repeat
}
}
/*----------------------------------------------------
Start instructions variabels
------------------------------------------------------*/
var instructions_squares = {
on_start: function(){
if (document.querySelector('#cursor-toggle') != null) {
document.querySelector('#cursor-toggle').remove()
}
},
type: jsPsychInstructions,
pages: ["We will now start the second part of the experiment, called the <b>'squares game'</b>.",
"We will now provide instructions regarding the squares game. <b>Please read them carefully.</b>",
"Feel free to <b>go back and forth between the screens using the arrows</b> (Left=previous, Right=next) or the buttons below."
, "At the end of the instructions, <b>we will ask you to complete a short quiz about them</b>, to make sure everything is well understood."
, "In this part of the experiment, you will see a plus in the middle of the screen." +
"<p> We would like you to <b>focus on the plus whenever it appears</b>.</p> " + "<img src='images/fixation.png'>",
"<p> Then, 4 or 8 colored 'memory' squares will appear on the screen. <b>You need to remember the colors and locations of all of the squares</b>.</p>" +
"<img src='images/squares/example1.png'>",
"<p> Right afterward, the 'memory' squares will disappear and instead, one 'test' square will show up in a place where one of the squares was previously displayed.</p>" +
"<p> Your goal is to <b>identify whether the new 'test' square is in the same or different color as the one previously displayed in this location</b>.</p>" +
"<p> You need to press <b>'" + mapping[0] + "'</b> if you think the color is the <b>same</b> as the color of the square previously appearing in this location.</p>" +
"<img src='images/squares/example2.png'>",
"<p> You need to press <b>'" + mapping[1] + "'</b> if you think the color is <b>different</b> than the color of the square previously appearing in this location.</p>" +
"<img src='images/squares/example3.png'>", "<p> We will now ask you to complete a short quiz to make sure that you understood the instructions."],
show_clickable_nav: true,
};
var Q1_square_options = ["2 or 4", "4 or 6", "4 or 8"];
var Q2_square_options = ["True", "False"];
var Q3_square_options = ["Click on it", "Press the LEFT or RIGHT arrow keys", "Press the ‘" + mapping[0] + "’ or ‘" + mapping[1] + "’ key."];
var Q4_square_options = ["The plus appearing in the middle of the screen", "The colors and locations of the 'memory' squares", "The color and location of the single 'test' square"];
var Q5_square_options = ["To tell if the 'test' square is in the same color as the square previously appearing in this location", "To tell if a square previously appeared in the location of the shown square"];
var instructions_test_squares = {
type: jsPsychSurveyMultiChoice,
questions: [
{ prompt: "How many squares will be initially shown?", name: 'set_size', correct: '4 or 8', options: Q1_square_options, required: true },
{ prompt: "The single square will appear after the squares will disappear ", name: 'steps', correct: 'True', options: Q2_square_options, required: true },
{ prompt: "How do you choose if a square is same or different?", name: 'choose_square', correct: "Press the ‘" + mapping[0] + "’ or ‘" + mapping[1] + "’ key.", options: Q3_square_options, required: true },
{ prompt: "What should you try to remember?", name: 'remember', correct: "The colors and locations of the 'memory' squares", options: Q4_square_options, required: true },
{ prompt: "What is your task?", name: 'task', correct: "To tell if the 'test' square is in the same color as the square previously appearing in this location", options: Q5_square_options, required: true },
],
data: { trial_name: 'test_squares' }
};
var if_trial_squares = {
type: jsPsychHtmlButtonResponse,
stimulus: "<p>Sorry. You made a mistake.<br>"
+ "Let’s go back to the instructions. "
+ "Please read them carefully before submitting your answers. <br>"
+ "Thank you!",
choices: ['Back to instructions']
}
/* the to_repeat variable defined whether the quiz is to be repeate*/
var to_repeat_squares;
var check_answers_squares = {
timeline: [if_trial_squares],
conditional_function: function () {
// get the data from the previous trial,
// and check which key was pressed
to_repeat_squares = false;
var responses_to_test_square = jsPsych.data.get().filter({ trial_type: 'survey-multi-choice' }).last(1).select('response').values[0]
for (i = 0; i < instructions_test_squares.questions.length; i++) {
current_name = instructions_test_squares.questions[i].name;
current_correct = instructions_test_squares.questions[i].correct
if (current_correct != responses_to_test_square[current_name]) {
to_repeat_squares = true;
return to_repeat_squares
}
else {
to_repeat_squares = false;
}
}
return to_repeat_squares
}
}
var instructions_squares_loop = {
timeline: [instructions_squares, instructions_test_squares, check_answers_squares],
loop_function: function () {
if (to_repeat_squares == true) {
return true;
} else {
return false;
}
}
}
/*This function downloads the data */
function download_csv(csv) {
var hiddenElement = document.createElement('a');
file_name = "task.csv"
hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(csv);
hiddenElement.target = '_blank';
hiddenElement.download = file_name;
hiddenElement.click();
}
var timeline = [];
/*init connection with pavlovia.org*/
var pavlovia_init = {
type: jsPsychPavlovia,
command: "init"
};
timeline.push(pavlovia_init);
timeline.push(enter_fullscreen)
/*----------------------------------------------------
Cards part
------------------------------------------------------*/
var start_practice_cards = {
type: jsPsychHtmlKeyboardResponse,
stimulus: '<div>We will now do a few practice trials. <br> Please be ready with your fingers on <b>"s"</b> and <b>"k".</b> <br><br> <b> Press any key to begin</b></div>',
post_trial_gap: 1000,
on_finish: function () { document.querySelector('head').insertAdjacentHTML('beforeend', '<style id="cursor-toggle"> html { cursor: none; } </style>') },
}
var fixation_cards = {
type: jsPsychHtmlKeyboardResponse,
stimulus: fixation,
choices: "NO_KEYS",
trial_duration: 900
}
var practice_cards = {
type: jsPsychHtmlKeyboardResponse,
stimulus: function () {
return draw_show_cards(current_cards_practice_trial,practice_deck_images)
},
choices: "ALL_KEYS",
trial_duration: 6000,
data: { phase: 'practice', trial_name: 'cards1', trial_num: function () { return current_cards_practice_trial } },
}
var practice_choice = {
type: jsPsychHtmlKeyboardResponse,
stimulus: show_choice,
choices: "NO_KEYS",
trial_duration: 500,
data: { phase: 'practice', trial_name: 'choice1', trial_num: function () { return current_cards_practice_trial } },
on_finish: function (data) {
data.key_selected = selected
if (selected == 0) {
data.card_selected = practice_deck_images.indexOf(left_card)
}
else if (selected == 1) {
data.card_selected = practice_deck_images.indexOf(right_card)
}
}
}
var practice_reward= {
type: jsPsychHtmlKeyboardResponse,
stimulus: function () {
return show_reward(current_cards_practice_trial)
},
choices: "NO_KEYS",
trial_duration: 750,
data: { phase: 'practice', trial_name: 'reward1', trial_num: function () { return current_cards_practice_trial } }
, on_finish: function (data) {
data.reward = reward;
current_cards_practice_trial+=1
}
}
var start_exp_cards = {
type: jsPsychHtmlKeyboardResponse,
stimulus: '<div> Good job! Practice completed. <br> <br> We will now move on to the real game. Do your best to figure out which cards are better. Good luck!<br><br> <b>Press any key to continue.</b></div>',
post_trial_gap: 1000,
}
var start_block = {
type: jsPsychHtmlKeyboardResponse,
stimulus: function () {
return '<p><b><u>Test block ' + (block + 1) + ' out of ' + (blocks) + '</u></b></p>' + '<p style="text-align: left"> You will now start a test block. Below are the four shapes that can appear in this round.</p>'
+ '<p style="text-align: left">Use the LEFT or RIGHT response keys ("s" or "k", in correspondence) to make your selection. <br> Please do your best to win as many coins as possible!<br> </p>'
+ '<p style="text-align: left"><b>Remember that:</b> <br> 1) How ‘good’ each shape is will not change along the round <br> 2) Only the shapes (not the response key that was used to select them) are important when you choose <br> 3) The chance that each shape will give you coins has nothing to do with the other shapes </p>'
+ '<p><b>Press SPACE to start</b></p>'
+ '<img class="start" src="' + images_for_block_start()[0] + '"> ' + '<img class="start" src="' + images_for_block_start()[1] + '"> ' + '<img class="start" src="' + images_for_block_start()[2]
+ '"> ' + '<img class="start" src="' + images_for_block_start()[3] + '"> '
},
choices: [" "]
, post_trial_gap: 1000,
on_finish: function () {
document.querySelector('head').insertAdjacentHTML('beforeend', '<style id="cursor-toggle"> html { cursor: none; } </style>') },
}
var exp_cards = {
type: jsPsychHtmlKeyboardResponse,
stimulus: function () {
return draw_show_cards(current_cards_exp_trial,images_for_block_start())
},
choices: "ALL_KEYS",
trial_duration: 6000,
data: { phase: 'exp', trial_name: 'cards', trial_num: function () { return current_cards_exp_trial }, },
}
var exp_choice = {
type: jsPsychHtmlKeyboardResponse,
stimulus: show_choice,
choices: "NO_KEYS",
trial_duration: 500,
data: { phase: 'exp', trial_name: 'choice', trial_num: function () { return current_cards_exp_trial },},
on_finish: function (data) {
data.key_selected = selected
if (selected == 0) {
data.card_selected = images_for_block_start().indexOf(left_card)
}
else if (selected == 1) {
data.card_selected = images_for_block_start().indexOf(right_card)
}
}
}
var exp_reward = {
type: jsPsychHtmlKeyboardResponse,
stimulus: function () {
return show_reward(current_cards_exp_trial)
},
choices: "NO_KEYS",
trial_duration: 750,
data: {
phase: 'exp', trial_name: 'reward', trial_num: function () { return current_cards_exp_trial }, block: function () { return block },
prob1 : function(){return FB_matrix[0]} ,
prob2 : function(){return FB_matrix[1]},
prob3 : function(){return FB_matrix[2]},
prob4 : function(){return FB_matrix[3]}},
on_finish: function (data) {
current_cards_exp_trial += 1;
rewards_for_block += reward;
data.reward = reward;
data.left_card = images_for_block_start().indexOf(left_card);
data.right_card = images_for_block_start().indexOf(right_card);
data.key_selected = selected
if (selected == 0) {
data.card_selected = images_for_block_start().indexOf(left_card)
}
else if (selected == 1) {
data.card_selected = images_for_block_start().indexOf(right_card)
}
}
}
var finish_block = {
type: jsPsychHtmlKeyboardResponse,
stimulus: function () {
finish_block_string = '<p><b>Good job!</b></p>' + '<p style="text-align: left"><br> Test block<b> ' + (block + 1) + ' out of ' + (blocks) + '</b> is over.'
finish_block_string += '<br>In this round, you earned <b> ' + rewards_for_block + ' coins</b>.</p>'
if ((block+1) !=blocks ) {
finish_block_string += '<p style="text-align: left"> You can stretch a little and take a short break while sitting in front of the screen, if needed.</p><p> <br><br><br><b>Press SPACE to continue</b> </p>'
}
else {
finish_block_string += ' We will now move on.</p><p> <br><br><br><b>Press SPACE to continue</b> </p>'
}
return finish_block_string
},
post_trial_gap: 1000,
choices: [" "],
on_finish: function () {
block += 1;
current_cards_exp_trial = 0;
rewards_for_block = 0;
}
}
/*----------------------------------------------------
Squares part
------------------------------------------------------*/
/*----------------------------------------------------
Start practice part
------------------------------------------------------*/
var current_squares_practice_trial = 0;
var current_locations = null; // set up a global variable
var condition_squares_practice = jsPsych.randomization.sampleWithoutReplacement(['1same', '1diff'], 1)[0] //this makes sure that the subject will have at least one set_size1 trial in practice
var start_practice_squares = {
type: jsPsychHtmlKeyboardResponse,
stimulus: "<p> We will now start some practice trials.<br> <b>The practice trials will also include some trials in which you will need to remember only one square to make sure you understood the instructions.</b> <br> You may already want to be ready with your fingers on '<b>s'</b> and <b>'k'</b>. <br><img class=keyboard src='images/keyboard.png'> <br> <u>Please try to be as accurate as possible for the experiment to succeed.</u> <br><br><b>Press any key to begin</b></u>",
post_trial_gap: 1000,
/*removes cursor from screen*/
on_finish: function () { document.querySelector('head').insertAdjacentHTML('beforeend', '<style id="cursor-toggle"> html { cursor: none; } </style>') },
}
var fixation_memory = {
type: jsPsychHtmlKeyboardResponse,
stimulus: fixation,
choices: "NO_KEYS",
trial_duration: 1000,
}
var memory_practice = {
type: jsPsychHtmlKeyboardResponse,
stimulus: function () { return generate_random_squares(condition_squares_practice) },
choices: "NO_KEYS",
trial_duration: 200,
data: {
block_type: 'practice', trial_name: 'memory', trial_num: function () { return current_squares_practice_trial },
set_size: function () {
return condition_squares_practice[0]
}
}
}
var fixation_retention = {
type: jsPsychHtmlKeyboardResponse,
stimulus: fixation,
choices: "NO_KEYS",
trial_duration: 900
}
var test_practice = {
type: jsPsychHtmlKeyboardResponse,
stimulus: function () {
rand_num = getRandomInt(number_of_images - 1)
if (condition_squares_practice[1] == 's') { /* it is the same condition */
square = current_locations[rand_num] + change_detection_images[rand_num] + ">"
}
else { /* it is different condition */
square = current_locations[rand_num] + jsPsych.randomization.sampleWithoutReplacement(change_detection_images.slice(number_of_images), 1) + ">"
}
return square + fixation
},
choices: ['s', 'k'],
trial_duration: 6000,
data: {
block_type: 'practice', trial_name: 'test', trial_num: function () { return current_squares_practice_trial },
correct_response: function () {
if (condition_squares_practice[1] == 's') { //it is same condition //cr: is it work with 'S'? should it work with capsLock? or it is case sensitive?
key_press_num = mapping[0]
}
else {
key_press_num = mapping[1]
}
return key_press_num
},
set_size: function () {
return condition_squares_practice[0]
}
},
on_finish: function (data) { //cr: im not sure if those names that start with numbers are legal
condition_squares_practice = jsPsych.randomization.sampleWithoutReplacement(['1same', '1diff', '4same', '4diff', '8same', '8diff'], 1)[0] //now everything could be
var correct = false;
if (data.correct_response == data.response) {
correct = true;
}
else if (data.response == null) {
correct = null;
}
data.accuracy = correct;
current_squares_practice_trial += 1;
}
}
var feedback_squares = {
type: jsPsychHtmlKeyboardResponse,
stimulus: function () {
feedback_text = 'incorrect'
last_trial_correct = jsPsych.data.getLastTrialData().values()[0].accuracy;
if (last_trial_correct == true) {
feedback_text = 'correct'
}
else if (last_trial_correct == null) {
feedback_text = 'Please respond faster'
}
return feedback_text
},
choices: "NO_KEYS",
trial_duration: 500
}
var if_trial_practice_squares = {
on_start: function () {
if (document.querySelector('#cursor-toggle') != null) {
document.querySelector('#cursor-toggle').remove()
}
},
type: jsPsychHtmlKeyboardResponse,
stimulus: "<p>Sorry. You made too many mistakes.<br>"
+ "Let’s do the practice session once again. <br>"
+ "<br><b>Press any key to continue</b>",
choices:"ALL_KEYS"
}
var demo_procedure_squares = {
timeline: [fixation_memory, memory_practice, fixation_retention, test_practice, feedback_squares],
repetitions: 2 //3.5sec per trial*15 =52.5sec
}
var to_repeat_practice_squares;
var check_accuracy = {
timeline: [if_trial_practice_squares],
conditional_function: function () {
/* Get the data from the previous trial,and calculate accuracy
If the participant wasn't perfect in the trials with set_size 1 - we will repeat.*/
to_repeat_practice_squares = false;
var correct_prac_square = jsPsych.data.getLastTimelineData().filter({ block_type: 'practice', trial_name: 'test', set_size: '1' }).select('accuracy').sum()
var total_prac_square = jsPsych.data.getLastTimelineData().filter({ block_type: 'practice', trial_name: 'test', set_size: '1' }).select('accuracy').count()
var prac_square_accuracy = correct_prac_square / total_prac_square;
if (prac_square_accuracy != 1) {
to_repeat_practice_squares = true;
return to_repeat_practice_squares
}
else {
to_repeat_practice_squares = false;
}
return to_repeat_practice_squares
}
}
var practice_squares_loop = {
timeline: [start_practice_squares, demo_procedure_squares, check_accuracy],
loop_function: function () {
if (to_repeat_practice_squares == true) {
return true;
} else {
return false;
}
}
}
/*Start exp part of squares game*/
var start_exp_squares = {
type: jsPsychHtmlKeyboardResponse,
stimulus: '<p>Good Job! <br> You have finished the practice trials.<br> We will now start the real experiment. Please try to be as accurate as possible. <br> <br> <b> Press any key to begin</p>'
};
var current_squares_exp_trial = 0;
var memory = {
type: jsPsychHtmlKeyboardResponse,
stimulus: function () { return generate_random_squares(condition_squares_exp) },
choices: "NO_KEYS",
trial_duration: 200,
data: {
block_type: 'exp', trial_name: 'memory', trial_num: function () { return current_squares_exp_trial }
}
}
var test = {
type: jsPsychHtmlKeyboardResponse,
stimulus: function () {
rand_num = getRandomInt(number_of_images - 1)
if (condition_squares_exp[1] == 's') { /* it is the same condition */
square = current_locations[rand_num] + change_detection_images[rand_num] + ">"
}
else { /* it is different condition */
square = current_locations[rand_num] + jsPsych.randomization.sampleWithoutReplacement(change_detection_images.slice(number_of_images), 1) + ">"
}
return square + fixation
},
choices: ['s', 'k'],
trial_duration: 6000,
data: {
block_type: 'exp', trial_name: 'test_squares', mapping: mapping, trial_num: function () { return current_squares_exp_trial },
correct_response: function () {
if (condition_squares_exp[1] == 's') { //it is same condition
key_press_num = mapping[0]
}
else {
key_press_num = mapping[1]
}
return key_press_num
},
set_size: function () {
return condition_squares_exp[0]
},
condition: function () {
return condition_squares_exp[1]
}
},
on_finish: function (data) {
condition_squares_exp = jsPsych.randomization.sampleWithoutReplacement(['4same', '4diff', '8same', '8diff'], 1)[0]
var correct = false;
if (data.correct_response == data.response) {
correct = true;
}
else if (data.response == null) {
correct = null;
}
data.accuracy = correct;
current_squares_exp_trial += 1;
}
}
/*Finish exp part of squares game*/
var finish_exp_squares = {
type: jsPsychHtmlKeyboardResponse,
stimulus: '<p>Good Job! <br> You have finished the squares game.<br> We will now move on to the next part. Good luck! <br> <br> <b> Press any key to continue</p>'
};
/*----------------------------------------------------
ICAR test
------------------------------------------------------*/
var start_icar = {
type: jsPsychInstructions,
pages:[ '<p>We will now ask you to answer a multiple-choice test.<br>',
'In this test there are a number of items that differ from each other. <br>Some involve selecting an illustration according to the instructions, and others require to select the correct answer for a text question that will be presented on the screen. <br>',
'This part has no practice. Click next to start the test.'],
show_clickable_nav:true
}
var Qimg1_icar_options = ["A", "B", "C","D","E","F","G","H"];
var Qimg2_icar_options = ["A", "B", "C","D","E","F","None of these","I don't know"];
var Q2_icar_options = ["S","T","U","V","W","X","None of these","I don't know"];
var Q3_icar_options = ["2","3", "4","5","6","7","None of these","I don't know"];
var Q5_icar_options = ["Richard is taller than Matt","Richard is shorter than Matt,Richard is as tall as Matt","It's impossible to tell","Richard is taller than Zach","Zach is shorter than Matt","None of these","I don't know"];
var Q7_icar_options = ["E","F","G","H","I","J","None of these","I don't know"];
var Q9_icar_options = ["35","39","44","47","53","57","None of these","I don't know"];
var Q12_icar_options = ["Friday","Monday","Wednesday","Saturday","Tuesday","Sunday","None of these","I don't know"];
var Q13_icar_options = ["T","U","V","X","Y","Z","None of these","I don't know"];
var Q16_icar_options = ["J","H","I","N","M","L","None of these","I don't know"];
var icar1 = {
type: jsPsychSurveyMultiChoice,
questions: [
{prompt: "All the cubes below have a different image on each side. Select the choice that represents a rotation of the cube labeled X, by clicking the circle next to the letter.<br> <br><img class='icar' src= "+icar_images[0]+">",options: Qimg1_icar_options,correct:"C",required:true},
],
on_finish: function(data) {
data.correct="C"
}
}
var icar2 = {
type: jsPsychSurveyMultiChoice,
questions: [
{prompt: "In the following alphanumeric series, what letter comes next? <br><h3>K, N, P, S, U, ... </h3>",options: Q2_icar_options,correct:"X",required:true},
],
on_finish: function(data) {
data.correct="X"
}
}
var icar3 = {
type: jsPsychSurveyMultiChoice,
questions: [
{prompt: "What number is one fifth of one fourth of one ninth of 900?",options: Q3_icar_options,correct:"5",required:true},
],
on_finish: function(data) {
data.correct="5"
}
}
var icar4 = {
type: jsPsychSurveyMultiChoice,
questions: [
{prompt: "Please indicate which is the best answer to complete the figure below.<br> <img class='icar' src= "+icar_images[4]+">",options: Qimg2_icar_options,correct:"D",required:true},
],
on_finish: function(data) {
data.correct="D"
}
}
var icar5 = {
type: jsPsychSurveyMultiChoice,
questions: [
{prompt:"Zach is taller than Matt and Richard is shorter than Zach. Which of the following statements would be most accurate?",options: Q5_icar_options,correct:"It's impossible to tell",required:true},
],
on_finish: function(data) {
data.correct="It's impossible to tell"
}
}
var icar6 = {
type: jsPsychSurveyMultiChoice,
questions: [
{prompt: "All the cubes below have a different image on each side. Select the choice that represents a rotation of the cube labeled X, by clicking the circle next to the letter.<br> <img class='icar' src= "+icar_images[1]+">",options: Qimg1_icar_options,correct:"B",required:true},
],
on_finish: function(data) {
data.correct="B"
}
}
var icar7 = {
type: jsPsychSurveyMultiChoice,
questions: [
{prompt: "In the following alphanumeric series, what letter comes next?<br><h3>V, Q, M, J, H, ... </h3>",options: Q7_icar_options,correct:"G",required:true},
],
on_finish: function(data) {
data.correct="G"
}
}
var icar8 = {
type: jsPsychSurveyMultiChoice,
questions: [
{prompt: "Please indicate which is the best answer to complete the figure below.<br><img class='icar' src= "+icar_images[5]+">",options: Qimg2_icar_options,correct:"B",required:true},
],
on_finish: function(data) {
data.correct="B"
}
}
var icar9 = {
type: jsPsychSurveyMultiChoice,
questions: [
{prompt: "Joshua is 12 years old and his sister is three times as old as he. When Joshua is 23 years old, how old will his sister be?",options: Q9_icar_options,correct:"47",required:true},
],
on_finish: function(data) {
data.correct="47"
}
}
var icar10 = {
type: jsPsychSurveyMultiChoice,
questions: [
{prompt: "All the cubes below have a different image on each side. Select the choice that represents a rotation of the cube labeled X, by clicking the circle next to the letter. <br> <img class='icar' src= "+icar_images[2]+">",options: Qimg1_icar_options,correct:"F",required:true},
],
on_finish: function(data) {
data.correct="F"
}
}