-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
3115 lines (2243 loc) · 110 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>UCMCIS_2ndExp</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/[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 = "hRFOnEfyZOVz";
// 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);
// 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');
//
// subject_id: subject_id,
// study_id: study_id,
// session_id: session_id
// });
//To run the experiment without Prolific website
const subject_id = jsPsych.randomization.randomID(10);
jsPsych.data.addProperties({ subject_id: subject_id });
var timeline = [];
var tr_duration = 30000;
//The sympol to be shown inside the hit buttons and background color
var button_hit = 'O';
var bc_color = 'green';
//preloading the Venice map
var preload = {
type: jsPsychPreload,
videos: 'video_instruction.mp4',
};
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: 900,
minimum_height: 650,
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 Enter 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">If you are volunteering, you will receive a small token gift as a sign of our appreciation. If you are participating in return for payment, you will be compensated approximately $8/hour for participating in this study.' +
' If you are participating in return for course credit, you will be compensated through the SONA system with course credit (0.5 credit per half-hour), even if you do not complete the study. 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)
//number of the button clicked
var clk_num = 0;
var miss_counter = 0;
var hit_counter = 0;
//time when previous button clicked
var pr_click_t = 0;
var target = [];
var button_var = [];
var RT = [];
var table = [];
var stem_set = [
"ab",
"da",
"ea",
"gl",
"gr",
"le",
"mi",
"pr",
"st",
"zo",
// new items
"ap",
"di",
"bo",
"ke",
"ha",
"ne",
"fr",
"sy",
"al",
"wa",
"pl",
];
var shuffled_stem_set = jsPsych.randomization.repeat(stem_set, 1);
var CRA_set = [
'pie' + '\xa0\xa0\xa0\xa0' + 'luck' + '\xa0\xa0\xa0\xa0' + 'belly',
'opera' + '\xa0\xa0\xa0\xa0' + 'hand' + '\xa0\xa0\xa0\xa0' + 'dish',
'dust' + '\xa0\xa0\xa0\xa0' + 'cereal' + '\xa0\xa0\xa0\xa0' + 'fish',
'light' + '\xa0\xa0\xa0\xa0' + 'birthday' + '\xa0\xa0\xa0\xa0' + 'stick',
'palm' + '\xa0\xa0\xa0\xa0' + 'shoe' + '\xa0\xa0\xa0\xa0' + 'house',
'sage' + '\xa0\xa0\xa0\xa0' + 'paint' + '\xa0\xa0\xa0\xa0' + 'hair',
'french' + '\xa0\xa0\xa0\xa0' + 'car' + '\xa0\xa0\xa0\xa0' + 'shoe',
'carpet' + '\xa0\xa0\xa0\xa0' + 'alert' + '\xa0\xa0\xa0\xa0' + 'ink',
'mouse' + '\xa0\xa0\xa0\xa0' + 'bear' + '\xa0\xa0\xa0\xa0' + 'sand',
'show' + '\xa0\xa0\xa0\xa0' + 'life' + '\xa0\xa0\xa0\xa0' + 'row',
// new items
'dream' + '\xa0\xa0\xa0\xa0' + 'break' + '\xa0\xa0\xa0\xa0' + 'light',// day
'fish' + '\xa0\xa0\xa0\xa0' + 'mine' + '\xa0\xa0\xa0\xa0' + 'rush',// gold
'aid' + '\xa0\xa0\xa0\xa0' + 'rubber' + '\xa0\xa0\xa0\xa0' + 'wagon',// band
'hammer' + '\xa0\xa0\xa0\xa0' + 'gear' + '\xa0\xa0\xa0\xa0' + 'hunter',// head
'way' + '\xa0\xa0\xa0\xa0' + 'board' + '\xa0\xa0\xa0\xa0' + 'sleep',// walk
'political' + '\xa0\xa0\xa0\xa0' + 'surprise' + '\xa0\xa0\xa0\xa0' + 'line',// party
'cat' + '\xa0\xa0\xa0\xa0' + 'number' + '\xa0\xa0\xa0\xa0' + 'phone',// call
'knife' + '\xa0\xa0\xa0\xa0' + 'light' + '\xa0\xa0\xa0\xa0' + 'pal',// pen
'basket' + '\xa0\xa0\xa0\xa0' + 'eight' + '\xa0\xa0\xa0\xa0' + 'snow',// ball
'shine' + '\xa0\xa0\xa0\xa0' + 'beam' + '\xa0\xa0\xa0\xa0' + 'struck',// moon
'wet' + '\xa0\xa0\xa0\xa0' + 'law' + '\xa0\xa0\xa0\xa0' + 'business',// suit
];
var shuffled_CRA_set = jsPsych.randomization.repeat(CRA_set, 1);
var video_instruction = {
type: jsPsychVideoKeyboardResponse,
prompt: "Here is a video demo of how to search the map for one reward. " +
"(Keep in mind that you will need to find five rewards for each map.) <p> " +
"When the video has finished, hit <b>Enter</b> to start the task.",
stimulus: [
'video_instruction.mp4'
],
width: window.innerWidth,
height: window.innerHeight,
// choices: "Enter",
// trial_ends_after_video: true,
// controls: true,
response_allowed_while_playing: false,
};
// Function to reveal the background of the button upon click
function table_cluster_1(button, row, col) {
if (!button.disable && hit_counter < 5) {
button.disabled = true; // Disable the button after one click
if (row === 1 && col === 1) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 1 && col === 2) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 1 && col === 3) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 2 && col === 1) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 2 && col === 2) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 2 && col === 3) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 3 && col === 1) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 3 && col === 2) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 3 && col === 3) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else {
// button.style.display = 'none';
button.style.backgroundColor = 'white';
target[clk_num] = 'miss';
}
button_var[clk_num, clk_num] = [row, col];
RT[clk_num] = performance.now() - pr_click_t;
table[clk_num] = 'cluster_1';
clk_num += 1;
pr_click_t = performance.now();
}
if (hit_counter === 5) {
setTimeout(function () {
if (hit_counter === 5) { // Check again after delay
jsPsych.finishTrial();
}
}, 500);
}
}
// Function to reveal the background of the button upon click
function table_cluster_2(button, row, col) {
if (!button.disable && hit_counter < 5) {
button.disabled = true; // Disable the button
if (row === 0 && col === 2) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 0 && col === 3) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 0 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 1 && col === 2) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 1 && col === 3) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 1 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 2 && col === 2) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 2 && col === 3) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 2 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else {
// button.style.display = 'none';
button.style.backgroundColor = 'white';
target[clk_num] = 'miss';
}
button_var[clk_num, clk_num] = [row, col];
RT[clk_num] = performance.now() - pr_click_t;
table[clk_num] = 'cluster_2';
clk_num += 1;
pr_click_t = performance.now();
}
if (hit_counter === 5) {
setTimeout(function () {
if (hit_counter === 5) { // Check again after delay
jsPsych.finishTrial();
}
}, 500);
}
}
// Function to reveal the background of the button upon click
function table_cluster_3(button, row, col) {
if (!button.disable && hit_counter < 5) {
button.disabled = true; // Disable the button
if (row === 4 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 4 && col === 5) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 4 && col === 6) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 5 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 5 && col === 5) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 5 && col === 6) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 6 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 6 && col === 5) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 6 && col === 6) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else {
// button.style.display = 'none';
button.style.backgroundColor = 'white';
target[clk_num] = 'miss';
}
button_var[clk_num, clk_num] = [row, col];
RT[clk_num] = performance.now() - pr_click_t;
table[clk_num] = 'cluster_3';
clk_num += 1;
pr_click_t = performance.now();
}
if (hit_counter === 5) {
setTimeout(function () {
if (hit_counter === 5) { // Check again after delay
jsPsych.finishTrial();
}
}, 500);
}
}
// Function to reveal the background of the button upon click
function table_cluster_4(button, row, col) {
if (!button.disable && hit_counter < 5) {
button.disabled = true; // Disable the button
if (row === 3 && col === 2) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 3 && col === 3) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 3 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 4 && col === 2) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 4 && col === 3) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
} else if (row === 4 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 5 && col === 2) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 5 && col === 3) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 5 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else {
// button.style.display = 'none';
button.style.backgroundColor = 'white';
target[clk_num] = 'miss';
}
button_var[clk_num, clk_num] = [row, col];
RT[clk_num] = performance.now() - pr_click_t;
table[clk_num] = 'cluster_4';
clk_num += 1;
pr_click_t = performance.now();
}
if (hit_counter === 5) {
setTimeout(function () {
if (hit_counter === 5) { // Check again after delay
jsPsych.finishTrial();
}
}, 500);
}
}
// Function to reveal the background of the button upon click
function table_cluster_5(button, row, col) {
if (!button.disable && hit_counter < 5) {
button.disabled = true; // Disable the button
if (row === 1 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 1 && col === 5) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 1 && col === 6) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 2 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 2 && col === 5) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 2 && col === 6) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 3 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 3 && col === 5) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 3 && col === 6) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else {
// button.style.display = 'none';
button.style.backgroundColor = 'white';
target[clk_num] = 'miss';
}
button_var[clk_num, clk_num] = [row, col];
RT[clk_num] = performance.now() - pr_click_t;
table[clk_num] = 'cluster_5';
clk_num += 1;
pr_click_t = performance.now();
}
if (hit_counter === 5) {
setTimeout(function () {
if (hit_counter === 5) { // Check again after delay
jsPsych.finishTrial();
}
}, 500);
}
}
// Function to reveal the background of the button upon click
function table_cluster_6(button, row, col) {
if (!button.disable && hit_counter < 5) {
button.disabled = true; // Disable the button
if (row === 4 && col === 0) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 4 && col === 1) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 4 && col === 2) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 5 && col === 0) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 5 && col === 1) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 5 && col === 2) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 6 && col === 0) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 6 && col === 1) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 6 && col === 2) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else {
// button.style.display = 'none';
button.style.backgroundColor = 'white';
target[clk_num] = 'miss';
}
button_var[clk_num, clk_num] = [row, col];
RT[clk_num] = performance.now() - pr_click_t;
table[clk_num] = 'cluster_6';
clk_num += 1;
pr_click_t = performance.now();
}
if (hit_counter === 5) {
setTimeout(function () {
if (hit_counter === 5) { // Check again after delay
jsPsych.finishTrial();
}
}, 500);
}
}
// Function to reveal the background of the button upon click
function table_cluster_7(button, row, col) {
if (!button.disable && hit_counter < 5) {
button.disabled = true; // Disable the button
if (row === 2 && col === 3) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 2 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 2 && col === 5) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 3 && col === 3) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 3 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 3 && col === 5) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 4 && col === 3) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 4 && col === 4) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else if (row === 4 && col === 5) {
button.style.backgroundColor = bc_color;
button.innerHTML = `<span style="font-weight: bold; font-size: 40px;">${button_hit}</span>`;
target[clk_num] = 'hit';
hit_counter += 1;
}
else {
// button.style.display = 'none';
button.style.backgroundColor = 'white';