How to use compareKeys method in fast-check-monorepo

Best JavaScript code snippet using fast-check-monorepo

script.js

Source:script.js Github

copy

Full Screen

...570 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 571 choices: ['g','b'],572 on_finish: function(data){573 // Score the response as correct or incorrect.574 if(jsPsych.pluginAPI.compareKeys(data.response, 'g')){575 data.correct = true;576 } else {577 data.correct = false; 578 }579 }580 },581 {582 type: 'animation', 583 stimuli: animation_sequence, 584 sequence_reps: 10,585 frame_time: 30,586 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',587 choices: jsPsych.NO_KEYS 588 },589 {590 type: 'html-keyboard-response',591 stimulus: function(){592 var round1_coop_1 = jsPsych.data.get().last(2).values()[0].correct;593 if(round1_coop_1){594 return jsPsych.timelineVariable('counter_green_coop_r1');595 } else {596 return jsPsych.timelineVariable('counter_blue_coop_r1');597 }598 }599 },600 {601 type: 'html-keyboard-response', 602 stimulus: '',603 choices: jsPsych.ALL_KEYS,604 prompt: `<p> You will now have an opportunity to provide feedback to the Anonymous35 regarding how the outcome made you feel. Anonymous35 will receive your feedback and provide feedback as well. </p>605 <p> Please focus on the <strong> FACIAL EMOTIONAL EXPRESSIONS </strong>, as you will use the facial emotional expressions to provide feedback. Do <strong> NOT </strong> focus on the color screens, as they are meaningless and will <strong> NOT </strong> be used for feedback. </p>606 <p> Press any key to continue. </p>`607 },608 {609 type: 'html-button-response',610 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],611 stimulus: function(){612 var round1_coop_2 = jsPsych.data.get().last(4).values()[0].correct;613 if(round1_coop_2){614 return jsPsych.timelineVariable('par_gg_res');615 } else {616 return jsPsych.timelineVariable('par_bg_res');617 }618 }619 },620 {621 type: 'html-keyboard-response',622 stimulus: function(){623 var round1_coop_3 = jsPsych.data.get().last(5).values()[0].correct;624 if(round1_coop_3){625 return jsPsych.timelineVariable('A35_gg_co_res');626 } else {627 return jsPsych.timelineVariable('A35_bg_co_res');628 }629 }630 },631 {632 type: 'html-slider-response',633 stimulus: function(){634 var round1_coop_4 = jsPsych.data.get().last(6).values()[0].correct;635 if(round1_coop_4){636 return jsPsych.timelineVariable('A35_gg_co_res_sl');637 } else {638 return jsPsych.timelineVariable('A35_bg_co_res_sl');639 }640 },641 labels: ['Likely BLUE', 'Likely GREEN']642 },643 {644 type: 'image-keyboard-response',645 stimulus: ['round2_matrix_c0.png'],646 stimulus_width: 500,647 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 648 choices: ['g','b'],649 on_finish: function(data){650 // Score the response as correct or incorrect.651 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){652 data.correct = true;653 } else {654 data.correct = false; 655 }656 }657 },658 {659 type: 'animation', 660 stimuli: animation_sequence, 661 sequence_reps: 10,662 frame_time: 30,663 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',664 choices: jsPsych.NO_KEYS 665 },666 {667 type: 'html-keyboard-response',668 stimulus: function(){669 // get the data from the previous trial,670 // and check which key was pressed671 var data1_1 = jsPsych.data.get().last(9).values()[0];672 var data2_1 = jsPsych.data.get().last(2).values()[0];673 if(jsPsych.pluginAPI.compareKeys(data2_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_1.response, 'g')){674 return jsPsych.timelineVariable('counter_green_coop_r2');675 } else if(jsPsych.pluginAPI.compareKeys(data2_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_1.response, 'b')){676 return jsPsych.timelineVariable('counter_green_defe_r2');677 } else if(jsPsych.pluginAPI.compareKeys(data2_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data1_1.response, 'g')){678 return jsPsych.timelineVariable('counter_blue_coop_r2');679 } else {680 return jsPsych.timelineVariable('counter_blue_defe_r2');681 }682 }683 },684 {685 type: 'html-button-response',686 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],687 stimulus: function(){688 var data1_2 = jsPsych.data.get().last(10).values()[0];689 var data2_2 = jsPsych.data.get().last(3).values()[0];690 if(jsPsych.pluginAPI.compareKeys(data2_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_2.response, 'g')){691 return jsPsych.timelineVariable('par_gg_res');692 } else if(jsPsych.pluginAPI.compareKeys(data2_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_2.response, 'b')){693 return jsPsych.timelineVariable('par_gb_res');694 } else if(jsPsych.pluginAPI.compareKeys(data2_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data1_2.response, 'g')){695 return jsPsych.timelineVariable('par_bg_res');696 } else {697 return jsPsych.timelineVariable('par_bb_res');698 }699 }700 },701 {702 type: 'html-keyboard-response',703 stimulus: function(){704 var data1_3 = jsPsych.data.get().last(11).values()[0];705 var data2_3 = jsPsych.data.get().last(4).values()[0];706 if(jsPsych.pluginAPI.compareKeys(data2_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_3.response, 'g')){707 return jsPsych.timelineVariable('A35_gg_co_res');708 } else if(jsPsych.pluginAPI.compareKeys(data2_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_3.response, 'b')){709 return jsPsych.timelineVariable('A35_gb_co_res');710 } else if(jsPsych.pluginAPI.compareKeys(data2_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data1_3.response, 'g')){711 return jsPsych.timelineVariable('A35_bg_co_res');712 } else {713 return jsPsych.timelineVariable('A35_bb_co_res');714 }715 }716 },717 {718 type: 'html-slider-response',719 stimulus: function(){720 var data1_4 = jsPsych.data.get().last(12).values()[0];721 var data2_4 = jsPsych.data.get().last(5).values()[0];722 if(jsPsych.pluginAPI.compareKeys(data2_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_4.response, 'g')){723 return jsPsych.timelineVariable('A35_gg_co_res_sl');724 } else if(jsPsych.pluginAPI.compareKeys(data2_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_4.response, 'b')){725 return jsPsych.timelineVariable('A35_gb_co_res_sl');726 } else if(jsPsych.pluginAPI.compareKeys(data2_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data1_4.response, 'g')){727 return jsPsych.timelineVariable('A35_bg_co_res_sl');728 } else {729 return jsPsych.timelineVariable('A35_bb_co_res_sl');730 }731 },732 labels: ['Likely BLUE', 'Likely GREEN']733 },734 {735 type: 'image-keyboard-response',736 stimulus: ['round3_matrix_c0.png'],737 stimulus_width: 500,738 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 739 choices: ['g','b'],740 on_finish: function(data){741 // Score the response as correct or incorrect.742 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){743 data.correct = true;744 } else {745 data.correct = false; 746 }747 }748 },749 {750 type: 'animation', 751 stimuli: animation_sequence, 752 sequence_reps: 10,753 frame_time: 30,754 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',755 choices: jsPsych.NO_KEYS 756 },757 {758 type: 'html-keyboard-response',759 stimulus: function(){760 var data3_1 = jsPsych.data.get().last(8).values()[0];761 var data4_1 = jsPsych.data.get().last(2).values()[0];762 if(jsPsych.pluginAPI.compareKeys(data4_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_1.response, 'g')){763 return jsPsych.timelineVariable('counter_green_coop_r3');764 } else if(jsPsych.pluginAPI.compareKeys(data4_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_1.response, 'b')){765 return jsPsych.timelineVariable('counter_green_defe_r3');766 } else if(jsPsych.pluginAPI.compareKeys(data4_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data3_1.response, 'g')){767 return jsPsych.timelineVariable('counter_blue_coop_r3');768 } else {769 return jsPsych.timelineVariable('counter_blue_defe_r3');770 }771 }772 },773 {774 type: 'html-button-response',775 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],776 stimulus: function(){777 var data3_2 = jsPsych.data.get().last(9).values()[0];778 var data4_2 = jsPsych.data.get().last(3).values()[0];779 if(jsPsych.pluginAPI.compareKeys(data4_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_2.response, 'g')){780 return jsPsych.timelineVariable('par_gg_res');781 } else if(jsPsych.pluginAPI.compareKeys(data4_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_2.response, 'b')){782 return jsPsych.timelineVariable('par_gb_res');783 } else if(jsPsych.pluginAPI.compareKeys(data4_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data3_2.response, 'g')){784 return jsPsych.timelineVariable('par_bg_res');785 } else {786 return jsPsych.timelineVariable('par_bb_res');787 }788 }789 },790 {791 type: 'html-keyboard-response',792 stimulus: function(){793 var data3_3 = jsPsych.data.get().last(10).values()[0];794 var data4_3 = jsPsych.data.get().last(4).values()[0];795 if(jsPsych.pluginAPI.compareKeys(data4_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_3.response, 'g')){796 return jsPsych.timelineVariable('A35_gg_co_res');797 } else if(jsPsych.pluginAPI.compareKeys(data4_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_3.response, 'b')){798 return jsPsych.timelineVariable('A35_gb_co_res');799 } else if(jsPsych.pluginAPI.compareKeys(data4_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data3_3.response, 'g')){800 return jsPsych.timelineVariable('A35_bg_co_res');801 } else {802 return jsPsych.timelineVariable('A35_bb_co_res');803 }804 }805 },806 {807 type: 'html-slider-response',808 stimulus: function(){809 var data3_4 = jsPsych.data.get().last(11).values()[0];810 var data4_4 = jsPsych.data.get().last(5).values()[0];811 if(jsPsych.pluginAPI.compareKeys(data4_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_4.response, 'g')){812 return jsPsych.timelineVariable('A35_gg_co_res_sl');813 } else if(jsPsych.pluginAPI.compareKeys(data4_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_4.response, 'b')){814 return jsPsych.timelineVariable('A35_gb_co_res_sl');815 } else if(jsPsych.pluginAPI.compareKeys(data4_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data3_4.response, 'g')){816 return jsPsych.timelineVariable('A35_bg_co_res_sl');817 } else {818 return jsPsych.timelineVariable('A35_bb_co_res_sl');819 }820 },821 labels: ['Likely BLUE', 'Likely GREEN']822 },823 {824 type: 'image-keyboard-response',825 stimulus: ['round4_matrix_c0.png'],826 stimulus_width: 500,827 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 828 choices: ['g','b'],829 on_finish: function(data){830 // Score the response as correct or incorrect.831 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){832 data.correct = true;833 } else {834 data.correct = false; 835 }836 }837 },838 {839 type: 'animation', 840 stimuli: animation_sequence, 841 sequence_reps: 10,842 frame_time: 30,843 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',844 choices: jsPsych.NO_KEYS 845 },846 {847 type: 'html-keyboard-response',848 stimulus: function(){849 var data5_1 = jsPsych.data.get().last(8).values()[0];850 var data6_1 = jsPsych.data.get().last(2).values()[0];851 if(jsPsych.pluginAPI.compareKeys(data6_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_1.response, 'g')){852 return jsPsych.timelineVariable('counter_green_coop_r4');853 } else if(jsPsych.pluginAPI.compareKeys(data6_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_1.response, 'b')){854 return jsPsych.timelineVariable('counter_green_defe_r4');855 } else if(jsPsych.pluginAPI.compareKeys(data6_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data5_1.response, 'g')){856 return jsPsych.timelineVariable('counter_blue_coop_r4');857 } else {858 return jsPsych.timelineVariable('counter_blue_defe_r4');859 }860 }861 },862 {863 type: 'html-button-response',864 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],865 stimulus: function(){866 var data5_2 = jsPsych.data.get().last(9).values()[0];867 var data6_2 = jsPsych.data.get().last(3).values()[0];868 if(jsPsych.pluginAPI.compareKeys(data6_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_2.response, 'g')){869 return jsPsych.timelineVariable('par_gg_res');870 } else if(jsPsych.pluginAPI.compareKeys(data6_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_2.response, 'b')){871 return jsPsych.timelineVariable('par_gb_res');872 } else if(jsPsych.pluginAPI.compareKeys(data6_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data5_2.response, 'g')){873 return jsPsych.timelineVariable('par_bg_res');874 } else {875 return jsPsych.timelineVariable('par_bb_res');876 }877 }878 },879 {880 type: 'html-keyboard-response',881 stimulus: function(){882 var data5_3 = jsPsych.data.get().last(10).values()[0];883 var data6_3 = jsPsych.data.get().last(4).values()[0];884 if(jsPsych.pluginAPI.compareKeys(data6_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_3.response, 'g')){885 return jsPsych.timelineVariable('A35_gg_co_res');886 } else if(jsPsych.pluginAPI.compareKeys(data6_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_3.response, 'b')){887 return jsPsych.timelineVariable('A35_gb_co_res');888 } else if(jsPsych.pluginAPI.compareKeys(data6_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data5_3.response, 'g')){889 return jsPsych.timelineVariable('A35_bg_co_res');890 } else {891 return jsPsych.timelineVariable('A35_bb_co_res');892 }893 }894 },895 {896 type: 'html-slider-response',897 stimulus: function(){898 var data5_4 = jsPsych.data.get().last(11).values()[0];899 var data6_4 = jsPsych.data.get().last(5).values()[0];900 if(jsPsych.pluginAPI.compareKeys(data6_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_4.response, 'g')){901 return jsPsych.timelineVariable('A35_gg_co_res_sl');902 } else if(jsPsych.pluginAPI.compareKeys(data6_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_4.response, 'b')){903 return jsPsych.timelineVariable('A35_gb_co_res_sl');904 } else if(jsPsych.pluginAPI.compareKeys(data6_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data5_4.response, 'g')){905 return jsPsych.timelineVariable('A35_bg_co_res_sl');906 } else {907 return jsPsych.timelineVariable('A35_bb_co_res_sl');908 }909 },910 labels: ['Likely BLUE', 'Likely GREEN']911 },912 {913 type: 'image-keyboard-response',914 stimulus: ['round5_matrix_c0.png'],915 stimulus_width: 500,916 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 917 choices: ['g','b'],918 on_finish: function(data){919 // Score the response as correct or incorrect.920 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){921 data.correct = true;922 } else {923 data.correct = false; 924 }925 }926 },927 {928 type: 'animation', 929 stimuli: animation_sequence, 930 sequence_reps: 10,931 frame_time: 30,932 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',933 choices: jsPsych.NO_KEYS 934 },935 {936 type: 'html-keyboard-response',937 stimulus: function(){938 var data7_1 = jsPsych.data.get().last(8).values()[0];939 var data8_1 = jsPsych.data.get().last(2).values()[0];940 if(jsPsych.pluginAPI.compareKeys(data8_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_1.response, 'g')){941 return jsPsych.timelineVariable('counter_green_coop_r5');942 } else if(jsPsych.pluginAPI.compareKeys(data8_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_1.response, 'b')){943 return jsPsych.timelineVariable('counter_green_defe_r5');944 } else if(jsPsych.pluginAPI.compareKeys(data8_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data7_1.response, 'g')){945 return jsPsych.timelineVariable('counter_blue_coop_r5');946 } else {947 return jsPsych.timelineVariable('counter_blue_defe_r5');948 }949 }950 },951 {952 type: 'html-button-response',953 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],954 stimulus: function(){955 var data7_2 = jsPsych.data.get().last(9).values()[0];956 var data8_2 = jsPsych.data.get().last(3).values()[0];957 if(jsPsych.pluginAPI.compareKeys(data8_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_2.response, 'g')){958 return jsPsych.timelineVariable('par_gg_res');959 } else if(jsPsych.pluginAPI.compareKeys(data8_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_2.response, 'b')){960 return jsPsych.timelineVariable('par_gb_res');961 } else if(jsPsych.pluginAPI.compareKeys(data8_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data7_2.response, 'g')){962 return jsPsych.timelineVariable('par_bg_res');963 } else {964 return jsPsych.timelineVariable('par_bb_res');965 }966 }967 },968 {969 type: 'html-keyboard-response',970 stimulus: function(){971 var data7_3 = jsPsych.data.get().last(10).values()[0];972 var data8_3 = jsPsych.data.get().last(4).values()[0];973 if(jsPsych.pluginAPI.compareKeys(data8_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_3.response, 'g')){974 return jsPsych.timelineVariable('A35_gg_co_res');975 } else if(jsPsych.pluginAPI.compareKeys(data8_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_3.response, 'b')){976 return jsPsych.timelineVariable('A35_gb_co_res');977 } else if(jsPsych.pluginAPI.compareKeys(data8_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data7_3.response, 'g')){978 return jsPsych.timelineVariable('A35_bg_co_res');979 } else {980 return jsPsych.timelineVariable('A35_bb_co_res');981 }982 }983 },984 {985 type: 'html-slider-response',986 stimulus: function(){987 var data7_4 = jsPsych.data.get().last(11).values()[0];988 var data8_4 = jsPsych.data.get().last(5).values()[0];989 if(jsPsych.pluginAPI.compareKeys(data8_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_4.response, 'g')){990 return jsPsych.timelineVariable('A35_gg_co_res_sl');991 } else if(jsPsych.pluginAPI.compareKeys(data8_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_4.response, 'b')){992 return jsPsych.timelineVariable('A35_gb_co_res_sl');993 } else if(jsPsych.pluginAPI.compareKeys(data8_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data7_4.response, 'g')){994 return jsPsych.timelineVariable('A35_bg_co_res_sl');995 } else {996 return jsPsych.timelineVariable('A35_bb_co_res_sl');997 }998 },999 labels: ['Likely BLUE', 'Likely GREEN']1000 },1001 {1002 type: 'image-keyboard-response',1003 stimulus: ['round6_matrix_c0.png'],1004 stimulus_width: 500,1005 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 1006 choices: ['g','b'],1007 on_finish: function(data){1008 // Score the response as correct or incorrect.1009 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){1010 data.correct = true;1011 } else {1012 data.correct = false; 1013 }1014 }1015 },1016 {1017 type: 'animation', 1018 stimuli: animation_sequence, 1019 sequence_reps: 10,1020 frame_time: 30,1021 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',1022 choices: jsPsych.NO_KEYS 1023 },1024 {1025 type: 'html-keyboard-response',1026 stimulus: function(){1027 var data9_1 = jsPsych.data.get().last(8).values()[0];1028 var data10_1 = jsPsych.data.get().last(2).values()[0];1029 if(jsPsych.pluginAPI.compareKeys(data10_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_1.response, 'g')){1030 return jsPsych.timelineVariable('counter_green_coop_r6');1031 } else if(jsPsych.pluginAPI.compareKeys(data10_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_1.response, 'b')){1032 return jsPsych.timelineVariable('counter_green_defe_r6');1033 } else if(jsPsych.pluginAPI.compareKeys(data10_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data9_1.response, 'g')){1034 return jsPsych.timelineVariable('counter_blue_coop_r6');1035 } else {1036 return jsPsych.timelineVariable('counter_blue_defe_r6');1037 }1038 }1039 },1040 {1041 type: 'html-button-response',1042 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],1043 stimulus: function(){1044 var data9_2 = jsPsych.data.get().last(9).values()[0];1045 var data10_2 = jsPsych.data.get().last(3).values()[0];1046 if(jsPsych.pluginAPI.compareKeys(data10_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_2.response, 'g')){1047 return jsPsych.timelineVariable('par_gg_res');1048 } else if(jsPsych.pluginAPI.compareKeys(data10_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_2.response, 'b')){1049 return jsPsych.timelineVariable('par_gb_res');1050 } else if(jsPsych.pluginAPI.compareKeys(data10_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data9_2.response, 'g')){1051 return jsPsych.timelineVariable('par_bg_res');1052 } else {1053 return jsPsych.timelineVariable('par_bb_res');1054 }1055 }1056 },1057 {1058 type: 'html-keyboard-response',1059 stimulus: function(){1060 var data9_3 = jsPsych.data.get().last(10).values()[0];1061 var data10_3 = jsPsych.data.get().last(4).values()[0];1062 if(jsPsych.pluginAPI.compareKeys(data10_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_3.response, 'g')){1063 return jsPsych.timelineVariable('A35_gg_co_res');1064 } else if(jsPsych.pluginAPI.compareKeys(data10_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_3.response, 'b')){1065 return jsPsych.timelineVariable('A35_gb_co_res');1066 } else if(jsPsych.pluginAPI.compareKeys(data10_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data9_3.response, 'g')){1067 return jsPsych.timelineVariable('A35_bg_co_res');1068 } else {1069 return jsPsych.timelineVariable('A35_bb_co_res');1070 }1071 }1072 },1073 {1074 type: 'html-slider-response',1075 stimulus: function(){1076 var data9_4 = jsPsych.data.get().last(11).values()[0];1077 var data10_4 = jsPsych.data.get().last(5).values()[0];1078 if(jsPsych.pluginAPI.compareKeys(data10_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_4.response, 'g')){1079 return jsPsych.timelineVariable('A35_gg_co_res_sl');1080 } else if(jsPsych.pluginAPI.compareKeys(data10_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_4.response, 'b')){1081 return jsPsych.timelineVariable('A35_gb_co_res_sl');1082 } else if(jsPsych.pluginAPI.compareKeys(data10_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data9_4.response, 'g')){1083 return jsPsych.timelineVariable('A35_bg_co_res_sl');1084 } else {1085 return jsPsych.timelineVariable('A35_bb_co_res_sl');1086 }1087 },1088 labels: ['Likely BLUE', 'Likely GREEN']1089 },1090 {1091 type: 'image-keyboard-response',1092 stimulus: ['round7_matrix_c0.png'],1093 stimulus_width: 500,1094 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 1095 choices: ['g','b'],1096 on_finish: function(data){1097 // Score the response as correct or incorrect.1098 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){1099 data.correct = true;1100 } else {1101 data.correct = false; 1102 }1103 }1104 },1105 {1106 type: 'animation', 1107 stimuli: animation_sequence, 1108 sequence_reps: 10,1109 frame_time: 30,1110 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',1111 choices: jsPsych.NO_KEYS 1112 },1113 {1114 type: 'html-keyboard-response',1115 stimulus: function(){1116 var data11_1 = jsPsych.data.get().last(8).values()[0];1117 var data12_1 = jsPsych.data.get().last(2).values()[0];1118 if(jsPsych.pluginAPI.compareKeys(data12_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_1.response, 'g')){1119 return jsPsych.timelineVariable('counter_green_coop_r7');1120 } else if(jsPsych.pluginAPI.compareKeys(data12_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_1.response, 'b')){1121 return jsPsych.timelineVariable('counter_green_defe_r7');1122 } else if(jsPsych.pluginAPI.compareKeys(data12_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data11_1.response, 'g')){1123 return jsPsych.timelineVariable('counter_blue_coop_r7');1124 } else {1125 return jsPsych.timelineVariable('counter_blue_defe_r7');1126 }1127 }1128 },1129 {1130 type: 'html-button-response',1131 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],1132 stimulus: function(){1133 var data11_2 = jsPsych.data.get().last(9).values()[0];1134 var data12_2 = jsPsych.data.get().last(3).values()[0];1135 if(jsPsych.pluginAPI.compareKeys(data12_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_2.response, 'g')){1136 return jsPsych.timelineVariable('par_gg_res');1137 } else if(jsPsych.pluginAPI.compareKeys(data12_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_2.response, 'b')){1138 return jsPsych.timelineVariable('par_gb_res');1139 } else if(jsPsych.pluginAPI.compareKeys(data12_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data11_2.response, 'g')){1140 return jsPsych.timelineVariable('par_bg_res');1141 } else {1142 return jsPsych.timelineVariable('par_bb_res');1143 }1144 }1145 },1146 {1147 type: 'html-keyboard-response',1148 stimulus: function(){1149 var data11_3 = jsPsych.data.get().last(10).values()[0];1150 var data12_3 = jsPsych.data.get().last(4).values()[0];1151 if(jsPsych.pluginAPI.compareKeys(data12_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_3.response, 'g')){1152 return jsPsych.timelineVariable('A35_gg_co_res');1153 } else if(jsPsych.pluginAPI.compareKeys(data12_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_3.response, 'b')){1154 return jsPsych.timelineVariable('A35_gb_co_res');1155 } else if(jsPsych.pluginAPI.compareKeys(data12_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data11_3.response, 'g')){1156 return jsPsych.timelineVariable('A35_bg_co_res');1157 } else {1158 return jsPsych.timelineVariable('A35_bb_co_res');1159 }1160 }1161 },1162 {1163 type: 'html-slider-response',1164 stimulus: function(){1165 var data11_4 = jsPsych.data.get().last(11).values()[0];1166 var data12_4 = jsPsych.data.get().last(5).values()[0];1167 if(jsPsych.pluginAPI.compareKeys(data12_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_4.response, 'g')){1168 return jsPsych.timelineVariable('A35_gg_co_res_sl');1169 } else if(jsPsych.pluginAPI.compareKeys(data12_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_4.response, 'b')){1170 return jsPsych.timelineVariable('A35_gb_co_res_sl');1171 } else if(jsPsych.pluginAPI.compareKeys(data12_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data11_4.response, 'g')){1172 return jsPsych.timelineVariable('A35_bg_co_res_sl');1173 } else {1174 return jsPsych.timelineVariable('A35_bb_co_res_sl');1175 }1176 },1177 labels: ['Likely BLUE', 'Likely GREEN']1178 },1179 {1180 type: 'image-keyboard-response',1181 stimulus: ['round8_matrix_c0.png'],1182 stimulus_width: 500,1183 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 1184 choices: ['g','b'],1185 on_finish: function(data){1186 // Score the response as correct or incorrect.1187 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){1188 data.correct = true;1189 } else {1190 data.correct = false; 1191 }1192 }1193 },1194 {1195 type: 'animation', 1196 stimuli: animation_sequence, 1197 sequence_reps: 10,1198 frame_time: 30,1199 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',1200 choices: jsPsych.NO_KEYS 1201 },1202 {1203 type: 'html-keyboard-response',1204 stimulus: function(){1205 var data13_1 = jsPsych.data.get().last(8).values()[0];1206 var data14_1 = jsPsych.data.get().last(2).values()[0];1207 if(jsPsych.pluginAPI.compareKeys(data14_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_1.response, 'g')){1208 return jsPsych.timelineVariable('counter_green_coop_r8');1209 } else if(jsPsych.pluginAPI.compareKeys(data14_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_1.response, 'b')){1210 return jsPsych.timelineVariable('counter_green_defe_r8');1211 } else if(jsPsych.pluginAPI.compareKeys(data14_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data13_1.response, 'g')){1212 return jsPsych.timelineVariable('counter_blue_coop_r8');1213 } else {1214 return jsPsych.timelineVariable('counter_blue_defe_r8');1215 }1216 }1217 },1218 {1219 type: 'html-button-response',1220 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],1221 stimulus: function(){1222 var data13_2 = jsPsych.data.get().last(9).values()[0];1223 var data14_2 = jsPsych.data.get().last(3).values()[0];1224 if(jsPsych.pluginAPI.compareKeys(data14_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_2.response, 'g')){1225 return jsPsych.timelineVariable('par_gg_res');1226 } else if(jsPsych.pluginAPI.compareKeys(data14_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_2.response, 'b')){1227 return jsPsych.timelineVariable('par_gb_res');1228 } else if(jsPsych.pluginAPI.compareKeys(data14_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data13_2.response, 'g')){1229 return jsPsych.timelineVariable('par_bg_res');1230 } else {1231 return jsPsych.timelineVariable('par_bb_res');1232 }1233 }1234 },1235 {1236 type: 'html-keyboard-response',1237 stimulus: function(){1238 var data13_3 = jsPsych.data.get().last(10).values()[0];1239 var data14_3 = jsPsych.data.get().last(4).values()[0];1240 if(jsPsych.pluginAPI.compareKeys(data14_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_3.response, 'g')){1241 return jsPsych.timelineVariable('A35_gg_co_res');1242 } else if(jsPsych.pluginAPI.compareKeys(data14_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_3.response, 'b')){1243 return jsPsych.timelineVariable('A35_gb_co_res');1244 } else if(jsPsych.pluginAPI.compareKeys(data14_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data13_3.response, 'g')){1245 return jsPsych.timelineVariable('A35_bg_co_res');1246 } else {1247 return jsPsych.timelineVariable('A35_bb_co_res');1248 }1249 }1250 },1251 {1252 type: 'html-slider-response',1253 stimulus: function(){1254 var data13_4 = jsPsych.data.get().last(11).values()[0];1255 var data14_4 = jsPsych.data.get().last(5).values()[0];1256 if(jsPsych.pluginAPI.compareKeys(data14_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_4.response, 'g')){1257 return jsPsych.timelineVariable('A35_gg_co_res_sl');1258 } else if(jsPsych.pluginAPI.compareKeys(data14_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_4.response, 'b')){1259 return jsPsych.timelineVariable('A35_gb_co_res_sl');1260 } else if(jsPsych.pluginAPI.compareKeys(data14_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data13_4.response, 'g')){1261 return jsPsych.timelineVariable('A35_bg_co_res_sl');1262 } else {1263 return jsPsych.timelineVariable('A35_bb_co_res_sl');1264 }1265 },1266 labels: ['Likely BLUE', 'Likely GREEN']1267 },1268 {1269 type: 'image-keyboard-response',1270 stimulus: ['round9_matrix_c0.png'],1271 stimulus_width: 500,1272 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 1273 choices: ['g','b'],1274 on_finish: function(data){1275 // Score the response as correct or incorrect.1276 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){1277 data.correct = true;1278 } else {1279 data.correct = false; 1280 }1281 }1282 },1283 {1284 type: 'animation', 1285 stimuli: animation_sequence, 1286 sequence_reps: 10,1287 frame_time: 30,1288 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',1289 choices: jsPsych.NO_KEYS 1290 },1291 {1292 type: 'html-keyboard-response',1293 stimulus: function(){1294 var data15_1 = jsPsych.data.get().last(8).values()[0];1295 var data16_1 = jsPsych.data.get().last(2).values()[0];1296 if(jsPsych.pluginAPI.compareKeys(data16_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_1.response, 'g')){1297 return jsPsych.timelineVariable('counter_green_coop_r9');1298 } else if(jsPsych.pluginAPI.compareKeys(data16_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_1.response, 'b')){1299 return jsPsych.timelineVariable('counter_green_defe_r9');1300 } else if(jsPsych.pluginAPI.compareKeys(data16_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data15_1.response, 'g')){1301 return jsPsych.timelineVariable('counter_blue_coop_r9');1302 } else {1303 return jsPsych.timelineVariable('counter_blue_defe_r9');1304 }1305 }1306 },1307 {1308 type: 'html-button-response',1309 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],1310 stimulus: function(){1311 var data15_2 = jsPsych.data.get().last(9).values()[0];1312 var data16_2 = jsPsych.data.get().last(3).values()[0];1313 if(jsPsych.pluginAPI.compareKeys(data16_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_2.response, 'g')){1314 return jsPsych.timelineVariable('par_gg_res');1315 } else if(jsPsych.pluginAPI.compareKeys(data16_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_2.response, 'b')){1316 return jsPsych.timelineVariable('par_gb_res');1317 } else if(jsPsych.pluginAPI.compareKeys(data16_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data15_2.response, 'g')){1318 return jsPsych.timelineVariable('par_bg_res');1319 } else {1320 return jsPsych.timelineVariable('par_bb_res');1321 }1322 }1323 },1324 {1325 type: 'html-keyboard-response',1326 stimulus: function(){1327 var data15_3 = jsPsych.data.get().last(10).values()[0];1328 var data16_3 = jsPsych.data.get().last(4).values()[0];1329 if(jsPsych.pluginAPI.compareKeys(data16_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_3.response, 'g')){1330 return jsPsych.timelineVariable('A35_gg_co_res');1331 } else if(jsPsych.pluginAPI.compareKeys(data16_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_3.response, 'b')){1332 return jsPsych.timelineVariable('A35_gb_co_res');1333 } else if(jsPsych.pluginAPI.compareKeys(data16_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data15_3.response, 'g')){1334 return jsPsych.timelineVariable('A35_bg_co_res');1335 } else {1336 return jsPsych.timelineVariable('A35_bb_co_res');1337 }1338 }1339 },1340 {1341 type: 'html-slider-response',1342 stimulus: function(){1343 var data15_4 = jsPsych.data.get().last(11).values()[0];1344 var data16_4 = jsPsych.data.get().last(5).values()[0];1345 if(jsPsych.pluginAPI.compareKeys(data16_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_4.response, 'g')){1346 return jsPsych.timelineVariable('A35_gg_co_res_sl');1347 } else if(jsPsych.pluginAPI.compareKeys(data16_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_4.response, 'b')){1348 return jsPsych.timelineVariable('A35_gb_co_res_sl');1349 } else if(jsPsych.pluginAPI.compareKeys(data16_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data15_4.response, 'g')){1350 return jsPsych.timelineVariable('A35_bg_co_res_sl');1351 } else {1352 return jsPsych.timelineVariable('A35_bb_co_res_sl');1353 }1354 },1355 labels: ['Likely BLUE', 'Likely GREEN']1356 },1357 {1358 type: 'image-keyboard-response',1359 stimulus: ['round10_matrix_c0.png'],1360 stimulus_width: 500,1361 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 1362 choices: ['g','b'],1363 on_finish: function(data){1364 // Score the response as correct or incorrect.1365 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){1366 data.correct = true;1367 } else {1368 data.correct = false; 1369 }1370 }1371 },1372 {1373 type: 'animation', 1374 stimuli: animation_sequence, 1375 sequence_reps: 10,1376 frame_time: 30,1377 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',1378 choices: jsPsych.NO_KEYS 1379 },1380 {1381 type: 'html-keyboard-response',1382 stimulus: function(){1383 var data17_1 = jsPsych.data.get().last(8).values()[0];1384 var data18_1 = jsPsych.data.get().last(2).values()[0];1385 if(jsPsych.pluginAPI.compareKeys(data18_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_1.response, 'g')){1386 return jsPsych.timelineVariable('counter_green_coop_r10');1387 } else if(jsPsych.pluginAPI.compareKeys(data18_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_1.response, 'b')){1388 return jsPsych.timelineVariable('counter_green_defe_r10');1389 } else if(jsPsych.pluginAPI.compareKeys(data18_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data17_1.response, 'g')){1390 return jsPsych.timelineVariable('counter_blue_coop_r10');1391 } else {1392 return jsPsych.timelineVariable('counter_blue_defe_r10');1393 }1394 }1395 },1396 {1397 type: 'html-button-response',1398 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],1399 stimulus: function(){1400 var data17_2 = jsPsych.data.get().last(9).values()[0];1401 var data18_2 = jsPsych.data.get().last(3).values()[0];1402 if(jsPsych.pluginAPI.compareKeys(data18_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_2.response, 'g')){1403 return jsPsych.timelineVariable('par_gg_res');1404 } else if(jsPsych.pluginAPI.compareKeys(data18_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_2.response, 'b')){1405 return jsPsych.timelineVariable('par_gb_res');1406 } else if(jsPsych.pluginAPI.compareKeys(data18_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data17_2.response, 'g')){1407 return jsPsych.timelineVariable('par_bg_res');1408 } else {1409 return jsPsych.timelineVariable('par_bb_res');1410 }1411 }1412 },1413 {1414 type: 'html-keyboard-response',1415 stimulus: function(){1416 var data17_3 = jsPsych.data.get().last(10).values()[0];1417 var data18_3 = jsPsych.data.get().last(4).values()[0];1418 if(jsPsych.pluginAPI.compareKeys(data18_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_3.response, 'g')){1419 return jsPsych.timelineVariable('A35_gg_co_res');1420 } else if(jsPsych.pluginAPI.compareKeys(data18_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_3.response, 'b')){1421 return jsPsych.timelineVariable('A35_gb_co_res');1422 } else if(jsPsych.pluginAPI.compareKeys(data18_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data17_3.response, 'g')){1423 return jsPsych.timelineVariable('A35_bg_co_res');1424 } else {1425 return jsPsych.timelineVariable('A35_bb_co_res');1426 }1427 }1428 },1429 {1430 type: 'html-slider-response',1431 stimulus: function(){1432 var data17_4 = jsPsych.data.get().last(11).values()[0];1433 var data18_4 = jsPsych.data.get().last(5).values()[0];1434 if(jsPsych.pluginAPI.compareKeys(data18_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_4.response, 'g')){1435 return jsPsych.timelineVariable('A35_gg_co_res_sl');1436 } else if(jsPsych.pluginAPI.compareKeys(data18_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_4.response, 'b')){1437 return jsPsych.timelineVariable('A35_gb_co_res_sl');1438 } else if(jsPsych.pluginAPI.compareKeys(data18_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data17_4.response, 'g')){1439 return jsPsych.timelineVariable('A35_bg_co_res_sl');1440 } else {1441 return jsPsych.timelineVariable('A35_bb_co_res_sl');1442 }1443 },1444 labels: ['Likely BLUE', 'Likely GREEN']1445 },1446 {1447 type: 'image-keyboard-response',1448 stimulus: ['round11_matrix_c0.png'],1449 stimulus_width: 500,1450 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 1451 choices: ['g','b'],1452 on_finish: function(data){1453 // Score the response as correct or incorrect.1454 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){1455 data.correct = true;1456 } else {1457 data.correct = false; 1458 }1459 }1460 },1461 {1462 type: 'animation', 1463 stimuli: animation_sequence, 1464 sequence_reps: 10,1465 frame_time: 30,1466 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',1467 choices: jsPsych.NO_KEYS 1468 },1469 {1470 type: 'html-keyboard-response',1471 stimulus: function(){1472 var data19_1 = jsPsych.data.get().last(8).values()[0];1473 var data20_1 = jsPsych.data.get().last(2).values()[0];1474 if(jsPsych.pluginAPI.compareKeys(data20_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_1.response, 'g')){1475 return jsPsych.timelineVariable('counter_green_coop_r11');1476 } else if(jsPsych.pluginAPI.compareKeys(data20_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_1.response, 'b')){1477 return jsPsych.timelineVariable('counter_green_defe_r11');1478 } else if(jsPsych.pluginAPI.compareKeys(data20_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data19_1.response, 'g')){1479 return jsPsych.timelineVariable('counter_blue_coop_r11');1480 } else {1481 return jsPsych.timelineVariable('counter_blue_defe_r11');1482 }1483 }1484 },1485 {1486 type: 'html-button-response',1487 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],1488 stimulus: function(){1489 var data19_2 = jsPsych.data.get().last(9).values()[0];1490 var data20_2 = jsPsych.data.get().last(3).values()[0];1491 if(jsPsych.pluginAPI.compareKeys(data20_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_2.response, 'g')){1492 return jsPsych.timelineVariable('par_gg_res');1493 } else if(jsPsych.pluginAPI.compareKeys(data20_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_2.response, 'b')){1494 return jsPsych.timelineVariable('par_gb_res');1495 } else if(jsPsych.pluginAPI.compareKeys(data20_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data19_2.response, 'g')){1496 return jsPsych.timelineVariable('par_bg_res');1497 } else {1498 return jsPsych.timelineVariable('par_bb_res');1499 }1500 }1501 },1502 {1503 type: 'html-keyboard-response',1504 stimulus: function(){1505 var data19_3 = jsPsych.data.get().last(10).values()[0];1506 var data20_3 = jsPsych.data.get().last(4).values()[0];1507 if(jsPsych.pluginAPI.compareKeys(data20_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_3.response, 'g')){1508 return jsPsych.timelineVariable('A35_gg_co_res');1509 } else if(jsPsych.pluginAPI.compareKeys(data20_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_3.response, 'b')){1510 return jsPsych.timelineVariable('A35_gb_co_res');1511 } else if(jsPsych.pluginAPI.compareKeys(data20_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data19_3.response, 'g')){1512 return jsPsych.timelineVariable('A35_bg_co_res');1513 } else {1514 return jsPsych.timelineVariable('A35_bb_co_res');1515 }1516 }1517 },1518 {1519 type: 'html-slider-response',1520 stimulus: function(){1521 var data19_4 = jsPsych.data.get().last(11).values()[0];1522 var data20_4 = jsPsych.data.get().last(5).values()[0];1523 if(jsPsych.pluginAPI.compareKeys(data20_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_4.response, 'g')){1524 return jsPsych.timelineVariable('A35_gg_co_res_sl');1525 } else if(jsPsych.pluginAPI.compareKeys(data20_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_4.response, 'b')){1526 return jsPsych.timelineVariable('A35_gb_co_res_sl');1527 } else if(jsPsych.pluginAPI.compareKeys(data20_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data19_4.response, 'g')){1528 return jsPsych.timelineVariable('A35_bg_co_res_sl');1529 } else {1530 return jsPsych.timelineVariable('A35_bb_co_res_sl');1531 }1532 },1533 labels: ['Likely BLUE', 'Likely GREEN']1534 },1535 {1536 type: 'image-keyboard-response',1537 stimulus: ['round12_matrix_c0.png'],1538 stimulus_width: 500,1539 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 1540 choices: ['g','b'],1541 on_finish: function(data){1542 // Score the response as correct or incorrect.1543 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){1544 data.correct = true;1545 } else {1546 data.correct = false; 1547 }1548 }1549 },1550 {1551 type: 'animation', 1552 stimuli: animation_sequence, 1553 sequence_reps: 10,1554 frame_time: 30,1555 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',1556 choices: jsPsych.NO_KEYS 1557 },1558 {1559 type: 'html-keyboard-response',1560 stimulus: function(){1561 var data21_1 = jsPsych.data.get().last(8).values()[0];1562 var data22_1 = jsPsych.data.get().last(2).values()[0];1563 if(jsPsych.pluginAPI.compareKeys(data22_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_1.response, 'g')){1564 return jsPsych.timelineVariable('counter_green_coop_r12');1565 } else if(jsPsych.pluginAPI.compareKeys(data22_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_1.response, 'b')){1566 return jsPsych.timelineVariable('counter_green_defe_r12');1567 } else if(jsPsych.pluginAPI.compareKeys(data22_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data21_1.response, 'g')){1568 return jsPsych.timelineVariable('counter_blue_coop_r12');1569 } else {1570 return jsPsych.timelineVariable('counter_blue_defe_r12');1571 }1572 }1573 },1574 {1575 type: 'html-button-response',1576 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],1577 stimulus: function(){1578 var data21_2 = jsPsych.data.get().last(9).values()[0];1579 var data22_2 = jsPsych.data.get().last(3).values()[0];1580 if(jsPsych.pluginAPI.compareKeys(data22_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_2.response, 'g')){1581 return jsPsych.timelineVariable('par_gg_res');1582 } else if(jsPsych.pluginAPI.compareKeys(data22_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_2.response, 'b')){1583 return jsPsych.timelineVariable('par_gb_res');1584 } else if(jsPsych.pluginAPI.compareKeys(data22_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data21_2.response, 'g')){1585 return jsPsych.timelineVariable('par_bg_res');1586 } else {1587 return jsPsych.timelineVariable('par_bb_res');1588 }1589 }1590 },1591 {1592 type: 'html-keyboard-response',1593 stimulus: function(){1594 var data21_3 = jsPsych.data.get().last(10).values()[0];1595 var data22_3 = jsPsych.data.get().last(4).values()[0];1596 if(jsPsych.pluginAPI.compareKeys(data22_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_3.response, 'g')){1597 return jsPsych.timelineVariable('A35_gg_co_res');1598 } else if(jsPsych.pluginAPI.compareKeys(data22_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_3.response, 'b')){1599 return jsPsych.timelineVariable('A35_gb_co_res');1600 } else if(jsPsych.pluginAPI.compareKeys(data22_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data21_3.response, 'g')){1601 return jsPsych.timelineVariable('A35_bg_co_res');1602 } else {1603 return jsPsych.timelineVariable('A35_bb_co_res');1604 }1605 }1606 },1607 {1608 type: 'html-slider-response',1609 stimulus: function(){1610 var data21_4 = jsPsych.data.get().last(11).values()[0];1611 var data22_4 = jsPsych.data.get().last(5).values()[0];1612 if(jsPsych.pluginAPI.compareKeys(data22_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_4.response, 'g')){1613 return jsPsych.timelineVariable('A35_gg_co_res_sl');1614 } else if(jsPsych.pluginAPI.compareKeys(data22_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_4.response, 'b')){1615 return jsPsych.timelineVariable('A35_gb_co_res_sl');1616 } else if(jsPsych.pluginAPI.compareKeys(data22_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data21_4.response, 'g')){1617 return jsPsych.timelineVariable('A35_bg_co_res_sl');1618 } else {1619 return jsPsych.timelineVariable('A35_bb_co_res_sl');1620 }1621 },1622 labels: ['Likely BLUE', 'Likely GREEN']1623 },1624 {1625 type: 'image-keyboard-response',1626 stimulus: ['round13_matrix_c0.png'],1627 stimulus_width: 500,1628 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 1629 choices: ['g','b'],1630 on_finish: function(data){1631 // Score the response as correct or incorrect.1632 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){1633 data.correct = true;1634 } else {1635 data.correct = false; 1636 }1637 }1638 },1639 {1640 type: 'animation', 1641 stimuli: animation_sequence, 1642 sequence_reps: 10,1643 frame_time: 30,1644 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',1645 choices: jsPsych.NO_KEYS 1646 },1647 {1648 type: 'html-keyboard-response',1649 stimulus: function(){1650 var data23_1 = jsPsych.data.get().last(8).values()[0];1651 var data24_1 = jsPsych.data.get().last(2).values()[0];1652 if(jsPsych.pluginAPI.compareKeys(data24_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data23_1.response, 'g')){1653 return jsPsych.timelineVariable('counter_green_coop_r13');1654 } else if(jsPsych.pluginAPI.compareKeys(data24_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data23_1.response, 'b')){1655 return jsPsych.timelineVariable('counter_green_defe_r13');1656 } else if(jsPsych.pluginAPI.compareKeys(data24_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data23_1.response, 'g')){1657 return jsPsych.timelineVariable('counter_blue_coop_r13');1658 } else {1659 return jsPsych.timelineVariable('counter_blue_defe_r13');1660 }1661 }1662 },1663 {1664 type: 'html-button-response',1665 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],1666 stimulus: function(){1667 var data23_2 = jsPsych.data.get().last(9).values()[0];1668 var data24_2 = jsPsych.data.get().last(3).values()[0];1669 if(jsPsych.pluginAPI.compareKeys(data24_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data23_2.response, 'g')){1670 return jsPsych.timelineVariable('par_gg_res');1671 } else if(jsPsych.pluginAPI.compareKeys(data24_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data23_2.response, 'b')){1672 return jsPsych.timelineVariable('par_gb_res');1673 } else if(jsPsych.pluginAPI.compareKeys(data24_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data23_2.response, 'g')){1674 return jsPsych.timelineVariable('par_bg_res');1675 } else {1676 return jsPsych.timelineVariable('par_bb_res');1677 }1678 }1679 },1680 {1681 type: 'html-keyboard-response',1682 stimulus: function(){1683 var data23_3 = jsPsych.data.get().last(10).values()[0];1684 var data24_3 = jsPsych.data.get().last(4).values()[0];1685 if(jsPsych.pluginAPI.compareKeys(data24_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data23_3.response, 'g')){1686 return jsPsych.timelineVariable('A35_gg_co_res');1687 } else if(jsPsych.pluginAPI.compareKeys(data24_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data23_3.response, 'b')){1688 return jsPsych.timelineVariable('A35_gb_co_res');1689 } else if(jsPsych.pluginAPI.compareKeys(data24_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data23_3.response, 'g')){1690 return jsPsych.timelineVariable('A35_bg_co_res');1691 } else {1692 return jsPsych.timelineVariable('A35_bb_co_res');1693 }1694 }1695 },1696 {1697 type: 'image-keyboard-response',1698 stimulus: ['round14_matrix_c0.png'],1699 stimulus_width: 500,1700 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 1701 choices: ['g','b'],1702 on_finish: function(data){1703 // Score the response as correct or incorrect.1704 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){1705 data.correct = true;1706 } else {1707 data.correct = false; 1708 }1709 }1710 },1711 {1712 type: 'animation', 1713 stimuli: animation_sequence, 1714 sequence_reps: 10,1715 frame_time: 30,1716 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',1717 choices: jsPsych.NO_KEYS 1718 },1719 {1720 type: 'html-keyboard-response',1721 stimulus: function(){1722 var data25_1 = jsPsych.data.get().last(8).values()[0];1723 var data26_1 = jsPsych.data.get().last(2).values()[0];1724 if(jsPsych.pluginAPI.compareKeys(data26_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_1.response, 'g')){1725 return jsPsych.timelineVariable('counter_green_coop_r14');1726 } else if(jsPsych.pluginAPI.compareKeys(data26_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_1.response, 'b')){1727 return jsPsych.timelineVariable('counter_green_defe_r14');1728 } else if(jsPsych.pluginAPI.compareKeys(data26_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data25_1.response, 'g')){1729 return jsPsych.timelineVariable('counter_blue_coop_r14');1730 } else {1731 return jsPsych.timelineVariable('counter_blue_defe_r14');1732 }1733 }1734 },1735 {1736 type: 'html-button-response',1737 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],1738 stimulus: function(){1739 var data25_2 = jsPsych.data.get().last(9).values()[0];1740 var data26_2 = jsPsych.data.get().last(3).values()[0];1741 if(jsPsych.pluginAPI.compareKeys(data26_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_2.response, 'g')){1742 return jsPsych.timelineVariable('par_gg_res');1743 } else if(jsPsych.pluginAPI.compareKeys(data26_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_2.response, 'b')){1744 return jsPsych.timelineVariable('par_gb_res');1745 } else if(jsPsych.pluginAPI.compareKeys(data26_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data25_2.response, 'g')){1746 return jsPsych.timelineVariable('par_bg_res');1747 } else {1748 return jsPsych.timelineVariable('par_bb_res');1749 }1750 }1751 },1752 {1753 type: 'html-keyboard-response',1754 stimulus: function(){1755 var data25_3 = jsPsych.data.get().last(10).values()[0];1756 var data26_3 = jsPsych.data.get().last(4).values()[0];1757 if(jsPsych.pluginAPI.compareKeys(data26_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_3.response, 'g')){1758 return jsPsych.timelineVariable('A35_gg_co_res');1759 } else if(jsPsych.pluginAPI.compareKeys(data26_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_3.response, 'b')){1760 return jsPsych.timelineVariable('A35_gb_co_res');1761 } else if(jsPsych.pluginAPI.compareKeys(data26_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data25_3.response, 'g')){1762 return jsPsych.timelineVariable('A35_bg_co_res');1763 } else {1764 return jsPsych.timelineVariable('A35_bb_co_res');1765 }1766 }1767 },1768 {1769 type: 'html-slider-response',1770 stimulus: function(){1771 var data25_4 = jsPsych.data.get().last(11).values()[0];1772 var data26_4 = jsPsych.data.get().last(5).values()[0];1773 if(jsPsych.pluginAPI.compareKeys(data26_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_4.response, 'g')){1774 return jsPsych.timelineVariable('A35_gg_co_res_sl');1775 } else if(jsPsych.pluginAPI.compareKeys(data26_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_4.response, 'b')){1776 return jsPsych.timelineVariable('A35_gb_co_res_sl');1777 } else if(jsPsych.pluginAPI.compareKeys(data26_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data25_4.response, 'g')){1778 return jsPsych.timelineVariable('A35_bg_co_res_sl');1779 } else {1780 return jsPsych.timelineVariable('A35_bb_co_res_sl');1781 }1782 },1783 labels: ['Likely BLUE', 'Likely GREEN']1784 },1785 {1786 type: 'image-keyboard-response',1787 stimulus: ['round15_matrix_c0.png'],1788 stimulus_width: 500,1789 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 1790 choices: ['g','b'],1791 on_finish: function(data){1792 // Score the response as correct or incorrect.1793 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){1794 data.correct = true;1795 } else {1796 data.correct = false; 1797 }1798 }1799 },1800 {1801 type: 'animation', 1802 stimuli: animation_sequence, 1803 sequence_reps: 10,1804 frame_time: 30,1805 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',1806 choices: jsPsych.NO_KEYS 1807 },1808 {1809 type: 'html-keyboard-response',1810 stimulus: function(){1811 var data27_1 = jsPsych.data.get().last(8).values()[0];1812 var data28_1 = jsPsych.data.get().last(2).values()[0];1813 if(jsPsych.pluginAPI.compareKeys(data28_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_1.response, 'g')){1814 return jsPsych.timelineVariable('counter_green_coop_r15');1815 } else if(jsPsych.pluginAPI.compareKeys(data28_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_1.response, 'b')){1816 return jsPsych.timelineVariable('counter_green_defe_r15');1817 } else if(jsPsych.pluginAPI.compareKeys(data28_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data27_1.response, 'g')){1818 return jsPsych.timelineVariable('counter_blue_coop_r15');1819 } else {1820 return jsPsych.timelineVariable('counter_blue_defe_r15');1821 }1822 }1823 },1824 {1825 type: 'html-button-response',1826 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],1827 stimulus: function(){1828 var data27_2 = jsPsych.data.get().last(9).values()[0];1829 var data28_2 = jsPsych.data.get().last(3).values()[0];1830 if(jsPsych.pluginAPI.compareKeys(data28_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_2.response, 'g')){1831 return jsPsych.timelineVariable('par_gg_res');1832 } else if(jsPsych.pluginAPI.compareKeys(data28_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_2.response, 'b')){1833 return jsPsych.timelineVariable('par_gb_res');1834 } else if(jsPsych.pluginAPI.compareKeys(data28_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data27_2.response, 'g')){1835 return jsPsych.timelineVariable('par_bg_res');1836 } else {1837 return jsPsych.timelineVariable('par_bb_res');1838 }1839 }1840 },1841 {1842 type: 'html-keyboard-response',1843 stimulus: function(){1844 var data27_3 = jsPsych.data.get().last(10).values()[0];1845 var data28_3 = jsPsych.data.get().last(4).values()[0];1846 if(jsPsych.pluginAPI.compareKeys(data28_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_3.response, 'g')){1847 return jsPsych.timelineVariable('A35_gg_co_res');1848 } else if(jsPsych.pluginAPI.compareKeys(data28_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_3.response, 'b')){1849 return jsPsych.timelineVariable('A35_gb_co_res');1850 } else if(jsPsych.pluginAPI.compareKeys(data28_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data27_3.response, 'g')){1851 return jsPsych.timelineVariable('A35_bg_co_res');1852 } else {1853 return jsPsych.timelineVariable('A35_bb_co_res');1854 }1855 }1856 },1857 {1858 type: 'html-slider-response',1859 stimulus: function(){1860 var data27_4 = jsPsych.data.get().last(11).values()[0];1861 var data28_4 = jsPsych.data.get().last(5).values()[0];1862 if(jsPsych.pluginAPI.compareKeys(data28_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_4.response, 'g')){1863 return jsPsych.timelineVariable('A35_gg_co_res_sl');1864 } else if(jsPsych.pluginAPI.compareKeys(data28_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_4.response, 'b')){1865 return jsPsych.timelineVariable('A35_gb_co_res_sl');1866 } else if(jsPsych.pluginAPI.compareKeys(data28_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data27_4.response, 'g')){1867 return jsPsych.timelineVariable('A35_bg_co_res_sl');1868 } else {1869 return jsPsych.timelineVariable('A35_bb_co_res_sl');1870 }1871 },1872 labels: ['Likely BLUE', 'Likely GREEN']1873 },1874 {1875 type: 'image-keyboard-response',1876 stimulus: ['round16_matrix_c0.png'],1877 stimulus_width: 500,1878 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 1879 choices: ['g','b'],1880 on_finish: function(data){1881 // Score the response as correct or incorrect.1882 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){1883 data.correct = true;1884 } else {1885 data.correct = false; 1886 }1887 }1888 },1889 {1890 type: 'animation', 1891 stimuli: animation_sequence, 1892 sequence_reps: 10,1893 frame_time: 30,1894 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',1895 choices: jsPsych.NO_KEYS 1896 },1897 {1898 type: 'html-keyboard-response',1899 stimulus: function(){1900 var data29_1 = jsPsych.data.get().last(8).values()[0];1901 var data30_1 = jsPsych.data.get().last(2).values()[0];1902 if(jsPsych.pluginAPI.compareKeys(data30_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_1.response, 'g')){1903 return jsPsych.timelineVariable('counter_green_coop_r16');1904 } else if(jsPsych.pluginAPI.compareKeys(data30_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_1.response, 'b')){1905 return jsPsych.timelineVariable('counter_green_defe_r16');1906 } else if(jsPsych.pluginAPI.compareKeys(data30_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data29_1.response, 'g')){1907 return jsPsych.timelineVariable('counter_blue_coop_r16');1908 } else {1909 return jsPsych.timelineVariable('counter_blue_defe_r16');1910 }1911 }1912 },1913 {1914 type: 'html-button-response',1915 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],1916 stimulus: function(){1917 var data29_2 = jsPsych.data.get().last(9).values()[0];1918 var data30_2 = jsPsych.data.get().last(3).values()[0];1919 if(jsPsych.pluginAPI.compareKeys(data30_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_2.response, 'g')){1920 return jsPsych.timelineVariable('par_gg_res');1921 } else if(jsPsych.pluginAPI.compareKeys(data30_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_2.response, 'b')){1922 return jsPsych.timelineVariable('par_gb_res');1923 } else if(jsPsych.pluginAPI.compareKeys(data30_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data29_2.response, 'g')){1924 return jsPsych.timelineVariable('par_bg_res');1925 } else {1926 return jsPsych.timelineVariable('par_bb_res');1927 }1928 }1929 },1930 {1931 type: 'html-keyboard-response',1932 stimulus: function(){1933 var data29_3 = jsPsych.data.get().last(10).values()[0];1934 var data30_3 = jsPsych.data.get().last(4).values()[0];1935 if(jsPsych.pluginAPI.compareKeys(data30_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_3.response, 'g')){1936 return jsPsych.timelineVariable('A35_gg_co_res');1937 } else if(jsPsych.pluginAPI.compareKeys(data30_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_3.response, 'b')){1938 return jsPsych.timelineVariable('A35_gb_co_res');1939 } else if(jsPsych.pluginAPI.compareKeys(data30_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data29_3.response, 'g')){1940 return jsPsych.timelineVariable('A35_bg_co_res');1941 } else {1942 return jsPsych.timelineVariable('A35_bb_co_res');1943 }1944 }1945 },1946 {1947 type: 'html-slider-response',1948 stimulus: function(){1949 var data29_4 = jsPsych.data.get().last(11).values()[0];1950 var data30_4 = jsPsych.data.get().last(5).values()[0];1951 if(jsPsych.pluginAPI.compareKeys(data30_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_4.response, 'g')){1952 return jsPsych.timelineVariable('A35_gg_co_res_sl');1953 } else if(jsPsych.pluginAPI.compareKeys(data30_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_4.response, 'b')){1954 return jsPsych.timelineVariable('A35_gb_co_res_sl');1955 } else if(jsPsych.pluginAPI.compareKeys(data30_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data29_4.response, 'g')){1956 return jsPsych.timelineVariable('A35_bg_co_res_sl');1957 } else {1958 return jsPsych.timelineVariable('A35_bb_co_res_sl');1959 }1960 },1961 labels: ['Likely BLUE', 'Likely GREEN']1962 },1963 {1964 type: 'image-keyboard-response',1965 stimulus: ['round17_matrix_c0.png'],1966 stimulus_width: 500,1967 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 1968 choices: ['g','b'],1969 on_finish: function(data){1970 // Score the response as correct or incorrect.1971 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){1972 data.correct = true;1973 } else {1974 data.correct = false; 1975 }1976 }1977 },1978 {1979 type: 'animation', 1980 stimuli: animation_sequence, 1981 sequence_reps: 10,1982 frame_time: 30,1983 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',1984 choices: jsPsych.NO_KEYS 1985 },1986 {1987 type: 'html-keyboard-response',1988 stimulus: function(){1989 var data31_1 = jsPsych.data.get().last(8).values()[0];1990 var data32_1 = jsPsych.data.get().last(2).values()[0];1991 if(jsPsych.pluginAPI.compareKeys(data32_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_1.response, 'g')){1992 return jsPsych.timelineVariable('counter_green_coop_r17');1993 } else if(jsPsych.pluginAPI.compareKeys(data32_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_1.response, 'b')){1994 return jsPsych.timelineVariable('counter_green_defe_r17');1995 } else if(jsPsych.pluginAPI.compareKeys(data32_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data31_1.response, 'g')){1996 return jsPsych.timelineVariable('counter_blue_coop_r17');1997 } else {1998 return jsPsych.timelineVariable('counter_blue_defe_r17');1999 }2000 }2001 },2002 {2003 type: 'html-button-response',2004 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],2005 stimulus: function(){2006 var data31_2 = jsPsych.data.get().last(9).values()[0];2007 var data32_2 = jsPsych.data.get().last(3).values()[0];2008 if(jsPsych.pluginAPI.compareKeys(data32_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_2.response, 'g')){2009 return jsPsych.timelineVariable('par_gg_res');2010 } else if(jsPsych.pluginAPI.compareKeys(data32_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_2.response, 'b')){2011 return jsPsych.timelineVariable('par_gb_res');2012 } else if(jsPsych.pluginAPI.compareKeys(data32_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data31_2.response, 'g')){2013 return jsPsych.timelineVariable('par_bg_res');2014 } else {2015 return jsPsych.timelineVariable('par_bb_res');2016 }2017 }2018 },2019 {2020 type: 'html-keyboard-response',2021 stimulus: function(){2022 var data31_3 = jsPsych.data.get().last(10).values()[0];2023 var data32_3 = jsPsych.data.get().last(4).values()[0];2024 if(jsPsych.pluginAPI.compareKeys(data32_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_3.response, 'g')){2025 return jsPsych.timelineVariable('A35_gg_co_res');2026 } else if(jsPsych.pluginAPI.compareKeys(data32_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_3.response, 'b')){2027 return jsPsych.timelineVariable('A35_gb_co_res');2028 } else if(jsPsych.pluginAPI.compareKeys(data32_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data31_3.response, 'g')){2029 return jsPsych.timelineVariable('A35_bg_co_res');2030 } else {2031 return jsPsych.timelineVariable('A35_bb_co_res');2032 }2033 }2034 },2035 {2036 type: 'html-slider-response',2037 stimulus: function(){2038 var data31_4 = jsPsych.data.get().last(11).values()[0];2039 var data32_4 = jsPsych.data.get().last(5).values()[0];2040 if(jsPsych.pluginAPI.compareKeys(data32_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_4.response, 'g')){2041 return jsPsych.timelineVariable('A35_gg_co_res_sl');2042 } else if(jsPsych.pluginAPI.compareKeys(data32_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_4.response, 'b')){2043 return jsPsych.timelineVariable('A35_gb_co_res_sl');2044 } else if(jsPsych.pluginAPI.compareKeys(data32_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data31_4.response, 'g')){2045 return jsPsych.timelineVariable('A35_bg_co_res_sl');2046 } else {2047 return jsPsych.timelineVariable('A35_bb_co_res_sl');2048 }2049 },2050 labels: ['Likely BLUE', 'Likely GREEN']2051 },2052 {2053 type: 'image-keyboard-response',2054 stimulus: ['round18_matrix_c0.png'],2055 stimulus_width: 500,2056 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 2057 choices: ['g','b'],2058 on_finish: function(data){2059 // Score the response as correct or incorrect.2060 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){2061 data.correct = true;2062 } else {2063 data.correct = false; 2064 }2065 }2066 },2067 {2068 type: 'animation', 2069 stimuli: animation_sequence, 2070 sequence_reps: 10,2071 frame_time: 30,2072 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',2073 choices: jsPsych.NO_KEYS 2074 },2075 {2076 type: 'html-keyboard-response',2077 stimulus: function(){2078 var data33_1 = jsPsych.data.get().last(8).values()[0];2079 var data34_1 = jsPsych.data.get().last(2).values()[0];2080 if(jsPsych.pluginAPI.compareKeys(data34_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_1.response, 'g')){2081 return jsPsych.timelineVariable('counter_green_coop_r18');2082 } else if(jsPsych.pluginAPI.compareKeys(data34_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_1.response, 'b')){2083 return jsPsych.timelineVariable('counter_green_defe_r18');2084 } else if(jsPsych.pluginAPI.compareKeys(data34_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data33_1.response, 'g')){2085 return jsPsych.timelineVariable('counter_blue_coop_r18');2086 } else {2087 return jsPsych.timelineVariable('counter_blue_defe_r18');2088 }2089 }2090 },2091 {2092 type: 'html-button-response',2093 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],2094 stimulus: function(){2095 var data33_2 = jsPsych.data.get().last(9).values()[0];2096 var data34_2 = jsPsych.data.get().last(3).values()[0];2097 if(jsPsych.pluginAPI.compareKeys(data34_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_2.response, 'g')){2098 return jsPsych.timelineVariable('par_gg_res');2099 } else if(jsPsych.pluginAPI.compareKeys(data34_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_2.response, 'b')){2100 return jsPsych.timelineVariable('par_gb_res');2101 } else if(jsPsych.pluginAPI.compareKeys(data34_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data33_2.response, 'g')){2102 return jsPsych.timelineVariable('par_bg_res');2103 } else {2104 return jsPsych.timelineVariable('par_bb_res');2105 }2106 }2107 },2108 {2109 type: 'html-keyboard-response',2110 stimulus: function(){2111 var data33_3 = jsPsych.data.get().last(10).values()[0];2112 var data34_3 = jsPsych.data.get().last(4).values()[0];2113 if(jsPsych.pluginAPI.compareKeys(data34_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_3.response, 'g')){2114 return jsPsych.timelineVariable('A35_gg_co_res');2115 } else if(jsPsych.pluginAPI.compareKeys(data34_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_3.response, 'b')){2116 return jsPsych.timelineVariable('A35_gb_co_res');2117 } else if(jsPsych.pluginAPI.compareKeys(data34_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data33_3.response, 'g')){2118 return jsPsych.timelineVariable('A35_bg_co_res');2119 } else {2120 return jsPsych.timelineVariable('A35_bb_co_res');2121 }2122 }2123 },2124 {2125 type: 'html-slider-response',2126 stimulus: function(){2127 var data33_4 = jsPsych.data.get().last(11).values()[0];2128 var data34_4 = jsPsych.data.get().last(5).values()[0];2129 if(jsPsych.pluginAPI.compareKeys(data34_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_4.response, 'g')){2130 return jsPsych.timelineVariable('A35_gg_co_res_sl');2131 } else if(jsPsych.pluginAPI.compareKeys(data34_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_4.response, 'b')){2132 return jsPsych.timelineVariable('A35_gb_co_res_sl');2133 } else if(jsPsych.pluginAPI.compareKeys(data34_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data33_4.response, 'g')){2134 return jsPsych.timelineVariable('A35_bg_co_res_sl');2135 } else {2136 return jsPsych.timelineVariable('A35_bb_co_res_sl');2137 }2138 },2139 labels: ['Likely BLUE', 'Likely GREEN']2140 },2141 {2142 type: 'image-keyboard-response',2143 stimulus: ['round19_matrix_c0.png'],2144 stimulus_width: 500,2145 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 2146 choices: ['g','b'],2147 on_finish: function(data){2148 // Score the response as correct or incorrect.2149 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){2150 data.correct = true;2151 } else {2152 data.correct = false; 2153 }2154 }2155 },2156 {2157 type: 'animation', 2158 stimuli: animation_sequence, 2159 sequence_reps: 10,2160 frame_time: 30,2161 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',2162 choices: jsPsych.NO_KEYS 2163 },2164 {2165 type: 'html-keyboard-response',2166 stimulus: function(){2167 var data35_1 = jsPsych.data.get().last(8).values()[0];2168 var data36_1 = jsPsych.data.get().last(2).values()[0];2169 if(jsPsych.pluginAPI.compareKeys(data36_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_1.response, 'g')){2170 return jsPsych.timelineVariable('counter_green_coop_r19');2171 } else if(jsPsych.pluginAPI.compareKeys(data36_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_1.response, 'b')){2172 return jsPsych.timelineVariable('counter_green_defe_r19');2173 } else if(jsPsych.pluginAPI.compareKeys(data36_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data35_1.response, 'g')){2174 return jsPsych.timelineVariable('counter_blue_coop_r19');2175 } else {2176 return jsPsych.timelineVariable('counter_blue_defe_r19');2177 }2178 }2179 },2180 {2181 type: 'html-button-response',2182 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],2183 stimulus: function(){2184 var data35_2 = jsPsych.data.get().last(9).values()[0];2185 var data36_2 = jsPsych.data.get().last(3).values()[0];2186 if(jsPsych.pluginAPI.compareKeys(data36_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_2.response, 'g')){2187 return jsPsych.timelineVariable('par_gg_res');2188 } else if(jsPsych.pluginAPI.compareKeys(data36_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_2.response, 'b')){2189 return jsPsych.timelineVariable('par_gb_res');2190 } else if(jsPsych.pluginAPI.compareKeys(data36_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data35_2.response, 'g')){2191 return jsPsych.timelineVariable('par_bg_res');2192 } else {2193 return jsPsych.timelineVariable('par_bb_res');2194 }2195 }2196 },2197 {2198 type: 'html-keyboard-response',2199 stimulus: function(){2200 var data35_3 = jsPsych.data.get().last(10).values()[0];2201 var data36_3 = jsPsych.data.get().last(4).values()[0];2202 if(jsPsych.pluginAPI.compareKeys(data36_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_3.response, 'g')){2203 return jsPsych.timelineVariable('A35_gg_co_res');2204 } else if(jsPsych.pluginAPI.compareKeys(data36_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_3.response, 'b')){2205 return jsPsych.timelineVariable('A35_gb_co_res');2206 } else if(jsPsych.pluginAPI.compareKeys(data36_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data35_3.response, 'g')){2207 return jsPsych.timelineVariable('A35_bg_co_res');2208 } else {2209 return jsPsych.timelineVariable('A35_bb_co_res');2210 }2211 }2212 },2213 {2214 type: 'html-slider-response',2215 stimulus: function(){2216 var data35_4 = jsPsych.data.get().last(11).values()[0];2217 var data36_4 = jsPsych.data.get().last(5).values()[0];2218 if(jsPsych.pluginAPI.compareKeys(data36_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_4.response, 'g')){2219 return jsPsych.timelineVariable('A35_gg_co_res_sl');2220 } else if(jsPsych.pluginAPI.compareKeys(data36_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_4.response, 'b')){2221 return jsPsych.timelineVariable('A35_gb_co_res_sl');2222 } else if(jsPsych.pluginAPI.compareKeys(data36_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data35_4.response, 'g')){2223 return jsPsych.timelineVariable('A35_bg_co_res_sl');2224 } else {2225 return jsPsych.timelineVariable('A35_bb_co_res_sl');2226 }2227 },2228 labels: ['Likely BLUE', 'Likely GREEN']2229 },2230 {2231 type: 'image-keyboard-response',2232 stimulus: ['round20_matrix_c0.png'],2233 stimulus_width: 500,2234 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 2235 choices: ['g','b'],2236 on_finish: function(data){2237 // Score the response as correct or incorrect.2238 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){2239 data.correct = true;2240 } else {2241 data.correct = false; 2242 }2243 }2244 },2245 {2246 type: 'animation', 2247 stimuli: animation_sequence, 2248 sequence_reps: 10,2249 frame_time: 30,2250 prompt: '<p> Waiting for Anonymous35 to invest ... </p>',2251 choices: jsPsych.NO_KEYS 2252 },2253 {2254 type: 'html-keyboard-response',2255 stimulus: function(){2256 var data37_1 = jsPsych.data.get().last(8).values()[0];2257 var data38_1 = jsPsych.data.get().last(2).values()[0];2258 if(jsPsych.pluginAPI.compareKeys(data38_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_1.response, 'g')){2259 return jsPsych.timelineVariable('counter_green_coop_r20');2260 } else if(jsPsych.pluginAPI.compareKeys(data38_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_1.response, 'b')){2261 return jsPsych.timelineVariable('counter_green_defe_r20');2262 } else if(jsPsych.pluginAPI.compareKeys(data38_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data37_1.response, 'g')){2263 return jsPsych.timelineVariable('counter_blue_coop_r20');2264 } else {2265 return jsPsych.timelineVariable('counter_blue_defe_r20');2266 }2267 }2268 },2269 {2270 type: 'html-button-response',2271 choices: ['A (Leftmost)', 'B', 'C', 'D', 'E (rightmost)'],2272 stimulus: function(){2273 var data37_2 = jsPsych.data.get().last(9).values()[0];2274 var data38_2 = jsPsych.data.get().last(3).values()[0];2275 if(jsPsych.pluginAPI.compareKeys(data38_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_2.response, 'g')){2276 return jsPsych.timelineVariable('par_gg_res');2277 } else if(jsPsych.pluginAPI.compareKeys(data38_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_2.response, 'b')){2278 return jsPsych.timelineVariable('par_gb_res');2279 } else if(jsPsych.pluginAPI.compareKeys(data38_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data37_2.response, 'g')){2280 return jsPsych.timelineVariable('par_bg_res');2281 } else {2282 return jsPsych.timelineVariable('par_bb_res');2283 }2284 }2285 },2286 {2287 type: 'html-keyboard-response',2288 stimulus: function(){2289 var data37_3 = jsPsych.data.get().last(10).values()[0];2290 var data38_3 = jsPsych.data.get().last(4).values()[0];2291 if(jsPsych.pluginAPI.compareKeys(data38_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_3.response, 'g')){2292 return jsPsych.timelineVariable('A35_gg_co_res');2293 } else if(jsPsych.pluginAPI.compareKeys(data38_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_3.response, 'b')){2294 return jsPsych.timelineVariable('A35_gb_co_res');2295 } else if(jsPsych.pluginAPI.compareKeys(data38_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data37_3.response, 'g')){2296 return jsPsych.timelineVariable('A35_bg_co_res');2297 } else {2298 return jsPsych.timelineVariable('A35_bb_co_res');2299 }2300 }2301 },2302 {2303 type: 'html-slider-response',2304 stimulus: function(){2305 var data37_4 = jsPsych.data.get().last(11).values()[0];2306 var data38_4 = jsPsych.data.get().last(5).values()[0];2307 if(jsPsych.pluginAPI.compareKeys(data38_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_4.response, 'g')){2308 return jsPsych.timelineVariable('A35_gg_co_res_sl');2309 } else if(jsPsych.pluginAPI.compareKeys(data38_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_4.response, 'b')){2310 return jsPsych.timelineVariable('A35_gb_co_res_sl');2311 } else if(jsPsych.pluginAPI.compareKeys(data38_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data37_4.response, 'g')){2312 return jsPsych.timelineVariable('A35_bg_co_res_sl');2313 } else {2314 return jsPsych.timelineVariable('A35_bb_co_res_sl');2315 }2316 },2317 labels: ['Likely BLUE', 'Likely GREEN']2318 }2319 ],2320 timeline_variables: [2321 { par_gg_res: `<p> How do you feel about this outcome? </p> <img src = "par_str_gg.gif" height="300"></img>`,2322 par_bg_res: `<p> How do you feel about this outcome? </p> <img src = "par_str_bg.gif" height="300"></img>`,2323 par_gb_res: `<p> How do you feel about this outcome? </p> <img src = "par_str_gb.gif" height="300"></img>`,2324 par_bb_res: `<p> How do you feel about this outcome? </p> <img src = "par_str_bb.gif" height="300"></img>`,2325 A35_gg_co_res: `<p> This is how Anonymous35 feels about this outcome. </p> <img src = "A35_gg_co_res.png" height="200"></img> <p> Press any key to continue. </p>`,2326 A35_bg_co_res: `<p> This is how Anonymous35 feels about this outcome. </p> <img src = "A35_bg_co_res.png" height="200"></img> <p> Press any key to continue. </p>`,2327 A35_gb_co_res: `<p> This is how Anonymous35 feels about this outcome. </p> <img src = "A35_gb_co_res.png" height="200"></img> <p> Press any key to continue. </p>`,2328 A35_bb_co_res: `<p> This is how Anonymous35 feels about this outcome. </p> <img src = "A35_bb_co_res.png" height="200"></img> <p> Press any key to continue. </p>`,2329 A35_gg_co_res_sl: `<p> How likely is Anonymous35 to choose GREEN in the next round?</p> <img src = "A35_gg_co_res.png" height="200"></img>`,2330 A35_bg_co_res_sl: `<p> How likely is Anonymous35 to choose GREEN in the next round?</p> <img src = "A35_bg_co_res.png" height="200"></img>`,2331 A35_gb_co_res_sl: `<p> How likely is Anonymous35 to choose GREEN in the next round?</p> <img src = "A35_gb_co_res.png" height="200"></img>`,2332 A35_bb_co_res_sl: `<p> How likely is Anonymous35 to choose GREEN in the next round?</p> <img src = "A35_bb_co_res.png" height="200"></img>`,2333 counter_green_coop_r1: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>GREEN</strong>. You <strong>each</strong> received <strong>5 points</strong>. Press any key to proceed. </p>",2334 counter_blue_coop_r1: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed. </p>",2335 counter_green_coop_r2: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>GREEN</strong>. You <strong>each</strong> received <strong>5 points</strong>. Press any key to proceed to Round 3. </p>" , 2336 counter_blue_coop_r2: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 3. </p>",2337 counter_green_defe_r2: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 3. </p>", 2338 counter_blue_defe_r2: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 3. </p>",2339 counter_green_coop_r3: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>GREEN</strong>. You <strong>each</strong> received <strong>5 points</strong>. Press any key to proceed to Round 4. </p>" , 2340 counter_blue_coop_r3: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 4. </p>",2341 counter_green_defe_r3: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 4. </p>", 2342 counter_blue_defe_r3: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 4. </p>",2343 counter_green_coop_r4: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>GREEN</strong>. You <strong>each</strong> received <strong>5 points</strong>. Press any key to proceed to Round 5. </p>" , 2344 counter_blue_coop_r4: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 5. </p>",2345 counter_green_defe_r4: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 5. </p>", 2346 counter_blue_defe_r4: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 5. </p>",2347 counter_green_coop_r5: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>GREEN</strong>. You <strong>each</strong> received <strong>5 points</strong>. Press any key to proceed to Round 6. </p>" , 2348 counter_blue_coop_r5: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 6. </p>",2349 counter_green_defe_r5: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 6. </p>", 2350 counter_blue_defe_r5: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 6. </p>",2351 counter_green_coop_r6: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>GREEN</strong>. You <strong>each</strong> received <strong>5 points</strong>. Press any key to proceed to Round 7. </p>" , 2352 counter_blue_coop_r6: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 7. </p>",2353 counter_green_defe_r6: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 7. </p>", 2354 counter_blue_defe_r6: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 7. </p>",2355 counter_blue_coop_r7: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 8. </p>",2356 counter_green_defe_r7: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 8. </p>", 2357 counter_blue_defe_r7: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 8. </p>",2358 counter_blue_defe_r7: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 8. </p>",2359 counter_blue_coop_r8: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 9. </p>",2360 counter_green_defe_r8: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 9. </p>", 2361 counter_blue_defe_r8: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 9. </p>",2362 counter_blue_defe_r8: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 9. </p>",2363 counter_blue_coop_r9: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 10. </p>",2364 counter_green_defe_r9: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 10. </p>", 2365 counter_blue_defe_r9: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 10. </p>",2366 counter_blue_defe_r9: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 10. </p>",2367 counter_blue_coop_r10: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 11. </p>",2368 counter_green_defe_r10: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 11. </p>", 2369 counter_blue_defe_r10: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 11. </p>",2370 counter_blue_defe_r10: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 11. </p>",2371 counter_blue_coop_r11: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 12. </p>",2372 counter_green_defe_r11: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 12. </p>", 2373 counter_blue_defe_r11: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 12. </p>",2374 counter_blue_defe_r11: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 12. </p>",2375 counter_blue_coop_r12: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 13. </p>",2376 counter_green_defe_r12: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 13. </p>", 2377 counter_blue_defe_r12: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 13. </p>",2378 counter_blue_defe_r12: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 13. </p>",2379 counter_blue_coop_r13: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 14. </p>",2380 counter_green_defe_r13: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 14. </p>", 2381 counter_blue_defe_r13: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 14. </p>",2382 counter_blue_defe_r13: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 14. </p>",2383 counter_blue_coop_r14: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 15. </p>",2384 counter_green_defe_r14: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 15. </p>", 2385 counter_blue_defe_r14: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 15. </p>",2386 counter_blue_defe_r14: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 15. </p>",2387 counter_blue_coop_r15: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 16. </p>",2388 counter_green_defe_r15: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 16. </p>", 2389 counter_blue_defe_r15: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 16. </p>",2390 counter_blue_defe_r15: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 16. </p>",2391 counter_blue_coop_r16: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 17. </p>",2392 counter_green_defe_r16: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 17. </p>", 2393 counter_blue_defe_r16: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 17. </p>",2394 counter_blue_defe_r16: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 17. </p>",2395 counter_blue_coop_r17: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 18. </p>",2396 counter_green_defe_r17: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 18. </p>", 2397 counter_blue_defe_r17: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 18. </p>",2398 counter_blue_defe_r17: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 18. </p>",2399 counter_blue_coop_r18: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 19. </p>",2400 counter_green_defe_r18: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 19. </p>", 2401 counter_blue_defe_r18: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 19. </p>",2402 counter_blue_defe_r18: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 19. </p>",2403 counter_blue_coop_r19: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed to Round 20. </p>",2404 counter_green_defe_r19: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed to Round 20. </p>", 2405 counter_blue_defe_r19: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 20. </p>",2406 counter_blue_defe_r19: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed to Round 20. </p>",2407 counter_blue_coop_r20: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>GREEN</strong>. You received <strong>7 points</strong>. Anonymous35 received <strong>2 points</strong>. Press any key to proceed. </p>",2408 counter_green_defe_r20: "<p> You chose <strong>GREEN</strong>. Anonymous35 chose <strong>BLUE</strong>. You received <strong>2 points</strong>. Anonymous35 received <strong>7 points</strong>. Press any key to proceed. </p>", 2409 counter_blue_defe_r20: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed. </p>",2410 counter_blue_defe_r20: "<p> You chose <strong>BLUE</strong>. Anonymous35 chose <strong>BLUE</strong>. You <strong>each</strong> received <strong>3 points</strong>. Press any key to proceed. </p>"2411 }2412 ]2413}2414var ipd_intro_c1 = {2415 type: 'html-button-response',2416 stimulus: 2417 `2418 <p> You will be playing another 20 rounds with a different participant online who is also beginning the second trial. As a reminder, the previous trial was a practice trial. Starting with this trial, your score will count towards calculating the amount of tickets for the $50 lottery pool. </p>2419 <p> Press <strong>continue </strong> to proceed.</p>2420 `,2421 choices: ['Continue']2422}2423var ipd_anony_c1 = {2424 type: 'html-button-response',2425 stimulus: 2426 `2427 <p>Your ID will be <strong> Anonymous16</strong>. The other participant's ID is <strong> Anonymous17 </strong>.</p>2428 <p> Press <strong>continue </strong> to proceed.</p>2429 `,2430 choices: ['Continue']2431}2432var ipd_charac_dec_c1 = {2433 type: 'html-button-response',2434 stimulus: 2435 `2436 <p> In order to guarantee anonymity, you (<strong>Anonymous16</strong>) and the other participant (<strong>Anonymous17</strong>) will be providing emotional feedback to each other using a randomly assigned, different face. </p>2437 <p> Press <strong>continue </strong> to proceed. </p>2438 `,2439 choices: ['Continue']2440}2441var animation_seq_A17 = ['loading_1.jpg', 'loading_2.jpg', 'loading_3.jpg', 'loading_4.jpg', 'loading_5.jpg',2442 'loading_6.jpg', 'loading_7.jpg', 'loading_8.jpg', 'loading_9.jpg', 'loading_10.jpg', 'loading_11.jpg', 'loading_12.jpg',2443 'loading_13.jpg', 'loading_14.jpg', 'loading_15.jpg', 'loading_16.jpg', 'loading_17.jpg', 'loading_18.jpg', 'loading_19.jpg',2444 'loading_20.jpg', 'loading_21.jpg', 'loading_22.jpg', 'loading_23.jpg', 'loading_24.jpg', 'loading_25.jpg', 'loading_26.jpg',2445 'loading_27.jpg', 'loading_28.jpg', 'loading_29.jpg', 'loading_1.jpg', 'loading_2.jpg', 'loading_3.jpg', 'loading_4.jpg', 'loading_5.jpg',2446 'loading_6.jpg', 'loading_7.jpg', 'loading_8.jpg', 'loading_9.jpg', 'loading_10.jpg', 'loading_11.jpg', 'loading_12.jpg',2447 'loading_13.jpg', 'loading_14.jpg', 'loading_15.jpg', 'loading_16.jpg', 'loading_17.jpg', 'loading_18.jpg', 'loading_19.jpg',2448 'loading_20.jpg', 'loading_21.jpg', 'loading_22.jpg', 'loading_23.jpg', 'loading_24.jpg', 'loading_25.jpg', 'loading_26.jpg',2449 'loading_27.jpg', 'loading_28.jpg', 'loading_29.jpg', 'loading_1.jpg', 'loading_2.jpg', 'loading_3.jpg', 'loading_4.jpg', 'loading_5.jpg',2450 'loading_6.jpg', 'loading_7.jpg', 'loading_8.jpg', 'loading_9.jpg', 'loading_10.jpg', 'loading_11.jpg', 'loading_12.jpg',2451 'loading_13.jpg', 'loading_14.jpg', 'loading_15.jpg', 'loading_16.jpg', 'loading_17.jpg', 'loading_18.jpg', 'loading_19.jpg',2452 'loading_20.jpg', 'loading_21.jpg', 'loading_22.jpg', 'loading_23.jpg', 'loading_24.jpg', 'loading_25.jpg', 'loading_26.jpg',2453 'loading_27.jpg', 'loading_28.jpg', 'loading_29.jpg', 'A17_neutral.png']2454var ipd_charac_A17_anim = {2455 type: 'animation', 2456 stimuli: animation_seq_A17, 2457 sequence_reps: 1,2458 frame_time: 35,2459 prompt: '<p> Please wait while a random facial character is generated for the other participant in the room ... </p>',2460 choices: jsPsych.NO_KEYS 2461}2462var ipd_charac_A17 = {2463 type: 'image-button-response', 2464 stimulus: 'A17_neutral.png', 2465 stimulus_width: 200,2466 prompt: `<p> This will be the facial character for the other participant (<strong>Anonymous17</strong>) throughout this task. </p>2467 <p> Press <strong>continue </strong> to proceed. </p>`,2468 choices: ['Continue']2469}2470var ipd_instr_c1 = {2471 type: 'image-button-response', 2472 stimulus: 'ipd_matrix.png', 2473 stimulus_width: 350, 2474 prompt: '<p> Press <strong> continue </strong> to enter the room and start the second trial. </p>',2475 choices: ['Continue'], 2476 button_html: ['<button class="jspsych-btn" style = "position:absolute; left:280px; top: 230px">%choice%</button>']2477}2478var ipd_connect_c1 = {2479 type: 'animation', 2480 stimuli: animation_sequence, 2481 sequence_reps: 20,2482 frame_time: 30,2483 prompt: '<p> Waiting for Anonymous17 to enter the room... </p>',2484 choices: jsPsych.NO_KEYS 2485}2486var ipd_c1_procedure = {2487 timeline: [2488 {2489 type: 'image-keyboard-response',2490 stimulus: ['round1_matrix.png'],2491 stimulus_width: 500,2492 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 2493 choices: ['g','b'],2494 on_finish: function(data){2495 // Score the response as correct or incorrect.2496 if(jsPsych.pluginAPI.compareKeys(data.response, 'g')){2497 data.correct = true;2498 } else {2499 data.correct = false; 2500 }2501 }2502 },2503 {2504 type: 'animation', 2505 stimuli: animation_sequence, 2506 sequence_reps: 10,2507 frame_time: 30,2508 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',2509 choices: jsPsych.NO_KEYS 2510 },2511 {2512 type: 'html-keyboard-response',2513 stimulus: function(){2514 var round1_coop_1 = jsPsych.data.get().last(2).values()[0].correct;2515 if(round1_coop_1){2516 return jsPsych.timelineVariable('counter_green_coop_r1');2517 } else {2518 return jsPsych.timelineVariable('counter_blue_coop_r1');2519 }2520 }2521 },2522 {2523 type: 'html-button-response',2524 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],2525 stimulus: function(){2526 var round1_coop_2 = jsPsych.data.get().last(3).values()[0].correct;2527 if(round1_coop_2){2528 return jsPsych.timelineVariable('par_gg_res');2529 } else {2530 return jsPsych.timelineVariable('par_bg_res');2531 }2532 }2533 },2534 {2535 type: 'html-keyboard-response',2536 stimulus: function(){2537 var round1_coop_3 = jsPsych.data.get().last(4).values()[0].correct;2538 if(round1_coop_3){2539 return jsPsych.timelineVariable('A17_gg_co_res');2540 } else {2541 return jsPsych.timelineVariable('A17_bg_co_res');2542 }2543 }2544 },2545 {2546 type: 'html-slider-response',2547 stimulus: function(){2548 var round1_coop_4 = jsPsych.data.get().last(5).values()[0].correct;2549 if(round1_coop_4){2550 return jsPsych.timelineVariable('A17_gg_co_res_sl');2551 } else {2552 return jsPsych.timelineVariable('A17_bg_co_res_sl');2553 }2554 },2555 labels: ['Likely BLUE', 'Likely GREEN']2556 },2557 {2558 type: 'image-keyboard-response',2559 stimulus: ['round2_matrix.png'],2560 stimulus_width: 500,2561 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 2562 choices: ['g','b'],2563 on_finish: function(data){2564 // Score the response as correct or incorrect.2565 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){2566 data.correct = true;2567 } else {2568 data.correct = false; 2569 }2570 }2571 },2572 {2573 type: 'animation', 2574 stimuli: animation_sequence, 2575 sequence_reps: 10,2576 frame_time: 30,2577 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',2578 choices: jsPsych.NO_KEYS 2579 },2580 {2581 type: 'html-keyboard-response',2582 stimulus: function(){2583 // get the data from the previous trial,2584 // and check which key was pressed2585 var data1_1 = jsPsych.data.get().last(8).values()[0];2586 var data2_1 = jsPsych.data.get().last(2).values()[0];2587 if(jsPsych.pluginAPI.compareKeys(data2_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_1.response, 'g')){2588 return jsPsych.timelineVariable('counter_green_coop_r2');2589 } else if(jsPsych.pluginAPI.compareKeys(data2_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_1.response, 'b')){2590 return jsPsych.timelineVariable('counter_green_defe_r2');2591 } else if(jsPsych.pluginAPI.compareKeys(data2_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data1_1.response, 'g')){2592 return jsPsych.timelineVariable('counter_blue_coop_r2');2593 } else {2594 return jsPsych.timelineVariable('counter_blue_defe_r2');2595 }2596 }2597 },2598 {2599 type: 'html-button-response',2600 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],2601 stimulus: function(){2602 var data1_2 = jsPsych.data.get().last(9).values()[0];2603 var data2_2 = jsPsych.data.get().last(3).values()[0];2604 if(jsPsych.pluginAPI.compareKeys(data2_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_2.response, 'g')){2605 return jsPsych.timelineVariable('par_gg_res');2606 } else if(jsPsych.pluginAPI.compareKeys(data2_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_2.response, 'b')){2607 return jsPsych.timelineVariable('par_gb_res');2608 } else if(jsPsych.pluginAPI.compareKeys(data2_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data1_2.response, 'g')){2609 return jsPsych.timelineVariable('par_bg_res');2610 } else {2611 return jsPsych.timelineVariable('par_bb_res');2612 }2613 }2614 },2615 {2616 type: 'image-keyboard-response', 2617 stimulus: function(){2618 var data1_3 = jsPsych.data.get().last(10).values()[0];2619 var data2_3 = jsPsych.data.get().last(4).values()[0];2620 if(jsPsych.pluginAPI.compareKeys(data2_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_3.response, 'g')){2621 return jsPsych.timelineVariable('par_str_gg');2622 } else if(jsPsych.pluginAPI.compareKeys(data2_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_3.response, 'b')){2623 return jsPsych.timelineVariable('par_str_gb');2624 } else if(jsPsych.pluginAPI.compareKeys(data2_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data1_3.response, 'g')){2625 return jsPsych.timelineVariable('par_str_bg');2626 } else {2627 return jsPsych.timelineVariable('par_str_bb');2628 }2629 }2630 },2631 {2632 type: 'html-keyboard-response',2633 stimulus: function(){2634 var data1_4 = jsPsych.data.get().last(11).values()[0];2635 var data2_4 = jsPsych.data.get().last(5).values()[0];2636 if(jsPsych.pluginAPI.compareKeys(data2_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_3.response, 'g')){2637 return jsPsych.timelineVariable('A17_gg_co_res');2638 } else if(jsPsych.pluginAPI.compareKeys(data2_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_3.response, 'b')){2639 return jsPsych.timelineVariable('A17_gb_co_res');2640 } else if(jsPsych.pluginAPI.compareKeys(data2_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data1_3.response, 'g')){2641 return jsPsych.timelineVariable('A17_bg_co_res');2642 } else {2643 return jsPsych.timelineVariable('A17_bb_co_res');2644 }2645 }2646 },2647 {2648 type: 'html-slider-response',2649 stimulus: function(){2650 var data1_5 = jsPsych.data.get().last(12).values()[0];2651 var data2_5 = jsPsych.data.get().last(6).values()[0];2652 if(jsPsych.pluginAPI.compareKeys(data2_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_4.response, 'g')){2653 return jsPsych.timelineVariable('A17_gg_co_res_sl');2654 } else if(jsPsych.pluginAPI.compareKeys(data2_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data1_4.response, 'b')){2655 return jsPsych.timelineVariable('A17_gb_co_res_sl');2656 } else if(jsPsych.pluginAPI.compareKeys(data2_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data1_4.response, 'g')){2657 return jsPsych.timelineVariable('A17_bg_co_res_sl');2658 } else {2659 return jsPsych.timelineVariable('A17_bb_co_res_sl');2660 }2661 },2662 labels: ['Likely BLUE', 'Likely GREEN']2663 },2664 {2665 type: 'image-keyboard-response',2666 stimulus: ['round3_matrix.png'],2667 stimulus_width: 500,2668 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 2669 choices: ['g','b'],2670 on_finish: function(data){2671 // Score the response as correct or incorrect.2672 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){2673 data.correct = true;2674 } else {2675 data.correct = false; 2676 }2677 }2678 },2679 {2680 type: 'animation', 2681 stimuli: animation_sequence, 2682 sequence_reps: 10,2683 frame_time: 30,2684 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',2685 choices: jsPsych.NO_KEYS 2686 },2687 {2688 type: 'html-keyboard-response',2689 stimulus: function(){2690 var data3_1 = jsPsych.data.get().last(8).values()[0];2691 var data4_1 = jsPsych.data.get().last(2).values()[0];2692 if(jsPsych.pluginAPI.compareKeys(data4_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_1.response, 'g')){2693 return jsPsych.timelineVariable('counter_green_coop_r3');2694 } else if(jsPsych.pluginAPI.compareKeys(data4_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_1.response, 'b')){2695 return jsPsych.timelineVariable('counter_green_defe_r3');2696 } else if(jsPsych.pluginAPI.compareKeys(data4_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data3_1.response, 'g')){2697 return jsPsych.timelineVariable('counter_blue_coop_r3');2698 } else {2699 return jsPsych.timelineVariable('counter_blue_defe_r3');2700 }2701 }2702 },2703 {2704 type: 'html-button-response',2705 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],2706 stimulus: function(){2707 var data3_2 = jsPsych.data.get().last(9).values()[0];2708 var data4_2 = jsPsych.data.get().last(3).values()[0];2709 if(jsPsych.pluginAPI.compareKeys(data4_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_2.response, 'g')){2710 return jsPsych.timelineVariable('par_gg_res');2711 } else if(jsPsych.pluginAPI.compareKeys(data4_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_2.response, 'b')){2712 return jsPsych.timelineVariable('par_gb_res');2713 } else if(jsPsych.pluginAPI.compareKeys(data4_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data3_2.response, 'g')){2714 return jsPsych.timelineVariable('par_bg_res');2715 } else {2716 return jsPsych.timelineVariable('par_bb_res');2717 }2718 }2719 },2720 {2721 type: 'html-keyboard-response',2722 stimulus: function(){2723 var data3_3 = jsPsych.data.get().last(10).values()[0];2724 var data4_3 = jsPsych.data.get().last(4).values()[0];2725 if(jsPsych.pluginAPI.compareKeys(data4_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_3.response, 'g')){2726 return jsPsych.timelineVariable('A17_gg_co_res');2727 } else if(jsPsych.pluginAPI.compareKeys(data4_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_3.response, 'b')){2728 return jsPsych.timelineVariable('A17_gb_co_res');2729 } else if(jsPsych.pluginAPI.compareKeys(data4_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data3_3.response, 'g')){2730 return jsPsych.timelineVariable('A17_bg_co_res');2731 } else {2732 return jsPsych.timelineVariable('A17_bb_co_res');2733 }2734 }2735 },2736 {2737 type: 'html-slider-response',2738 stimulus: function(){2739 var data3_4 = jsPsych.data.get().last(11).values()[0];2740 var data4_4 = jsPsych.data.get().last(5).values()[0];2741 if(jsPsych.pluginAPI.compareKeys(data4_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_4.response, 'g')){2742 return jsPsych.timelineVariable('A17_gg_co_res_sl');2743 } else if(jsPsych.pluginAPI.compareKeys(data4_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data3_4.response, 'b')){2744 return jsPsych.timelineVariable('A17_gb_co_res_sl');2745 } else if(jsPsych.pluginAPI.compareKeys(data4_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data3_4.response, 'g')){2746 return jsPsych.timelineVariable('A17_bg_co_res_sl');2747 } else {2748 return jsPsych.timelineVariable('A17_bb_co_res_sl');2749 }2750 },2751 labels: ['Likely BLUE', 'Likely GREEN']2752 },2753 {2754 type: 'image-keyboard-response',2755 stimulus: ['round4_matrix.png'],2756 stimulus_width: 500,2757 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 2758 choices: ['g','b'],2759 on_finish: function(data){2760 // Score the response as correct or incorrect.2761 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){2762 data.correct = true;2763 } else {2764 data.correct = false; 2765 }2766 }2767 },2768 {2769 type: 'animation', 2770 stimuli: animation_sequence, 2771 sequence_reps: 10,2772 frame_time: 30,2773 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',2774 choices: jsPsych.NO_KEYS 2775 },2776 {2777 type: 'html-keyboard-response',2778 stimulus: function(){2779 var data5_1 = jsPsych.data.get().last(8).values()[0];2780 var data6_1 = jsPsych.data.get().last(2).values()[0];2781 if(jsPsych.pluginAPI.compareKeys(data6_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_1.response, 'g')){2782 return jsPsych.timelineVariable('counter_green_coop_r4');2783 } else if(jsPsych.pluginAPI.compareKeys(data6_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_1.response, 'b')){2784 return jsPsych.timelineVariable('counter_green_defe_r4');2785 } else if(jsPsych.pluginAPI.compareKeys(data6_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data5_1.response, 'g')){2786 return jsPsych.timelineVariable('counter_blue_coop_r4');2787 } else {2788 return jsPsych.timelineVariable('counter_blue_defe_r4');2789 }2790 }2791 },2792 {2793 type: 'html-button-response',2794 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],2795 stimulus: function(){2796 var data5_2 = jsPsych.data.get().last(9).values()[0];2797 var data6_2 = jsPsych.data.get().last(3).values()[0];2798 if(jsPsych.pluginAPI.compareKeys(data6_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_2.response, 'g')){2799 return jsPsych.timelineVariable('par_gg_res');2800 } else if(jsPsych.pluginAPI.compareKeys(data6_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_2.response, 'b')){2801 return jsPsych.timelineVariable('par_gb_res');2802 } else if(jsPsych.pluginAPI.compareKeys(data6_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data5_2.response, 'g')){2803 return jsPsych.timelineVariable('par_bg_res');2804 } else {2805 return jsPsych.timelineVariable('par_bb_res');2806 }2807 }2808 },2809 {2810 type: 'html-keyboard-response',2811 stimulus: function(){2812 var data5_3 = jsPsych.data.get().last(10).values()[0];2813 var data6_3 = jsPsych.data.get().last(4).values()[0];2814 if(jsPsych.pluginAPI.compareKeys(data6_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_3.response, 'g')){2815 return jsPsych.timelineVariable('A17_gg_co_res');2816 } else if(jsPsych.pluginAPI.compareKeys(data6_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_3.response, 'b')){2817 return jsPsych.timelineVariable('A17_gb_co_res');2818 } else if(jsPsych.pluginAPI.compareKeys(data6_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data5_3.response, 'g')){2819 return jsPsych.timelineVariable('A17_bg_co_res');2820 } else {2821 return jsPsych.timelineVariable('A17_bb_co_res');2822 }2823 }2824 },2825 {2826 type: 'html-slider-response',2827 stimulus: function(){2828 var data5_4 = jsPsych.data.get().last(11).values()[0];2829 var data6_4 = jsPsych.data.get().last(5).values()[0];2830 if(jsPsych.pluginAPI.compareKeys(data6_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_4.response, 'g')){2831 return jsPsych.timelineVariable('A17_gg_co_res_sl');2832 } else if(jsPsych.pluginAPI.compareKeys(data6_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data5_4.response, 'b')){2833 return jsPsych.timelineVariable('A17_gb_co_res_sl');2834 } else if(jsPsych.pluginAPI.compareKeys(data6_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data5_4.response, 'g')){2835 return jsPsych.timelineVariable('A17_bg_co_res_sl');2836 } else {2837 return jsPsych.timelineVariable('A17_bb_co_res_sl');2838 }2839 },2840 labels: ['Likely BLUE', 'Likely GREEN']2841 },2842 {2843 type: 'image-keyboard-response',2844 stimulus: ['round5_matrix.png'],2845 stimulus_width: 500,2846 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 2847 choices: ['g','b'],2848 on_finish: function(data){2849 // Score the response as correct or incorrect.2850 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){2851 data.correct = true;2852 } else {2853 data.correct = false; 2854 }2855 }2856 },2857 {2858 type: 'animation', 2859 stimuli: animation_sequence, 2860 sequence_reps: 10,2861 frame_time: 30,2862 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',2863 choices: jsPsych.NO_KEYS 2864 },2865 {2866 type: 'html-keyboard-response',2867 stimulus: function(){2868 var data7_1 = jsPsych.data.get().last(8).values()[0];2869 var data8_1 = jsPsych.data.get().last(2).values()[0];2870 if(jsPsych.pluginAPI.compareKeys(data8_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_1.response, 'g')){2871 return jsPsych.timelineVariable('counter_green_coop_r5');2872 } else if(jsPsych.pluginAPI.compareKeys(data8_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_1.response, 'b')){2873 return jsPsych.timelineVariable('counter_green_defe_r5');2874 } else if(jsPsych.pluginAPI.compareKeys(data8_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data7_1.response, 'g')){2875 return jsPsych.timelineVariable('counter_blue_coop_r5');2876 } else {2877 return jsPsych.timelineVariable('counter_blue_defe_r5');2878 }2879 }2880 },2881 {2882 type: 'html-button-response',2883 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],2884 stimulus: function(){2885 var data7_2 = jsPsych.data.get().last(9).values()[0];2886 var data8_2 = jsPsych.data.get().last(3).values()[0];2887 if(jsPsych.pluginAPI.compareKeys(data8_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_2.response, 'g')){2888 return jsPsych.timelineVariable('par_gg_res');2889 } else if(jsPsych.pluginAPI.compareKeys(data8_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_2.response, 'b')){2890 return jsPsych.timelineVariable('par_gb_res');2891 } else if(jsPsych.pluginAPI.compareKeys(data8_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data7_2.response, 'g')){2892 return jsPsych.timelineVariable('par_bg_res');2893 } else {2894 return jsPsych.timelineVariable('par_bb_res');2895 }2896 }2897 },2898 {2899 type: 'html-keyboard-response',2900 stimulus: function(){2901 var data7_3 = jsPsych.data.get().last(10).values()[0];2902 var data8_3 = jsPsych.data.get().last(4).values()[0];2903 if(jsPsych.pluginAPI.compareKeys(data8_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_3.response, 'g')){2904 return jsPsych.timelineVariable('A17_gg_co_res');2905 } else if(jsPsych.pluginAPI.compareKeys(data8_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_3.response, 'b')){2906 return jsPsych.timelineVariable('A17_gb_co_res');2907 } else if(jsPsych.pluginAPI.compareKeys(data8_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data7_3.response, 'g')){2908 return jsPsych.timelineVariable('A17_bg_co_res');2909 } else {2910 return jsPsych.timelineVariable('A17_bb_co_res');2911 }2912 }2913 },2914 {2915 type: 'html-slider-response',2916 stimulus: function(){2917 var data7_4 = jsPsych.data.get().last(11).values()[0];2918 var data8_4 = jsPsych.data.get().last(5).values()[0];2919 if(jsPsych.pluginAPI.compareKeys(data8_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_4.response, 'g')){2920 return jsPsych.timelineVariable('A17_gg_co_res_sl');2921 } else if(jsPsych.pluginAPI.compareKeys(data8_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data7_4.response, 'b')){2922 return jsPsych.timelineVariable('A17_gb_co_res_sl');2923 } else if(jsPsych.pluginAPI.compareKeys(data8_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data7_4.response, 'g')){2924 return jsPsych.timelineVariable('A17_bg_co_res_sl');2925 } else {2926 return jsPsych.timelineVariable('A17_bb_co_res_sl');2927 }2928 },2929 labels: ['Likely BLUE', 'Likely GREEN']2930 },2931 {2932 type: 'image-keyboard-response',2933 stimulus: ['round6_matrix.png'],2934 stimulus_width: 500,2935 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 2936 choices: ['g','b'],2937 on_finish: function(data){2938 // Score the response as correct or incorrect.2939 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){2940 data.correct = true;2941 } else {2942 data.correct = false; 2943 }2944 }2945 },2946 {2947 type: 'animation', 2948 stimuli: animation_sequence, 2949 sequence_reps: 10,2950 frame_time: 30,2951 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',2952 choices: jsPsych.NO_KEYS 2953 },2954 {2955 type: 'html-keyboard-response',2956 stimulus: function(){2957 var data9_1 = jsPsych.data.get().last(8).values()[0];2958 var data10_1 = jsPsych.data.get().last(2).values()[0];2959 if(jsPsych.pluginAPI.compareKeys(data10_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_1.response, 'g')){2960 return jsPsych.timelineVariable('counter_green_coop_r6');2961 } else if(jsPsych.pluginAPI.compareKeys(data10_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_1.response, 'b')){2962 return jsPsych.timelineVariable('counter_green_defe_r6');2963 } else if(jsPsych.pluginAPI.compareKeys(data10_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data9_1.response, 'g')){2964 return jsPsych.timelineVariable('counter_blue_coop_r6');2965 } else {2966 return jsPsych.timelineVariable('counter_blue_defe_r6');2967 }2968 }2969 },2970 {2971 type: 'html-button-response',2972 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],2973 stimulus: function(){2974 var data9_2 = jsPsych.data.get().last(9).values()[0];2975 var data10_2 = jsPsych.data.get().last(3).values()[0];2976 if(jsPsych.pluginAPI.compareKeys(data10_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_2.response, 'g')){2977 return jsPsych.timelineVariable('par_gg_res');2978 } else if(jsPsych.pluginAPI.compareKeys(data10_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_2.response, 'b')){2979 return jsPsych.timelineVariable('par_gb_res');2980 } else if(jsPsych.pluginAPI.compareKeys(data10_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data9_2.response, 'g')){2981 return jsPsych.timelineVariable('par_bg_res');2982 } else {2983 return jsPsych.timelineVariable('par_bb_res');2984 }2985 }2986 },2987 {2988 type: 'html-keyboard-response',2989 stimulus: function(){2990 var data9_3 = jsPsych.data.get().last(10).values()[0];2991 var data10_3 = jsPsych.data.get().last(4).values()[0];2992 if(jsPsych.pluginAPI.compareKeys(data10_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_3.response, 'g')){2993 return jsPsych.timelineVariable('A17_gg_co_res');2994 } else if(jsPsych.pluginAPI.compareKeys(data10_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_3.response, 'b')){2995 return jsPsych.timelineVariable('A17_gb_co_res');2996 } else if(jsPsych.pluginAPI.compareKeys(data10_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data9_3.response, 'g')){2997 return jsPsych.timelineVariable('A17_bg_co_res');2998 } else {2999 return jsPsych.timelineVariable('A17_bb_co_res');3000 }3001 }3002 },3003 {3004 type: 'html-slider-response',3005 stimulus: function(){3006 var data9_4 = jsPsych.data.get().last(11).values()[0];3007 var data10_4 = jsPsych.data.get().last(5).values()[0];3008 if(jsPsych.pluginAPI.compareKeys(data10_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_4.response, 'g')){3009 return jsPsych.timelineVariable('A17_gg_co_res_sl');3010 } else if(jsPsych.pluginAPI.compareKeys(data10_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data9_4.response, 'b')){3011 return jsPsych.timelineVariable('A17_gb_co_res_sl');3012 } else if(jsPsych.pluginAPI.compareKeys(data10_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data9_4.response, 'g')){3013 return jsPsych.timelineVariable('A17_bg_co_res_sl');3014 } else {3015 return jsPsych.timelineVariable('A17_bb_co_res_sl');3016 }3017 },3018 labels: ['Likely BLUE', 'Likely GREEN']3019 },3020 {3021 type: 'image-keyboard-response',3022 stimulus: ['round7_matrix.png'],3023 stimulus_width: 500,3024 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 3025 choices: ['g','b'],3026 on_finish: function(data){3027 // Score the response as correct or incorrect.3028 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){3029 data.correct = true;3030 } else {3031 data.correct = false; 3032 }3033 }3034 },3035 {3036 type: 'animation', 3037 stimuli: animation_sequence, 3038 sequence_reps: 10,3039 frame_time: 30,3040 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',3041 choices: jsPsych.NO_KEYS 3042 },3043 {3044 type: 'html-keyboard-response',3045 stimulus: function(){3046 var data11_1 = jsPsych.data.get().last(8).values()[0];3047 var data12_1 = jsPsych.data.get().last(2).values()[0];3048 if(jsPsych.pluginAPI.compareKeys(data12_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_1.response, 'g')){3049 return jsPsych.timelineVariable('counter_green_coop_r7');3050 } else if(jsPsych.pluginAPI.compareKeys(data12_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_1.response, 'b')){3051 return jsPsych.timelineVariable('counter_green_defe_r7');3052 } else if(jsPsych.pluginAPI.compareKeys(data12_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data11_1.response, 'g')){3053 return jsPsych.timelineVariable('counter_blue_coop_r7');3054 } else {3055 return jsPsych.timelineVariable('counter_blue_defe_r7');3056 }3057 }3058 },3059 {3060 type: 'html-button-response',3061 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],3062 stimulus: function(){3063 var data11_2 = jsPsych.data.get().last(9).values()[0];3064 var data12_2 = jsPsych.data.get().last(3).values()[0];3065 if(jsPsych.pluginAPI.compareKeys(data12_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_2.response, 'g')){3066 return jsPsych.timelineVariable('par_gg_res');3067 } else if(jsPsych.pluginAPI.compareKeys(data12_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_2.response, 'b')){3068 return jsPsych.timelineVariable('par_gb_res');3069 } else if(jsPsych.pluginAPI.compareKeys(data12_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data11_2.response, 'g')){3070 return jsPsych.timelineVariable('par_bg_res');3071 } else {3072 return jsPsych.timelineVariable('par_bb_res');3073 }3074 }3075 },3076 {3077 type: 'html-keyboard-response',3078 stimulus: function(){3079 var data11_3 = jsPsych.data.get().last(10).values()[0];3080 var data12_3 = jsPsych.data.get().last(4).values()[0];3081 if(jsPsych.pluginAPI.compareKeys(data12_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_3.response, 'g')){3082 return jsPsych.timelineVariable('A17_gg_co_res');3083 } else if(jsPsych.pluginAPI.compareKeys(data12_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_3.response, 'b')){3084 return jsPsych.timelineVariable('A17_gb_co_res');3085 } else if(jsPsych.pluginAPI.compareKeys(data12_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data11_3.response, 'g')){3086 return jsPsych.timelineVariable('A17_bg_co_res');3087 } else {3088 return jsPsych.timelineVariable('A17_bb_co_res');3089 }3090 }3091 },3092 {3093 type: 'html-slider-response',3094 stimulus: function(){3095 var data11_4 = jsPsych.data.get().last(11).values()[0];3096 var data12_4 = jsPsych.data.get().last(5).values()[0];3097 if(jsPsych.pluginAPI.compareKeys(data12_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_4.response, 'g')){3098 return jsPsych.timelineVariable('A17_gg_co_res_sl');3099 } else if(jsPsych.pluginAPI.compareKeys(data12_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data11_4.response, 'b')){3100 return jsPsych.timelineVariable('A17_gb_co_res_sl');3101 } else if(jsPsych.pluginAPI.compareKeys(data12_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data11_4.response, 'g')){3102 return jsPsych.timelineVariable('A17_bg_co_res_sl');3103 } else {3104 return jsPsych.timelineVariable('A17_bb_co_res_sl');3105 }3106 },3107 labels: ['Likely BLUE', 'Likely GREEN']3108 },3109 {3110 type: 'image-keyboard-response',3111 stimulus: ['round8_matrix.png'],3112 stimulus_width: 500,3113 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 3114 choices: ['g','b'],3115 on_finish: function(data){3116 // Score the response as correct or incorrect.3117 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){3118 data.correct = true;3119 } else {3120 data.correct = false; 3121 }3122 }3123 },3124 {3125 type: 'animation', 3126 stimuli: animation_sequence, 3127 sequence_reps: 10,3128 frame_time: 30,3129 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',3130 choices: jsPsych.NO_KEYS 3131 },3132 {3133 type: 'html-keyboard-response',3134 stimulus: function(){3135 var data13_1 = jsPsych.data.get().last(8).values()[0];3136 var data14_1 = jsPsych.data.get().last(2).values()[0];3137 if(jsPsych.pluginAPI.compareKeys(data14_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_1.response, 'g')){3138 return jsPsych.timelineVariable('counter_green_coop_r8');3139 } else if(jsPsych.pluginAPI.compareKeys(data14_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_1.response, 'b')){3140 return jsPsych.timelineVariable('counter_green_defe_r8');3141 } else if(jsPsych.pluginAPI.compareKeys(data14_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data13_1.response, 'g')){3142 return jsPsych.timelineVariable('counter_blue_coop_r8');3143 } else {3144 return jsPsych.timelineVariable('counter_blue_defe_r8');3145 }3146 }3147 },3148 {3149 type: 'html-button-response',3150 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],3151 stimulus: function(){3152 var data13_2 = jsPsych.data.get().last(9).values()[0];3153 var data14_2 = jsPsych.data.get().last(3).values()[0];3154 if(jsPsych.pluginAPI.compareKeys(data14_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_2.response, 'g')){3155 return jsPsych.timelineVariable('par_gg_res');3156 } else if(jsPsych.pluginAPI.compareKeys(data14_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_2.response, 'b')){3157 return jsPsych.timelineVariable('par_gb_res');3158 } else if(jsPsych.pluginAPI.compareKeys(data14_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data13_2.response, 'g')){3159 return jsPsych.timelineVariable('par_bg_res');3160 } else {3161 return jsPsych.timelineVariable('par_bb_res');3162 }3163 }3164 },3165 {3166 type: 'html-keyboard-response',3167 stimulus: function(){3168 var data13_3 = jsPsych.data.get().last(10).values()[0];3169 var data14_3 = jsPsych.data.get().last(4).values()[0];3170 if(jsPsych.pluginAPI.compareKeys(data14_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_3.response, 'g')){3171 return jsPsych.timelineVariable('A17_gg_co_res');3172 } else if(jsPsych.pluginAPI.compareKeys(data14_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_3.response, 'b')){3173 return jsPsych.timelineVariable('A17_gb_co_res');3174 } else if(jsPsych.pluginAPI.compareKeys(data14_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data13_3.response, 'g')){3175 return jsPsych.timelineVariable('A17_bg_co_res');3176 } else {3177 return jsPsych.timelineVariable('A17_bb_co_res');3178 }3179 }3180 },3181 {3182 type: 'html-slider-response',3183 stimulus: function(){3184 var data13_4 = jsPsych.data.get().last(11).values()[0];3185 var data14_4 = jsPsych.data.get().last(5).values()[0];3186 if(jsPsych.pluginAPI.compareKeys(data14_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_4.response, 'g')){3187 return jsPsych.timelineVariable('A17_gg_co_res_sl');3188 } else if(jsPsych.pluginAPI.compareKeys(data14_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data13_4.response, 'b')){3189 return jsPsych.timelineVariable('A17_gb_co_res_sl');3190 } else if(jsPsych.pluginAPI.compareKeys(data14_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data13_4.response, 'g')){3191 return jsPsych.timelineVariable('A17_bg_co_res_sl');3192 } else {3193 return jsPsych.timelineVariable('A17_bb_co_res_sl');3194 }3195 },3196 labels: ['Likely BLUE', 'Likely GREEN']3197 },3198 {3199 type: 'image-keyboard-response',3200 stimulus: ['round9_matrix.png'],3201 stimulus_width: 500,3202 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 3203 choices: ['g','b'],3204 on_finish: function(data){3205 // Score the response as correct or incorrect.3206 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){3207 data.correct = true;3208 } else {3209 data.correct = false; 3210 }3211 }3212 },3213 {3214 type: 'animation', 3215 stimuli: animation_sequence, 3216 sequence_reps: 10,3217 frame_time: 30,3218 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',3219 choices: jsPsych.NO_KEYS 3220 },3221 {3222 type: 'html-keyboard-response',3223 stimulus: function(){3224 var data15_1 = jsPsych.data.get().last(8).values()[0];3225 var data16_1 = jsPsych.data.get().last(2).values()[0];3226 if(jsPsych.pluginAPI.compareKeys(data16_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_1.response, 'g')){3227 return jsPsych.timelineVariable('counter_green_coop_r9');3228 } else if(jsPsych.pluginAPI.compareKeys(data16_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_1.response, 'b')){3229 return jsPsych.timelineVariable('counter_green_defe_r9');3230 } else if(jsPsych.pluginAPI.compareKeys(data16_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data15_1.response, 'g')){3231 return jsPsych.timelineVariable('counter_blue_coop_r9');3232 } else {3233 return jsPsych.timelineVariable('counter_blue_defe_r9');3234 }3235 }3236 },3237 {3238 type: 'html-button-response',3239 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],3240 stimulus: function(){3241 var data15_2 = jsPsych.data.get().last(9).values()[0];3242 var data16_2 = jsPsych.data.get().last(3).values()[0];3243 if(jsPsych.pluginAPI.compareKeys(data16_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_2.response, 'g')){3244 return jsPsych.timelineVariable('par_gg_res');3245 } else if(jsPsych.pluginAPI.compareKeys(data16_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_2.response, 'b')){3246 return jsPsych.timelineVariable('par_gb_res');3247 } else if(jsPsych.pluginAPI.compareKeys(data16_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data15_2.response, 'g')){3248 return jsPsych.timelineVariable('par_bg_res');3249 } else {3250 return jsPsych.timelineVariable('par_bb_res');3251 }3252 }3253 },3254 {3255 type: 'html-keyboard-response',3256 stimulus: function(){3257 var data15_3 = jsPsych.data.get().last(10).values()[0];3258 var data16_3 = jsPsych.data.get().last(4).values()[0];3259 if(jsPsych.pluginAPI.compareKeys(data16_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_3.response, 'g')){3260 return jsPsych.timelineVariable('A17_gg_co_res');3261 } else if(jsPsych.pluginAPI.compareKeys(data16_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_3.response, 'b')){3262 return jsPsych.timelineVariable('A17_gb_co_res');3263 } else if(jsPsych.pluginAPI.compareKeys(data16_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data15_3.response, 'g')){3264 return jsPsych.timelineVariable('A17_bg_co_res');3265 } else {3266 return jsPsych.timelineVariable('A17_bb_co_res');3267 }3268 }3269 },3270 {3271 type: 'html-slider-response',3272 stimulus: function(){3273 var data15_4 = jsPsych.data.get().last(11).values()[0];3274 var data16_4 = jsPsych.data.get().last(5).values()[0];3275 if(jsPsych.pluginAPI.compareKeys(data16_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_4.response, 'g')){3276 return jsPsych.timelineVariable('A17_gg_co_res_sl');3277 } else if(jsPsych.pluginAPI.compareKeys(data16_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data15_4.response, 'b')){3278 return jsPsych.timelineVariable('A17_gb_co_res_sl');3279 } else if(jsPsych.pluginAPI.compareKeys(data16_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data15_4.response, 'g')){3280 return jsPsych.timelineVariable('A17_bg_co_res_sl');3281 } else {3282 return jsPsych.timelineVariable('A17_bb_co_res_sl');3283 }3284 },3285 labels: ['Likely BLUE', 'Likely GREEN']3286 },3287 {3288 type: 'image-keyboard-response',3289 stimulus: ['round10_matrix.png'],3290 stimulus_width: 500,3291 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 3292 choices: ['g','b'],3293 on_finish: function(data){3294 // Score the response as correct or incorrect.3295 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){3296 data.correct = true;3297 } else {3298 data.correct = false; 3299 }3300 }3301 },3302 {3303 type: 'animation', 3304 stimuli: animation_sequence, 3305 sequence_reps: 10,3306 frame_time: 30,3307 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',3308 choices: jsPsych.NO_KEYS 3309 },3310 {3311 type: 'html-keyboard-response',3312 stimulus: function(){3313 var data17_1 = jsPsych.data.get().last(8).values()[0];3314 var data18_1 = jsPsych.data.get().last(2).values()[0];3315 if(jsPsych.pluginAPI.compareKeys(data18_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_1.response, 'g')){3316 return jsPsych.timelineVariable('counter_green_coop_r10');3317 } else if(jsPsych.pluginAPI.compareKeys(data18_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_1.response, 'b')){3318 return jsPsych.timelineVariable('counter_green_defe_r10');3319 } else if(jsPsych.pluginAPI.compareKeys(data18_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data17_1.response, 'g')){3320 return jsPsych.timelineVariable('counter_blue_coop_r10');3321 } else {3322 return jsPsych.timelineVariable('counter_blue_defe_r10');3323 }3324 }3325 },3326 {3327 type: 'html-button-response',3328 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],3329 stimulus: function(){3330 var data17_2 = jsPsych.data.get().last(9).values()[0];3331 var data18_2 = jsPsych.data.get().last(3).values()[0];3332 if(jsPsych.pluginAPI.compareKeys(data18_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_2.response, 'g')){3333 return jsPsych.timelineVariable('par_gg_res');3334 } else if(jsPsych.pluginAPI.compareKeys(data18_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_2.response, 'b')){3335 return jsPsych.timelineVariable('par_gb_res');3336 } else if(jsPsych.pluginAPI.compareKeys(data18_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data17_2.response, 'g')){3337 return jsPsych.timelineVariable('par_bg_res');3338 } else {3339 return jsPsych.timelineVariable('par_bb_res');3340 }3341 }3342 },3343 {3344 type: 'html-keyboard-response',3345 stimulus: function(){3346 var data17_3 = jsPsych.data.get().last(10).values()[0];3347 var data18_3 = jsPsych.data.get().last(4).values()[0];3348 if(jsPsych.pluginAPI.compareKeys(data18_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_3.response, 'g')){3349 return jsPsych.timelineVariable('A17_gg_co_res');3350 } else if(jsPsych.pluginAPI.compareKeys(data18_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_3.response, 'b')){3351 return jsPsych.timelineVariable('A17_gb_co_res');3352 } else if(jsPsych.pluginAPI.compareKeys(data18_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data17_3.response, 'g')){3353 return jsPsych.timelineVariable('A17_bg_co_res');3354 } else {3355 return jsPsych.timelineVariable('A17_bb_co_res');3356 }3357 }3358 },3359 {3360 type: 'html-slider-response',3361 stimulus: function(){3362 var data17_4 = jsPsych.data.get().last(11).values()[0];3363 var data18_4 = jsPsych.data.get().last(5).values()[0];3364 if(jsPsych.pluginAPI.compareKeys(data18_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_4.response, 'g')){3365 return jsPsych.timelineVariable('A17_gg_co_res_sl');3366 } else if(jsPsych.pluginAPI.compareKeys(data18_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data17_4.response, 'b')){3367 return jsPsych.timelineVariable('A17_gb_co_res_sl');3368 } else if(jsPsych.pluginAPI.compareKeys(data18_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data17_4.response, 'g')){3369 return jsPsych.timelineVariable('A17_bg_co_res_sl');3370 } else {3371 return jsPsych.timelineVariable('A17_bb_co_res_sl');3372 }3373 },3374 labels: ['Likely BLUE', 'Likely GREEN']3375 },3376 {3377 type: 'image-keyboard-response',3378 stimulus: ['round11_matrix.png'],3379 stimulus_width: 500,3380 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 3381 choices: ['g','b'],3382 on_finish: function(data){3383 // Score the response as correct or incorrect.3384 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){3385 data.correct = true;3386 } else {3387 data.correct = false; 3388 }3389 }3390 },3391 {3392 type: 'animation', 3393 stimuli: animation_sequence, 3394 sequence_reps: 10,3395 frame_time: 30,3396 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',3397 choices: jsPsych.NO_KEYS 3398 },3399 {3400 type: 'html-keyboard-response',3401 stimulus: function(){3402 var data19_1 = jsPsych.data.get().last(8).values()[0];3403 var data20_1 = jsPsych.data.get().last(2).values()[0];3404 if(jsPsych.pluginAPI.compareKeys(data20_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_1.response, 'g')){3405 return jsPsych.timelineVariable('counter_green_coop_r11');3406 } else if(jsPsych.pluginAPI.compareKeys(data20_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_1.response, 'b')){3407 return jsPsych.timelineVariable('counter_green_defe_r11');3408 } else if(jsPsych.pluginAPI.compareKeys(data20_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data19_1.response, 'g')){3409 return jsPsych.timelineVariable('counter_blue_coop_r11');3410 } else {3411 return jsPsych.timelineVariable('counter_blue_defe_r11');3412 }3413 }3414 },3415 {3416 type: 'html-button-response',3417 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],3418 stimulus: function(){3419 var data19_2 = jsPsych.data.get().last(9).values()[0];3420 var data20_2 = jsPsych.data.get().last(3).values()[0];3421 if(jsPsych.pluginAPI.compareKeys(data20_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_2.response, 'g')){3422 return jsPsych.timelineVariable('par_gg_res');3423 } else if(jsPsych.pluginAPI.compareKeys(data20_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_2.response, 'b')){3424 return jsPsych.timelineVariable('par_gb_res');3425 } else if(jsPsych.pluginAPI.compareKeys(data20_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data19_2.response, 'g')){3426 return jsPsych.timelineVariable('par_bg_res');3427 } else {3428 return jsPsych.timelineVariable('par_bb_res');3429 }3430 }3431 },3432 {3433 type: 'html-keyboard-response',3434 stimulus: function(){3435 var data19_3 = jsPsych.data.get().last(10).values()[0];3436 var data20_3 = jsPsych.data.get().last(4).values()[0];3437 if(jsPsych.pluginAPI.compareKeys(data20_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_3.response, 'g')){3438 return jsPsych.timelineVariable('A17_gg_co_res');3439 } else if(jsPsych.pluginAPI.compareKeys(data20_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_3.response, 'b')){3440 return jsPsych.timelineVariable('A17_gb_co_res');3441 } else if(jsPsych.pluginAPI.compareKeys(data20_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data19_3.response, 'g')){3442 return jsPsych.timelineVariable('A17_bg_co_res');3443 } else {3444 return jsPsych.timelineVariable('A17_bb_co_res');3445 }3446 }3447 },3448 {3449 type: 'html-slider-response',3450 stimulus: function(){3451 var data19_4 = jsPsych.data.get().last(11).values()[0];3452 var data20_4 = jsPsych.data.get().last(5).values()[0];3453 if(jsPsych.pluginAPI.compareKeys(data20_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_4.response, 'g')){3454 return jsPsych.timelineVariable('A17_gg_co_res_sl');3455 } else if(jsPsych.pluginAPI.compareKeys(data20_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data19_4.response, 'b')){3456 return jsPsych.timelineVariable('A17_gb_co_res_sl');3457 } else if(jsPsych.pluginAPI.compareKeys(data20_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data19_4.response, 'g')){3458 return jsPsych.timelineVariable('A17_bg_co_res_sl');3459 } else {3460 return jsPsych.timelineVariable('A17_bb_co_res_sl');3461 }3462 },3463 labels: ['Likely BLUE', 'Likely GREEN']3464 },3465 {3466 type: 'image-keyboard-response',3467 stimulus: ['round12_matrix.png'],3468 stimulus_width: 500,3469 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 3470 choices: ['g','b'],3471 on_finish: function(data){3472 // Score the response as correct or incorrect.3473 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){3474 data.correct = true;3475 } else {3476 data.correct = false; 3477 }3478 }3479 },3480 {3481 type: 'animation', 3482 stimuli: animation_sequence, 3483 sequence_reps: 10,3484 frame_time: 30,3485 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',3486 choices: jsPsych.NO_KEYS 3487 },3488 {3489 type: 'html-keyboard-response',3490 stimulus: function(){3491 var data21_1 = jsPsych.data.get().last(8).values()[0];3492 var data22_1 = jsPsych.data.get().last(2).values()[0];3493 if(jsPsych.pluginAPI.compareKeys(data22_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_1.response, 'g')){3494 return jsPsych.timelineVariable('counter_green_coop_r12');3495 } else if(jsPsych.pluginAPI.compareKeys(data22_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_1.response, 'b')){3496 return jsPsych.timelineVariable('counter_green_defe_r12');3497 } else if(jsPsych.pluginAPI.compareKeys(data22_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data21_1.response, 'g')){3498 return jsPsych.timelineVariable('counter_blue_coop_r12');3499 } else {3500 return jsPsych.timelineVariable('counter_blue_defe_r12');3501 }3502 }3503 },3504 {3505 type: 'html-button-response',3506 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],3507 stimulus: function(){3508 var data21_2 = jsPsych.data.get().last(9).values()[0];3509 var data22_2 = jsPsych.data.get().last(3).values()[0];3510 if(jsPsych.pluginAPI.compareKeys(data22_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_2.response, 'g')){3511 return jsPsych.timelineVariable('par_gg_res');3512 } else if(jsPsych.pluginAPI.compareKeys(data22_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_2.response, 'b')){3513 return jsPsych.timelineVariable('par_gb_res');3514 } else if(jsPsych.pluginAPI.compareKeys(data22_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data21_2.response, 'g')){3515 return jsPsych.timelineVariable('par_bg_res');3516 } else {3517 return jsPsych.timelineVariable('par_bb_res');3518 }3519 }3520 },3521 {3522 type: 'html-keyboard-response',3523 stimulus: function(){3524 var data21_3 = jsPsych.data.get().last(10).values()[0];3525 var data22_3 = jsPsych.data.get().last(4).values()[0];3526 if(jsPsych.pluginAPI.compareKeys(data22_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_3.response, 'g')){3527 return jsPsych.timelineVariable('A17_gg_co_res');3528 } else if(jsPsych.pluginAPI.compareKeys(data22_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_3.response, 'b')){3529 return jsPsych.timelineVariable('A17_gb_co_res');3530 } else if(jsPsych.pluginAPI.compareKeys(data22_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data21_3.response, 'g')){3531 return jsPsych.timelineVariable('A17_bg_co_res');3532 } else {3533 return jsPsych.timelineVariable('A17_bb_co_res');3534 }3535 }3536 },3537 {3538 type: 'html-slider-response',3539 stimulus: function(){3540 var data21_4 = jsPsych.data.get().last(11).values()[0];3541 var data22_4 = jsPsych.data.get().last(5).values()[0];3542 if(jsPsych.pluginAPI.compareKeys(data22_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_4.response, 'g')){3543 return jsPsych.timelineVariable('A17_gg_co_res_sl');3544 } else if(jsPsych.pluginAPI.compareKeys(data22_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data21_4.response, 'b')){3545 return jsPsych.timelineVariable('A17_gb_co_res_sl');3546 } else if(jsPsych.pluginAPI.compareKeys(data22_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data21_4.response, 'g')){3547 return jsPsych.timelineVariable('A17_bg_co_res_sl');3548 } else {3549 return jsPsych.timelineVariable('A17_bb_co_res_sl');3550 }3551 },3552 labels: ['Likely BLUE', 'Likely GREEN']3553 },3554 {3555 type: 'image-keyboard-response',3556 stimulus: ['round13_matrix.png'],3557 stimulus_width: 500,3558 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 3559 choices: ['g','b'],3560 on_finish: function(data){3561 // Score the response as correct or incorrect.3562 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){3563 data.correct = true;3564 } else {3565 data.correct = false; 3566 }3567 }3568 },3569 {3570 type: 'animation', 3571 stimuli: animation_sequence, 3572 sequence_reps: 10,3573 frame_time: 30,3574 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',3575 choices: jsPsych.NO_KEYS 3576 },3577 {3578 type: 'html-keyboard-response',3579 stimulus: function(){3580 var data23_1 = jsPsych.data.get().last(8).values()[0];3581 var data24_1 = jsPsych.data.get().last(2).values()[0];3582 if(jsPsych.pluginAPI.compareKeys(data24_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data23_1.response, 'g')){3583 return jsPsych.timelineVariable('counter_green_coop_r13');3584 } else if(jsPsych.pluginAPI.compareKeys(data24_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data23_1.response, 'b')){3585 return jsPsych.timelineVariable('counter_green_defe_r13');3586 } else if(jsPsych.pluginAPI.compareKeys(data24_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data23_1.response, 'g')){3587 return jsPsych.timelineVariable('counter_blue_coop_r13');3588 } else {3589 return jsPsych.timelineVariable('counter_blue_defe_r13');3590 }3591 }3592 },3593 {3594 type: 'html-button-response',3595 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],3596 stimulus: function(){3597 var data23_2 = jsPsych.data.get().last(9).values()[0];3598 var data24_2 = jsPsych.data.get().last(3).values()[0];3599 if(jsPsych.pluginAPI.compareKeys(data24_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data23_2.response, 'g')){3600 return jsPsych.timelineVariable('par_gg_res');3601 } else if(jsPsych.pluginAPI.compareKeys(data24_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data23_2.response, 'b')){3602 return jsPsych.timelineVariable('par_gb_res');3603 } else if(jsPsych.pluginAPI.compareKeys(data24_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data23_2.response, 'g')){3604 return jsPsych.timelineVariable('par_bg_res');3605 } else {3606 return jsPsych.timelineVariable('par_bb_res');3607 }3608 }3609 },3610 {3611 type: 'html-keyboard-response',3612 stimulus: function(){3613 var data23_3 = jsPsych.data.get().last(10).values()[0];3614 var data24_3 = jsPsych.data.get().last(4).values()[0];3615 if(jsPsych.pluginAPI.compareKeys(data24_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data23_3.response, 'g')){3616 return jsPsych.timelineVariable('A17_gg_co_res');3617 } else if(jsPsych.pluginAPI.compareKeys(data24_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data23_3.response, 'b')){3618 return jsPsych.timelineVariable('A17_gb_co_res');3619 } else if(jsPsych.pluginAPI.compareKeys(data24_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data23_3.response, 'g')){3620 return jsPsych.timelineVariable('A17_bg_co_res');3621 } else {3622 return jsPsych.timelineVariable('A17_bb_co_res');3623 }3624 }3625 },3626 {3627 type: 'image-keyboard-response',3628 stimulus: ['round14_matrix.png'],3629 stimulus_width: 500,3630 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 3631 choices: ['g','b'],3632 on_finish: function(data){3633 // Score the response as correct or incorrect.3634 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){3635 data.correct = true;3636 } else {3637 data.correct = false; 3638 }3639 }3640 },3641 {3642 type: 'animation', 3643 stimuli: animation_sequence, 3644 sequence_reps: 10,3645 frame_time: 30,3646 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',3647 choices: jsPsych.NO_KEYS 3648 },3649 {3650 type: 'html-keyboard-response',3651 stimulus: function(){3652 var data25_1 = jsPsych.data.get().last(8).values()[0];3653 var data26_1 = jsPsych.data.get().last(2).values()[0];3654 if(jsPsych.pluginAPI.compareKeys(data26_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_1.response, 'g')){3655 return jsPsych.timelineVariable('counter_green_coop_r14');3656 } else if(jsPsych.pluginAPI.compareKeys(data26_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_1.response, 'b')){3657 return jsPsych.timelineVariable('counter_green_defe_r14');3658 } else if(jsPsych.pluginAPI.compareKeys(data26_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data25_1.response, 'g')){3659 return jsPsych.timelineVariable('counter_blue_coop_r14');3660 } else {3661 return jsPsych.timelineVariable('counter_blue_defe_r14');3662 }3663 }3664 },3665 {3666 type: 'html-button-response',3667 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],3668 stimulus: function(){3669 var data25_2 = jsPsych.data.get().last(9).values()[0];3670 var data26_2 = jsPsych.data.get().last(3).values()[0];3671 if(jsPsych.pluginAPI.compareKeys(data26_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_2.response, 'g')){3672 return jsPsych.timelineVariable('par_gg_res');3673 } else if(jsPsych.pluginAPI.compareKeys(data26_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_2.response, 'b')){3674 return jsPsych.timelineVariable('par_gb_res');3675 } else if(jsPsych.pluginAPI.compareKeys(data26_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data25_2.response, 'g')){3676 return jsPsych.timelineVariable('par_bg_res');3677 } else {3678 return jsPsych.timelineVariable('par_bb_res');3679 }3680 }3681 },3682 {3683 type: 'html-keyboard-response',3684 stimulus: function(){3685 var data25_3 = jsPsych.data.get().last(10).values()[0];3686 var data26_3 = jsPsych.data.get().last(4).values()[0];3687 if(jsPsych.pluginAPI.compareKeys(data26_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_3.response, 'g')){3688 return jsPsych.timelineVariable('A17_gg_co_res');3689 } else if(jsPsych.pluginAPI.compareKeys(data26_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_3.response, 'b')){3690 return jsPsych.timelineVariable('A17_gb_co_res');3691 } else if(jsPsych.pluginAPI.compareKeys(data26_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data25_3.response, 'g')){3692 return jsPsych.timelineVariable('A17_bg_co_res');3693 } else {3694 return jsPsych.timelineVariable('A17_bb_co_res');3695 }3696 }3697 },3698 {3699 type: 'html-slider-response',3700 stimulus: function(){3701 var data25_4 = jsPsych.data.get().last(11).values()[0];3702 var data26_4 = jsPsych.data.get().last(5).values()[0];3703 if(jsPsych.pluginAPI.compareKeys(data26_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_4.response, 'g')){3704 return jsPsych.timelineVariable('A17_gg_co_res_sl');3705 } else if(jsPsych.pluginAPI.compareKeys(data26_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data25_4.response, 'b')){3706 return jsPsych.timelineVariable('A17_gb_co_res_sl');3707 } else if(jsPsych.pluginAPI.compareKeys(data26_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data25_4.response, 'g')){3708 return jsPsych.timelineVariable('A17_bg_co_res_sl');3709 } else {3710 return jsPsych.timelineVariable('A17_bb_co_res_sl');3711 }3712 },3713 labels: ['Likely BLUE', 'Likely GREEN']3714 },3715 {3716 type: 'image-keyboard-response',3717 stimulus: ['round15_matrix.png'],3718 stimulus_width: 500,3719 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 3720 choices: ['g','b'],3721 on_finish: function(data){3722 // Score the response as correct or incorrect.3723 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){3724 data.correct = true;3725 } else {3726 data.correct = false; 3727 }3728 }3729 },3730 {3731 type: 'animation', 3732 stimuli: animation_sequence, 3733 sequence_reps: 10,3734 frame_time: 30,3735 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',3736 choices: jsPsych.NO_KEYS 3737 },3738 {3739 type: 'html-keyboard-response',3740 stimulus: function(){3741 var data27_1 = jsPsych.data.get().last(8).values()[0];3742 var data28_1 = jsPsych.data.get().last(2).values()[0];3743 if(jsPsych.pluginAPI.compareKeys(data28_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_1.response, 'g')){3744 return jsPsych.timelineVariable('counter_green_coop_r15');3745 } else if(jsPsych.pluginAPI.compareKeys(data28_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_1.response, 'b')){3746 return jsPsych.timelineVariable('counter_green_defe_r15');3747 } else if(jsPsych.pluginAPI.compareKeys(data28_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data27_1.response, 'g')){3748 return jsPsych.timelineVariable('counter_blue_coop_r15');3749 } else {3750 return jsPsych.timelineVariable('counter_blue_defe_r15');3751 }3752 }3753 },3754 {3755 type: 'html-button-response',3756 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],3757 stimulus: function(){3758 var data27_2 = jsPsych.data.get().last(9).values()[0];3759 var data28_2 = jsPsych.data.get().last(3).values()[0];3760 if(jsPsych.pluginAPI.compareKeys(data28_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_2.response, 'g')){3761 return jsPsych.timelineVariable('par_gg_res');3762 } else if(jsPsych.pluginAPI.compareKeys(data28_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_2.response, 'b')){3763 return jsPsych.timelineVariable('par_gb_res');3764 } else if(jsPsych.pluginAPI.compareKeys(data28_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data27_2.response, 'g')){3765 return jsPsych.timelineVariable('par_bg_res');3766 } else {3767 return jsPsych.timelineVariable('par_bb_res');3768 }3769 }3770 },3771 {3772 type: 'html-keyboard-response',3773 stimulus: function(){3774 var data27_3 = jsPsych.data.get().last(10).values()[0];3775 var data28_3 = jsPsych.data.get().last(4).values()[0];3776 if(jsPsych.pluginAPI.compareKeys(data28_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_3.response, 'g')){3777 return jsPsych.timelineVariable('A17_gg_co_res');3778 } else if(jsPsych.pluginAPI.compareKeys(data28_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_3.response, 'b')){3779 return jsPsych.timelineVariable('A17_gb_co_res');3780 } else if(jsPsych.pluginAPI.compareKeys(data28_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data27_3.response, 'g')){3781 return jsPsych.timelineVariable('A17_bg_co_res');3782 } else {3783 return jsPsych.timelineVariable('A17_bb_co_res');3784 }3785 }3786 },3787 {3788 type: 'html-slider-response',3789 stimulus: function(){3790 var data27_4 = jsPsych.data.get().last(11).values()[0];3791 var data28_4 = jsPsych.data.get().last(5).values()[0];3792 if(jsPsych.pluginAPI.compareKeys(data28_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_4.response, 'g')){3793 return jsPsych.timelineVariable('A17_gg_co_res_sl');3794 } else if(jsPsych.pluginAPI.compareKeys(data28_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data27_4.response, 'b')){3795 return jsPsych.timelineVariable('A17_gb_co_res_sl');3796 } else if(jsPsych.pluginAPI.compareKeys(data28_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data27_4.response, 'g')){3797 return jsPsych.timelineVariable('A17_bg_co_res_sl');3798 } else {3799 return jsPsych.timelineVariable('A17_bb_co_res_sl');3800 }3801 },3802 labels: ['Likely BLUE', 'Likely GREEN']3803 },3804 {3805 type: 'image-keyboard-response',3806 stimulus: ['round16_matrix.png'],3807 stimulus_width: 500,3808 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 3809 choices: ['g','b'],3810 on_finish: function(data){3811 // Score the response as correct or incorrect.3812 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){3813 data.correct = true;3814 } else {3815 data.correct = false; 3816 }3817 }3818 },3819 {3820 type: 'animation', 3821 stimuli: animation_sequence, 3822 sequence_reps: 10,3823 frame_time: 30,3824 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',3825 choices: jsPsych.NO_KEYS 3826 },3827 {3828 type: 'html-keyboard-response',3829 stimulus: function(){3830 var data29_1 = jsPsych.data.get().last(8).values()[0];3831 var data30_1 = jsPsych.data.get().last(2).values()[0];3832 if(jsPsych.pluginAPI.compareKeys(data30_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_1.response, 'g')){3833 return jsPsych.timelineVariable('counter_green_coop_r16');3834 } else if(jsPsych.pluginAPI.compareKeys(data30_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_1.response, 'b')){3835 return jsPsych.timelineVariable('counter_green_defe_r16');3836 } else if(jsPsych.pluginAPI.compareKeys(data30_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data29_1.response, 'g')){3837 return jsPsych.timelineVariable('counter_blue_coop_r16');3838 } else {3839 return jsPsych.timelineVariable('counter_blue_defe_r16');3840 }3841 }3842 },3843 {3844 type: 'html-button-response',3845 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],3846 stimulus: function(){3847 var data29_2 = jsPsych.data.get().last(9).values()[0];3848 var data30_2 = jsPsych.data.get().last(3).values()[0];3849 if(jsPsych.pluginAPI.compareKeys(data30_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_2.response, 'g')){3850 return jsPsych.timelineVariable('par_gg_res');3851 } else if(jsPsych.pluginAPI.compareKeys(data30_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_2.response, 'b')){3852 return jsPsych.timelineVariable('par_gb_res');3853 } else if(jsPsych.pluginAPI.compareKeys(data30_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data29_2.response, 'g')){3854 return jsPsych.timelineVariable('par_bg_res');3855 } else {3856 return jsPsych.timelineVariable('par_bb_res');3857 }3858 }3859 },3860 {3861 type: 'html-keyboard-response',3862 stimulus: function(){3863 var data29_3 = jsPsych.data.get().last(10).values()[0];3864 var data30_3 = jsPsych.data.get().last(4).values()[0];3865 if(jsPsych.pluginAPI.compareKeys(data30_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_3.response, 'g')){3866 return jsPsych.timelineVariable('A17_gg_co_res');3867 } else if(jsPsych.pluginAPI.compareKeys(data30_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_3.response, 'b')){3868 return jsPsych.timelineVariable('A17_gb_co_res');3869 } else if(jsPsych.pluginAPI.compareKeys(data30_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data29_3.response, 'g')){3870 return jsPsych.timelineVariable('A17_bg_co_res');3871 } else {3872 return jsPsych.timelineVariable('A17_bb_co_res');3873 }3874 }3875 },3876 {3877 type: 'html-slider-response',3878 stimulus: function(){3879 var data29_4 = jsPsych.data.get().last(11).values()[0];3880 var data30_4 = jsPsych.data.get().last(5).values()[0];3881 if(jsPsych.pluginAPI.compareKeys(data30_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_4.response, 'g')){3882 return jsPsych.timelineVariable('A17_gg_co_res_sl');3883 } else if(jsPsych.pluginAPI.compareKeys(data30_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data29_4.response, 'b')){3884 return jsPsych.timelineVariable('A17_gb_co_res_sl');3885 } else if(jsPsych.pluginAPI.compareKeys(data30_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data29_4.response, 'g')){3886 return jsPsych.timelineVariable('A17_bg_co_res_sl');3887 } else {3888 return jsPsych.timelineVariable('A17_bb_co_res_sl');3889 }3890 },3891 labels: ['Likely BLUE', 'Likely GREEN']3892 },3893 {3894 type: 'image-keyboard-response',3895 stimulus: ['round17_matrix.png'],3896 stimulus_width: 500,3897 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 3898 choices: ['g','b'],3899 on_finish: function(data){3900 // Score the response as correct or incorrect.3901 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){3902 data.correct = true;3903 } else {3904 data.correct = false; 3905 }3906 }3907 },3908 {3909 type: 'animation', 3910 stimuli: animation_sequence, 3911 sequence_reps: 10,3912 frame_time: 30,3913 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',3914 choices: jsPsych.NO_KEYS 3915 },3916 {3917 type: 'html-keyboard-response',3918 stimulus: function(){3919 var data31_1 = jsPsych.data.get().last(8).values()[0];3920 var data32_1 = jsPsych.data.get().last(2).values()[0];3921 if(jsPsych.pluginAPI.compareKeys(data32_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_1.response, 'g')){3922 return jsPsych.timelineVariable('counter_green_coop_r17');3923 } else if(jsPsych.pluginAPI.compareKeys(data32_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_1.response, 'b')){3924 return jsPsych.timelineVariable('counter_green_defe_r17');3925 } else if(jsPsych.pluginAPI.compareKeys(data32_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data31_1.response, 'g')){3926 return jsPsych.timelineVariable('counter_blue_coop_r17');3927 } else {3928 return jsPsych.timelineVariable('counter_blue_defe_r17');3929 }3930 }3931 },3932 {3933 type: 'html-button-response',3934 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],3935 stimulus: function(){3936 var data31_2 = jsPsych.data.get().last(9).values()[0];3937 var data32_2 = jsPsych.data.get().last(3).values()[0];3938 if(jsPsych.pluginAPI.compareKeys(data32_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_2.response, 'g')){3939 return jsPsych.timelineVariable('par_gg_res');3940 } else if(jsPsych.pluginAPI.compareKeys(data32_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_2.response, 'b')){3941 return jsPsych.timelineVariable('par_gb_res');3942 } else if(jsPsych.pluginAPI.compareKeys(data32_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data31_2.response, 'g')){3943 return jsPsych.timelineVariable('par_bg_res');3944 } else {3945 return jsPsych.timelineVariable('par_bb_res');3946 }3947 }3948 },3949 {3950 type: 'html-keyboard-response',3951 stimulus: function(){3952 var data31_3 = jsPsych.data.get().last(10).values()[0];3953 var data32_3 = jsPsych.data.get().last(4).values()[0];3954 if(jsPsych.pluginAPI.compareKeys(data32_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_3.response, 'g')){3955 return jsPsych.timelineVariable('A17_gg_co_res');3956 } else if(jsPsych.pluginAPI.compareKeys(data32_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_3.response, 'b')){3957 return jsPsych.timelineVariable('A17_gb_co_res');3958 } else if(jsPsych.pluginAPI.compareKeys(data32_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data31_3.response, 'g')){3959 return jsPsych.timelineVariable('A17_bg_co_res');3960 } else {3961 return jsPsych.timelineVariable('A17_bb_co_res');3962 }3963 }3964 },3965 {3966 type: 'html-slider-response',3967 stimulus: function(){3968 var data31_4 = jsPsych.data.get().last(11).values()[0];3969 var data32_4 = jsPsych.data.get().last(5).values()[0];3970 if(jsPsych.pluginAPI.compareKeys(data32_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_4.response, 'g')){3971 return jsPsych.timelineVariable('A17_gg_co_res_sl');3972 } else if(jsPsych.pluginAPI.compareKeys(data32_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data31_4.response, 'b')){3973 return jsPsych.timelineVariable('A17_gb_co_res_sl');3974 } else if(jsPsych.pluginAPI.compareKeys(data32_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data31_4.response, 'g')){3975 return jsPsych.timelineVariable('A17_bg_co_res_sl');3976 } else {3977 return jsPsych.timelineVariable('A17_bb_co_res_sl');3978 }3979 },3980 labels: ['Likely BLUE', 'Likely GREEN']3981 },3982 {3983 type: 'image-keyboard-response',3984 stimulus: ['round18_matrix.png'],3985 stimulus_width: 500,3986 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 3987 choices: ['g','b'],3988 on_finish: function(data){3989 // Score the response as correct or incorrect.3990 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){3991 data.correct = true;3992 } else {3993 data.correct = false; 3994 }3995 }3996 },3997 {3998 type: 'animation', 3999 stimuli: animation_sequence, 4000 sequence_reps: 10,4001 frame_time: 30,4002 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',4003 choices: jsPsych.NO_KEYS 4004 },4005 {4006 type: 'html-keyboard-response',4007 stimulus: function(){4008 var data33_1 = jsPsych.data.get().last(8).values()[0];4009 var data34_1 = jsPsych.data.get().last(2).values()[0];4010 if(jsPsych.pluginAPI.compareKeys(data34_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_1.response, 'g')){4011 return jsPsych.timelineVariable('counter_green_coop_r18');4012 } else if(jsPsych.pluginAPI.compareKeys(data34_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_1.response, 'b')){4013 return jsPsych.timelineVariable('counter_green_defe_r18');4014 } else if(jsPsych.pluginAPI.compareKeys(data34_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data33_1.response, 'g')){4015 return jsPsych.timelineVariable('counter_blue_coop_r18');4016 } else {4017 return jsPsych.timelineVariable('counter_blue_defe_r18');4018 }4019 }4020 },4021 {4022 type: 'html-button-response',4023 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],4024 stimulus: function(){4025 var data33_2 = jsPsych.data.get().last(9).values()[0];4026 var data34_2 = jsPsych.data.get().last(3).values()[0];4027 if(jsPsych.pluginAPI.compareKeys(data34_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_2.response, 'g')){4028 return jsPsych.timelineVariable('par_gg_res');4029 } else if(jsPsych.pluginAPI.compareKeys(data34_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_2.response, 'b')){4030 return jsPsych.timelineVariable('par_gb_res');4031 } else if(jsPsych.pluginAPI.compareKeys(data34_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data33_2.response, 'g')){4032 return jsPsych.timelineVariable('par_bg_res');4033 } else {4034 return jsPsych.timelineVariable('par_bb_res');4035 }4036 }4037 },4038 {4039 type: 'html-keyboard-response',4040 stimulus: function(){4041 var data33_3 = jsPsych.data.get().last(10).values()[0];4042 var data34_3 = jsPsych.data.get().last(4).values()[0];4043 if(jsPsych.pluginAPI.compareKeys(data34_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_3.response, 'g')){4044 return jsPsych.timelineVariable('A17_gg_co_res');4045 } else if(jsPsych.pluginAPI.compareKeys(data34_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_3.response, 'b')){4046 return jsPsych.timelineVariable('A17_gb_co_res');4047 } else if(jsPsych.pluginAPI.compareKeys(data34_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data33_3.response, 'g')){4048 return jsPsych.timelineVariable('A17_bg_co_res');4049 } else {4050 return jsPsych.timelineVariable('A17_bb_co_res');4051 }4052 }4053 },4054 {4055 type: 'html-slider-response',4056 stimulus: function(){4057 var data33_4 = jsPsych.data.get().last(11).values()[0];4058 var data34_4 = jsPsych.data.get().last(5).values()[0];4059 if(jsPsych.pluginAPI.compareKeys(data34_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_4.response, 'g')){4060 return jsPsych.timelineVariable('A17_gg_co_res_sl');4061 } else if(jsPsych.pluginAPI.compareKeys(data34_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data33_4.response, 'b')){4062 return jsPsych.timelineVariable('A17_gb_co_res_sl');4063 } else if(jsPsych.pluginAPI.compareKeys(data34_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data33_4.response, 'g')){4064 return jsPsych.timelineVariable('A17_bg_co_res_sl');4065 } else {4066 return jsPsych.timelineVariable('A17_bb_co_res_sl');4067 }4068 },4069 labels: ['Likely BLUE', 'Likely GREEN']4070 },4071 {4072 type: 'image-keyboard-response',4073 stimulus: ['round19_matrix.png'],4074 stimulus_width: 500,4075 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 4076 choices: ['g','b'],4077 on_finish: function(data){4078 // Score the response as correct or incorrect.4079 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){4080 data.correct = true;4081 } else {4082 data.correct = false; 4083 }4084 }4085 },4086 {4087 type: 'animation', 4088 stimuli: animation_sequence, 4089 sequence_reps: 10,4090 frame_time: 30,4091 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',4092 choices: jsPsych.NO_KEYS 4093 },4094 {4095 type: 'html-keyboard-response',4096 stimulus: function(){4097 var data35_1 = jsPsych.data.get().last(8).values()[0];4098 var data36_1 = jsPsych.data.get().last(2).values()[0];4099 if(jsPsych.pluginAPI.compareKeys(data36_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_1.response, 'g')){4100 return jsPsych.timelineVariable('counter_green_coop_r19');4101 } else if(jsPsych.pluginAPI.compareKeys(data36_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_1.response, 'b')){4102 return jsPsych.timelineVariable('counter_green_defe_r19');4103 } else if(jsPsych.pluginAPI.compareKeys(data36_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data35_1.response, 'g')){4104 return jsPsych.timelineVariable('counter_blue_coop_r19');4105 } else {4106 return jsPsych.timelineVariable('counter_blue_defe_r19');4107 }4108 }4109 },4110 {4111 type: 'html-button-response',4112 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],4113 stimulus: function(){4114 var data35_2 = jsPsych.data.get().last(9).values()[0];4115 var data36_2 = jsPsych.data.get().last(3).values()[0];4116 if(jsPsych.pluginAPI.compareKeys(data36_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_2.response, 'g')){4117 return jsPsych.timelineVariable('par_gg_res');4118 } else if(jsPsych.pluginAPI.compareKeys(data36_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_2.response, 'b')){4119 return jsPsych.timelineVariable('par_gb_res');4120 } else if(jsPsych.pluginAPI.compareKeys(data36_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data35_2.response, 'g')){4121 return jsPsych.timelineVariable('par_bg_res');4122 } else {4123 return jsPsych.timelineVariable('par_bb_res');4124 }4125 }4126 },4127 {4128 type: 'html-keyboard-response',4129 stimulus: function(){4130 var data35_3 = jsPsych.data.get().last(10).values()[0];4131 var data36_3 = jsPsych.data.get().last(4).values()[0];4132 if(jsPsych.pluginAPI.compareKeys(data36_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_3.response, 'g')){4133 return jsPsych.timelineVariable('A17_gg_co_res');4134 } else if(jsPsych.pluginAPI.compareKeys(data36_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_3.response, 'b')){4135 return jsPsych.timelineVariable('A17_gb_co_res');4136 } else if(jsPsych.pluginAPI.compareKeys(data36_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data35_3.response, 'g')){4137 return jsPsych.timelineVariable('A17_bg_co_res');4138 } else {4139 return jsPsych.timelineVariable('A17_bb_co_res');4140 }4141 }4142 },4143 {4144 type: 'html-slider-response',4145 stimulus: function(){4146 var data35_4 = jsPsych.data.get().last(11).values()[0];4147 var data36_4 = jsPsych.data.get().last(5).values()[0];4148 if(jsPsych.pluginAPI.compareKeys(data36_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_4.response, 'g')){4149 return jsPsych.timelineVariable('A17_gg_co_res_sl');4150 } else if(jsPsych.pluginAPI.compareKeys(data36_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data35_4.response, 'b')){4151 return jsPsych.timelineVariable('A17_gb_co_res_sl');4152 } else if(jsPsych.pluginAPI.compareKeys(data36_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data35_4.response, 'g')){4153 return jsPsych.timelineVariable('A17_bg_co_res_sl');4154 } else {4155 return jsPsych.timelineVariable('A17_bb_co_res_sl');4156 }4157 },4158 labels: ['Likely BLUE', 'Likely GREEN']4159 },4160 {4161 type: 'image-keyboard-response',4162 stimulus: ['round20_matrix.png'],4163 stimulus_width: 500,4164 prompt: '<p> Please press <strong>G</strong> on the keyboard to invest in <strong>GREEN</strong> and <strong>B</strong> on the keyboard to invest in <strong>BLUE</strong>.</p>', 4165 choices: ['g','b'],4166 on_finish: function(data){4167 // Score the response as correct or incorrect.4168 if(jsPsych.pluginAPI.compareKeys(data.response, "g")){4169 data.correct = true;4170 } else {4171 data.correct = false; 4172 }4173 }4174 },4175 {4176 type: 'animation', 4177 stimuli: animation_sequence, 4178 sequence_reps: 10,4179 frame_time: 30,4180 prompt: '<p> Waiting for Anonymous17 to invest ... </p>',4181 choices: jsPsych.NO_KEYS 4182 },4183 {4184 type: 'html-keyboard-response',4185 stimulus: function(){4186 var data37_1 = jsPsych.data.get().last(8).values()[0];4187 var data38_1 = jsPsych.data.get().last(2).values()[0];4188 if(jsPsych.pluginAPI.compareKeys(data38_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_1.response, 'g')){4189 return jsPsych.timelineVariable('counter_green_coop_r20');4190 } else if(jsPsych.pluginAPI.compareKeys(data38_1.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_1.response, 'b')){4191 return jsPsych.timelineVariable('counter_green_defe_r20');4192 } else if(jsPsych.pluginAPI.compareKeys(data38_1.response, 'b') && jsPsych.pluginAPI.compareKeys(data37_1.response, 'g')){4193 return jsPsych.timelineVariable('counter_blue_coop_r20');4194 } else {4195 return jsPsych.timelineVariable('counter_blue_defe_r20');4196 }4197 }4198 },4199 {4200 type: 'html-button-response',4201 choices: ['Neutral', 'Happy', 'Sad', 'Angry', 'Regretful'],4202 stimulus: function(){4203 var data37_2 = jsPsych.data.get().last(9).values()[0];4204 var data38_2 = jsPsych.data.get().last(3).values()[0];4205 if(jsPsych.pluginAPI.compareKeys(data38_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_2.response, 'g')){4206 return jsPsych.timelineVariable('par_gg_res');4207 } else if(jsPsych.pluginAPI.compareKeys(data38_2.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_2.response, 'b')){4208 return jsPsych.timelineVariable('par_gb_res');4209 } else if(jsPsych.pluginAPI.compareKeys(data38_2.response, 'b') && jsPsych.pluginAPI.compareKeys(data37_2.response, 'g')){4210 return jsPsych.timelineVariable('par_bg_res');4211 } else {4212 return jsPsych.timelineVariable('par_bb_res');4213 }4214 }4215 },4216 {4217 type: 'html-keyboard-response',4218 stimulus: function(){4219 var data37_3 = jsPsych.data.get().last(10).values()[0];4220 var data38_3 = jsPsych.data.get().last(4).values()[0];4221 if(jsPsych.pluginAPI.compareKeys(data38_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_3.response, 'g')){4222 return jsPsych.timelineVariable('A17_gg_co_res');4223 } else if(jsPsych.pluginAPI.compareKeys(data38_3.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_3.response, 'b')){4224 return jsPsych.timelineVariable('A17_gb_co_res');4225 } else if(jsPsych.pluginAPI.compareKeys(data38_3.response, 'b') && jsPsych.pluginAPI.compareKeys(data37_3.response, 'g')){4226 return jsPsych.timelineVariable('A17_bg_co_res');4227 } else {4228 return jsPsych.timelineVariable('A17_bb_co_res');4229 }4230 }4231 },4232 {4233 type: 'html-slider-response',4234 stimulus: function(){4235 var data37_4 = jsPsych.data.get().last(11).values()[0];4236 var data38_4 = jsPsych.data.get().last(5).values()[0];4237 if(jsPsych.pluginAPI.compareKeys(data38_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_4.response, 'g')){4238 return jsPsych.timelineVariable('A17_gg_co_res_sl');4239 } else if(jsPsych.pluginAPI.compareKeys(data38_4.response, 'g') && jsPsych.pluginAPI.compareKeys(data37_4.response, 'b')){4240 return jsPsych.timelineVariable('A17_gb_co_res_sl');4241 } else if(jsPsych.pluginAPI.compareKeys(data38_4.response, 'b') && jsPsych.pluginAPI.compareKeys(data37_4.response, 'g')){4242 return jsPsych.timelineVariable('A17_bg_co_res_sl');4243 } else {4244 return jsPsych.timelineVariable('A17_bb_co_res_sl');4245 }4246 },4247 labels: ['Likely BLUE', 'Likely GREEN']4248 }4249 ],4250 timeline_variables: [4251 { par_gg_res: `<p> How do you feel about this outcome? </p> <img src = "par_str1_gg.png" height="200"></img> `,4252 par_bg_res: `<p> How do you feel about this outcome? </p> <img src = "par_str1_bg.png" height="200"></img>`,4253 par_gb_res: `<p> How do you feel about this outcome? </p> <img src = "par_str1_gb.png" height="200"></img>`,4254 par_bb_res: `<p> How do you feel about this outcome? </p> <img src = "par_str1_bb.png" height="200"></img>`,4255 A17_gg_co_res: `<p> This is how Anonymous17 feels about this outcome. </p> <img src = "A17_gg_co_res.png" height="200"></img> <p> Press any key to continue. </p>`,...

Full Screen

Full Screen

bst.js

Source:bst.js Github

copy

Full Screen

...83 return;84 }85 if (this.left) {86 this.left.checkAllNodesFullfillCondition((k) => {87 if (self.compareKeys(k, self.key) >= 0) {88 throw new Error(`Tree with root ${self.key} is not a binary search tree`);89 }90 });91 this.left.checkNodeOrdering();92 }93 if (this.right) {94 this.right.checkAllNodesFullfillCondition((k) => {95 if (self.compareKeys(k, self.key) <= 0) {96 throw new Error(`Tree with root ${self.key} is not a binary search tree`);97 }98 });99 this.right.checkNodeOrdering();100 }101};102/**103 * Check that all pointers are coherent in this tree104 */105BinarySearchTree.prototype.checkInternalPointers = function () {106 if (this.left) {107 if (this.left.parent !== this) {108 throw new Error(`Parent pointer broken for key ${this.key}`);109 }110 this.left.checkInternalPointers();111 }112 if (this.right) {113 if (this.right.parent !== this) {114 throw new Error(`Parent pointer broken for key ${this.key}`);115 }116 this.right.checkInternalPointers();117 }118};119/**120 * Check that a tree is a BST as defined here (node ordering and pointer references)121 */122BinarySearchTree.prototype.checkIsBST = function () {123 this.checkNodeOrdering();124 this.checkInternalPointers();125 if (this.parent) {126 throw new Error('The root shouldn\'t have a parent');127 }128};129/**130 * Get number of keys inserted131 */132BinarySearchTree.prototype.getNumberOfKeys = function () {133 let res;134 if (!this.hasOwnProperty('key')) {135 return 0;136 }137 res = 1;138 if (this.left) {139 res += this.left.getNumberOfKeys();140 }141 if (this.right) {142 res += this.right.getNumberOfKeys();143 }144 return res;145};146// ============================================147// Methods used to actually work on the tree148// ============================================149/**150 * Create a BST similar (i.e. same options except for key and value) to the current one151 * Use the same constructor (i.e. BinarySearchTree, AVLTree etc)152 * @param {Object} options see constructor153 */154BinarySearchTree.prototype.createSimilar = function (options) {155 options = options || {};156 options.unique = this.unique;157 options.compareKeys = this.compareKeys;158 options.checkValueEquality = this.checkValueEquality;159 return new this.constructor(options);160};161/**162 * Create the left child of this BST and return it163 */164BinarySearchTree.prototype.createLeftChild = function (options) {165 const leftChild = this.createSimilar(options);166 leftChild.parent = this;167 this.left = leftChild;168 return leftChild;169};170/**171 * Create the right child of this BST and return it172 */173BinarySearchTree.prototype.createRightChild = function (options) {174 const rightChild = this.createSimilar(options);175 rightChild.parent = this;176 this.right = rightChild;177 return rightChild;178};179/**180 * Insert a new element181 * @param {Key} key182 * @param {Value=} value Optional183 */184BinarySearchTree.prototype.insert = function (key, value) {185 // Empty tree, insert as root186 if (!this.hasOwnProperty('key')) {187 this.key = key;188 customUtils.isDef(value) && this.data.push(value);189 return;190 }191 // Same key as root192 const comparison = this.compareKeys(key, this.key);193 if (comparison === 0) {194 if (this.unique) {195 if (this.data.includes(value)) return;196 const err = new Error(`Can't insert key ${key}, it violates the unique constraint`);197 err.key = key;198 err.errorType = 'uniqueViolated';199 throw err;200 } else if (customUtils.isDef(value)) {201 if (this.vkUnique && this.data.includes(value)) return;202 this.data.push(value);203 }204 return;205 }206 const childNode = { key };207 if (customUtils.isDef(value)) {208 childNode.value = value;209 }210 if (comparison < 0) {211 // Insert in left subtree212 if (this.left) {213 this.left.insert(key, value);214 } else {215 this.createLeftChild(childNode);216 }217 } else {218 // Insert in right subtree219 if (this.right) {220 this.right.insert(key, value);221 } else {222 this.createRightChild(childNode);223 }224 }225};226/**227 * Search for all data corresponding to a key228 */229BinarySearchTree.prototype.search = function (key) {230 if (!this.hasOwnProperty('key')) {231 return [];232 }233 const comparison = this.compareKeys(key, this.key);234 if (comparison === 0) {235 return this.data;236 }237 if (comparison < 0) {238 if (this.left) {239 return this.left.search(key);240 }241 return [];242 }243 if (this.right) {244 return this.right.search(key);245 }246 return [];247};248/**249 * Search for data coming right after a specific key250 */251BinarySearchTree.prototype.searchAfter = function (key) {252 if (!this.hasOwnProperty('key')) {253 return [];254 }255 if (this.compareKeys(this.key, key) === 0) {256 // if there's a right child, the next key will be there257 var cur = this.right;258 if (cur) {259 // within the right branch, traverse left until leaf260 while (cur.left) {261 cur = cur.left;262 }263 return cur.data;264 }265 // traverse up until you find a bigger key266 cur = this.parent;267 while (cur) {268 if (this.compareKeys(key, cur.key) < 0) return cur.data;269 cur = cur.parent;270 }271 return [];272 }273 if (this.compareKeys(key, this.key) < 0) {274 if (this.left) {275 return this.left.searchAfter(key);276 }277 return this.data;278 }279 if (this.right) {280 return this.right.searchAfter(key);281 }282 // traverse up until you find a bigger key283 var cur = this.parent;284 while (cur) {285 if (this.compareKeys(key, cur.key) < 0) return cur.data;286 cur = cur.parent;287 }288 return [];289};290/**291 * Search for data coming right before a specific key292 */293BinarySearchTree.prototype.searchBefore = function (key) {294 if (!this.hasOwnProperty('key')) {295 return [];296 }297 if (this.compareKeys(this.key, key) === 0) {298 // if there's a left child, the previous key will be there299 var cur = this.left;300 if (cur) {301 // within the left branch, traverse right until leaf302 while (cur.right) {303 cur = cur.right;304 }305 return cur.data;306 }307 // traverse up until you find a smaller key308 cur = this.parent;309 while (cur) {310 if (this.compareKeys(key, cur.key) > 0) return cur.data;311 cur = cur.parent;312 }313 return [];314 }315 if (this.compareKeys(key, this.key) < 0) {316 if (this.left) {317 return this.left.searchBefore(key);318 }319 // traverse up until you find a smaller key320 var cur = this.parent;321 while (cur) {322 if (this.compareKeys(key, cur.key) > 0) return cur.data;323 cur = cur.parent;324 }325 return [];326 }327 if (this.right) {328 return this.right.searchBefore(key);329 }330 return this.data;331};332/**333 * Search for all data corresponding to a specific key, if that key334 * does not exist, find the nearest key less than the specified key and its335 * associated data. Returns null if no such key&data can be found.336 * */337BinarySearchTree.prototype.searchNearestLte = function (key) {338 const nearest = this._searchNearestLte(key);339 return nearest ? nearest.data : null;340};341BinarySearchTree.prototype._searchNearestLte = function (key, nearestSoFar) {342 if (!this.hasOwnProperty('key')) {343 return null;344 }345 let nearest = null;346 if (typeof nearestSoFar !== 'undefined') {347 nearest = nearestSoFar;348 }349 if (this.compareKeys(key, this.key) === 0) {350 return this;351 }352 if (353 (nearest == null || Math.abs(this.compareKeys(this.key, key)) < Math.abs(this.compareKeys(key, nearest.key))) &&354 this.compareKeys(this.key, key) <= 0355 ) {356 nearest = this;357 }358 if (this.compareKeys(key, this.key) < 0) {359 if (this.left) {360 const leftCandidate = this.left._searchNearestLte(key, nearest);361 if (362 leftCandidate != null &&363 (nearest == null ||364 Math.abs(this.compareKeys(leftCandidate.key, key)) < Math.abs(this.compareKeys(key, nearest.key))) &&365 this.compareKeys(leftCandidate.key, key) <= 0366 ) {367 nearest = leftCandidate;368 }369 }370 }371 if (nearest == null || this.compareKeys(key, this.key) >= 0) {372 if (this.right) {373 const rightCandidate = this.right._searchNearestLte(key, nearest);374 if (375 rightCandidate != null &&376 (nearest == null ||377 Math.abs(this.compareKeys(rightCandidate.key, key)) < Math.abs(this.compareKeys(key, nearest.key))) &&378 this.compareKeys(rightCandidate.key, key) <= 0379 ) {380 nearest = rightCandidate;381 }382 }383 }384 return nearest;385};386/**387 * Search for all data corresponding to a specific key, if that key388 * does not exist, find the nearest key greater than the specified key and its389 * associated data. Returns null if no such key&data can be found.390 * */391BinarySearchTree.prototype.searchNearestGte = function (key) {392 const nearest = this._searchNearestGte(key);393 return nearest ? nearest.data : null;394};395BinarySearchTree.prototype._searchNearestGte = function (key, nearestSoFar) {396 if (!this.hasOwnProperty('key')) {397 return null;398 }399 let nearest = null;400 if (typeof nearestSoFar !== 'undefined') {401 nearest = nearestSoFar;402 }403 if (this.compareKeys(key, this.key) === 0) {404 return this;405 }406 if (407 (nearest == null || Math.abs(this.compareKeys(this.key, key)) < Math.abs(this.compareKeys(key, nearest.key))) &&408 this.compareKeys(this.key, key) >= 0409 ) {410 nearest = this;411 }412 if (this.compareKeys(key, this.key) < 0) {413 if (this.left) {414 const leftCandidate = this.left._searchNearestGte(key, nearest);415 if (416 leftCandidate != null &&417 (nearest == null ||418 Math.abs(this.compareKeys(leftCandidate.key, key)) < Math.abs(this.compareKeys(key, nearest.key))) &&419 this.compareKeys(leftCandidate.key, key) >= 0420 ) {421 nearest = leftCandidate;422 }423 }424 }425 if (nearest == null || this.compareKeys(key, this.key) >= 0) {426 if (this.right) {427 const rightCandidate = this.right._searchNearestGte(key, nearest);428 if (429 rightCandidate != null &&430 (nearest == null ||431 Math.abs(this.compareKeys(rightCandidate.key, key)) < Math.abs(this.compareKeys(key, nearest.key))) &&432 this.compareKeys(rightCandidate.key, key) >= 0433 ) {434 nearest = rightCandidate;435 }436 }437 }438 return nearest;439};440/**441 * Search for all data corresponding to a specific key, if that key442 * does not exist, find the nearest key and associated data.443 */444BinarySearchTree.prototype.searchNearest = function (key) {445 const nearest = this._searchNearest(key);446 return nearest ? nearest.data : null;447};448BinarySearchTree.prototype._searchNearest = function (key, nearestSoFar) {449 if (!this.hasOwnProperty('key')) {450 return null;451 }452 let nearest = null;453 if (typeof nearestSoFar !== 'undefined') {454 nearest = nearestSoFar;455 }456 if (this.compareKeys(key, this.key) === 0) {457 return this;458 }459 if (nearest == null || Math.abs(this.compareKeys(this.key, key)) < Math.abs(this.compareKeys(key, nearest.key))) {460 nearest = this;461 }462 if (this.compareKeys(key, this.key) < 0) {463 if (this.left) {464 const leftCandidate = this.left._searchNearest(key, nearest);465 if (466 leftCandidate != null &&467 (nearest == null ||468 Math.abs(this.compareKeys(leftCandidate.key, key)) < Math.abs(this.compareKeys(key, nearest.key)))469 ) {470 nearest = leftCandidate;471 }472 }473 } else if (this.right) {474 const rightCandidate = this.right._searchNearest(key, nearest);475 if (476 rightCandidate != null &&477 (nearest == null ||478 Math.abs(this.compareKeys(rightCandidate.key, key)) < Math.abs(this.compareKeys(key, nearest.key)))479 ) {480 nearest = rightCandidate;481 }482 }483 return nearest;484};485/**486 * Return a function that tells whether a given key matches a lower bound487 */488BinarySearchTree.prototype.getLowerBoundMatcher = function (query) {489 // No lower bound490 if (!query.hasOwnProperty('$gt') && !query.hasOwnProperty('$gte')) {491 return () => true;492 }493 if (query.hasOwnProperty('$gt') && query.hasOwnProperty('$gte')) {494 if (this.compareKeys(query.$gte, query.$gt) === 0) {495 const q = query.$gt;496 return (key) => this.compareKeys(key, q) > 0;497 }498 if (this.compareKeys(query.$gte, query.$gt) > 0) {499 const q = query.$gte;500 return (key) => this.compareKeys(key, q) >= 0;501 }502 const q = query.$gt;503 return (key) => this.compareKeys(key, q) > 0;504 }505 if (query.hasOwnProperty('$gt')) {506 const q = query.$gt;507 return (key) => this.compareKeys(key, q) > 0;508 }509 const q = query.$gte;510 return (key) => this.compareKeys(key, q) >= 0;511};512/**513 * Return a function that tells whether a given key matches an upper bound514 */515BinarySearchTree.prototype.getUpperBoundMatcher = function (query) {516 // No lower bound517 if (!query.hasOwnProperty('$lt') && !query.hasOwnProperty('$lte')) {518 return () => true;519 }520 if (query.hasOwnProperty('$lt') && query.hasOwnProperty('$lte')) {521 if (this.compareKeys(query.$lte, query.$lt) === 0) {522 const q = query.$lt;523 return (key) => this.compareKeys(key, q) < 0;524 }525 if (this.compareKeys(query.$lte, query.$lt) < 0) {526 const q = query.$lte;527 return (key) => this.compareKeys(key, q) <= 0;528 }529 const q = query.$lt;530 return (key) => this.compareKeys(key, q) < 0;531 }532 if (query.hasOwnProperty('$lt')) {533 const q = query.$lt;534 return (key) => this.compareKeys(key, q) < 0;535 }536 const q = query.$lte;537 return (key) => this.compareKeys(key, q) <= 0;538};539BinarySearchTree.prototype._betweenBounds = function (res, lbm, ubm) {540 const lRes = lbm(this.key);541 if (lRes && this.left) this.left._betweenBounds(res, lbm, ubm);542 if (!ubm(this.key)) return;543 if (lRes) {544 for (const r of this.data) {545 res.push(r);546 }547 }548 if (this.right) this.right._betweenBounds(res, lbm, ubm);549};550/**551 * Get all data for a key between bounds552 * Return it in key order553 * @param {Object} query Mongo-style query where keys are $lt, $lte, $gt or $gte (other keys are not considered)554 * @param {Functions} lbm/ubm matching functions calculated at the first recursive step555 */556BinarySearchTree.prototype.betweenBounds = function (query) {557 if (!this.hasOwnProperty('key')) return []; // Empty tree558 const lbm = this.getLowerBoundMatcher(query);559 const ubm = this.getUpperBoundMatcher(query);560 const res = [];561 this._betweenBounds(res, lbm, ubm);562 return res;563};564/**565 * Delete the current node if it is a leaf566 * Return true if it was deleted567 */568BinarySearchTree.prototype.deleteIfLeaf = function () {569 if (this.left || this.right) {570 return false;571 }572 // The leaf is itself a root573 if (!this.parent) {574 delete this.key;575 this.data = [];576 return true;577 }578 if (this.parent.left === this) {579 this.parent.left = null;580 } else {581 this.parent.right = null;582 }583 return true;584};585/**586 * Delete the current node if it has only one child587 * Return true if it was deleted588 */589BinarySearchTree.prototype.deleteIfOnlyOneChild = function () {590 let child;591 if (this.left && !this.right) {592 child = this.left;593 }594 if (!this.left && this.right) {595 child = this.right;596 }597 if (!child) {598 return false;599 }600 // Root601 if (!this.parent) {602 this.key = child.key;603 this.data = child.data;604 this.left = null;605 if (child.left) {606 this.left = child.left;607 child.left.parent = this;608 }609 this.right = null;610 if (child.right) {611 this.right = child.right;612 child.right.parent = this;613 }614 return true;615 }616 if (this.parent.left === this) {617 this.parent.left = child;618 child.parent = this.parent;619 } else {620 this.parent.right = child;621 child.parent = this.parent;622 }623 return true;624};625/**626 * Delete a key or just a value627 * @param {Key} key628 * @param {Value=} value Optional. If not set, the whole key is deleted. If set, only this value is deleted629 */630BinarySearchTree.prototype.delete = function (key, value) {631 let replaceWith;632 if (!this.hasOwnProperty('key')) {633 return;634 }635 if (this.compareKeys(key, this.key) < 0) {636 if (this.left) {637 this.left.delete(key, value);638 }639 return;640 }641 if (this.compareKeys(key, this.key) > 0) {642 if (this.right) {643 this.right.delete(key, value);644 }645 return;646 }647 if (!this.compareKeys(key, this.key) === 0) {648 return;649 }650 // Delete only a value651 if (this.data.length > 1 && customUtils.isDef(value)) {652 this.data = this.data.filter(function (d) {653 return !this.checkValueEquality(d, value);654 }, this);655 return;656 }657 // Delete the whole node658 if (this.deleteIfLeaf()) {659 return;660 }661 if (this.deleteIfOnlyOneChild()) {...

Full Screen

Full Screen

Deep-comparison.js

Source:Deep-comparison.js Github

copy

Full Screen

1function deepEqual(compare, compareWith) {2 const compareKeys = Object.keys(compare);3 const compareWithKeys = Object.keys(compareWith);4 const compareLength = compareKeys.length;5 if (compareKeys.length !== compareWithKeys.length) {6 return false;7 }8 for (let i = 0; i < compareLength; i++) {9 if (compareWithKeys.indexOf(compareKeys[i]) === -1) {10 return false;11 }12 if (typeof compare[compareKeys[i]] === "object") {13 if (!deepEqual(compare[compareKeys[i]], compareWith[compareKeys[i]])) {14 return false;15 }16 }17 }18 return true;19}...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { compareKeys } = require('fast-check-monorepo');2const a = { a: 1, b: 2, c: 3 };3const b = { a: 1, b: 2, c: 3 };4const c = { a: 1, b: 2, c: 3, d: 4 };5const d = { a: 1, b: 2, c: 3, d: 4, e: 5 };6const e = { a: 1, b: 2, c: 3, d: 4, e: 6 };7const f = { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 };8const { compareKeys } = require('fast-check-monorepo');9const a = { a: 1, b: 2, c: 3 };10const b = { a: 1, b: 2, c: 3 };11const c = { a: 1, b: 2, c: 3, d: 4 };12const d = { a: 1, b: 2, c: 3, d: 4, e: 5 };13const e = { a: 1, b: 2, c: 3, d: 4, e: 6 };14const f = { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 };15const { compareKeys } = require('fast-check-monorepo');16const a = { a: 1, b: 2, c: 3

Full Screen

Using AI Code Generation

copy

Full Screen

1const { compareKeys } = require('fast-check-monorepo');2const object1 = { a: 1, b: 2, c: 3 };3const object2 = { b: 2, a: 1, c: 3 };4const object3 = { a: 1, b: 2, c: 4 };5const object4 = { a: 1, b: 2, c: 4, d: 5 };6const object5 = { a: 1, b: 2, c: 4, d: 5, e: 6 };

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require('fast-check');2const { compareKeys } = require('fast-check-monorepo');3const { compareKeys } = require('fast-check-monorepo');4const { compareKeys } = require('fast-check-monorepo');5fc.assert(6 fc.property(fc.integer(), fc.integer(), (a, b) => {7 return compareKeys(a, b) === compareKeys(b, a);8 })9);10const fc = require('fast-check');11const { compareKeys } = require('fast-check');12fc.assert(13 fc.property(fc.integer(), fc.integer(), (a, b) => {14 return compareKeys(a, b) === compareKeys(b, a);15 })16);17const fc = require('fast-check');18const { compareKeys } = require('fast-check');19fc.assert(20 fc.property(fc.integer(), fc.integer(), (a, b) => {21 return compareKeys(a, b) === compareKeys(b, a);22 })23);24const fc = require('fast-check');25const { compareKeys } = require('fast-check-monorepo');26const { compareKeys } = require('fast-check-monorepo');27const { compareKeys } = require('fast-check-monorepo');28fc.assert(29 fc.property(fc.integer(), fc.integer(), (a, b) => {30 return compareKeys(a, b) === compareKeys(b, a);31 })32);33const fc = require('fast-check');34const { compareKeys } = require('fast-check');35fc.assert(36 fc.property(fc.integer(), fc.integer(), (a, b) => {37 return compareKeys(a, b) === compareKeys(b, a);38 })39);40const fc = require('fast-check');41const { compareKeys } = require('fast-check');42fc.assert(43 fc.property(fc.integer(), fc.integer(), (a, b) => {44 return compareKeys(a, b) === compareKeys(b, a);45 })46);47const fc = require('fast-check');48const { compareKeys } = require('fast-check-monorepo');49const { compareKeys } =

Full Screen

Using AI Code Generation

copy

Full Screen

1import { compareKeys } from 'fast-check-monorepo/dist/compareKeys.js';2const obj1 = { a: 1, b: 2, c: 3 };3const obj2 = { a: 1, b: 2, c: 3 };4const obj3 = { a: 1, b: 2, c: 4 };5To fix this, change the import statement to use the default export syntax:6import compareKeys from 'fast-check-monorepo/dist/compareKeys';7const obj1 = { a: 1, b: 2, c: 3 };8const obj2 = { a: 1, b: 2, c: 3 };9const obj3 = { a: 1, b: 2, c: 4 };

Full Screen

Using AI Code Generation

copy

Full Screen

1const { compareKeys } = require('fast-check-monorepo');2const { compareKeys } = require('fast-check-monorepo');3const { compareKeys } = require('fast-check-monorepo');4const { compareKeys } = require('fast-check-monorepo');5const { compareKeys } = require('fast-check-monorepo');6const { compareKeys } = require('fast-check-monorepo');7const { compareKeys } = require('fast-check-monorepo');8const { compareKeys } = require('fast-check-monorepo');9const { compareKeys } = require('fast-check-monorepo');10const { compareKeys } = require('fast-check-monorepo');11const { compareKeys } = require('fast-check-monorepo');12const { compareKeys } = require('fast-check-monorepo');13const { compareKeys } = require('fast-check-monorepo');14const { compareKeys } = require('fast-check-monorepo');15const { compareKeys } = require('fast-check-monorepo');16const { compareKeys } = require('fast-check-monorepo');17const { compareKeys } = require('fast-check-monorepo');18const { compareKeys } = require('fast-check-monorepo');19const { compareKeys } = require('fast-check-monorepo');20const { compareKeys } = require('fast-check-monorepo');21const { compareKeys } = require('fast-check-monorepo');22const { compareKeys } = require('fast-check-monorepo');23const { compareKeys } = require('fast-check-monorepo');24const { compareKeys } = require('fast-check-monorepo');25const { compareKeys } = require('fast-check-monorepo');26const { compareKeys } = require('fast-check-monorepo');27const { compareKeys } = require('fast-check-monorepo');

Full Screen

Using AI Code Generation

copy

Full Screen

1const { compareKeys } = require('fast-check-monorepo');2const obj1 = {3};4const obj2 = {5};6console.log(compareKeys(obj1, obj2));7const { compareKeys } = require('fast-check-monorepo');8const obj1 = {9};10const obj2 = {11};12console.log(compareKeys(obj1, obj2));13const { compareKeys } = require('fast-check-monorepo');14const obj1 = {15};16const obj2 = {17};18console.log(compareKeys(obj1, obj2));19const { compareKeys } = require('fast-check-monorepo');20const obj1 = {21};22const obj2 = {23};24console.log(compareKeys(obj1, obj2));25const { compareKeys } = require('fast-check-monorepo');26const obj1 = {27};28const obj2 = {29};30console.log(compareKeys(obj1, obj2));

Full Screen

Using AI Code Generation

copy

Full Screen

1const {compareKeys} = require('fast-check-monorepo');2const test1 = {a:1,b:2,c:3};3const test2 = {a:1,b:2,c:3};4const result = compareKeys(test1,test2);5const {compareKeys} = require('fast-check-monorepo');6const test1 = {a:1,b:2,c:3};7const test2 = {a:1,b:2,c:3};8const result = compareKeys(test1,test2);9const {compareKeys} = require('fast-check-monorepo');10const test1 = {a:1,b:2,c:3};11const test2 = {a:1,b:2,c:3};12const result = compareKeys(test1,test2);13const {compareKeys} = require('fast-check-monorepo');14const test1 = {a:1,b:2,c:3};15const test2 = {a:1,b:2,c:3};16const result = compareKeys(test1,test2);17const {compareKeys} = require('fast-check-monorepo');18const test1 = {a:1,b:2,c:3};19const test2 = {a:1,b:2,c:3};20const result = compareKeys(test1,test2);21const {compareKeys} = require('fast-check-monorepo');22const test1 = {a:1,b:2,c:3};23const test2 = {a:1,b:2,c:3};24const result = compareKeys(test1,test2);25const {compareKeys} = require('fast-check-monorepo');26const test1 = {a:1,b:2,c:3};27const test2 = {a:1,b:2,c:3};

Full Screen

Using AI Code Generation

copy

Full Screen

1const { compareKeys } = require("fast-check-monorepo");2const { run } = require("fast-check");3const { strictEqual } = require("assert");4const compareKeys = require("fast-check-monorepo");5run(compareKeys({ a: 1, b: 2 }, { a: 1, b: 2 }, { a: 1, b: 2 })).then(6 (result) => {7 strictEqual(result.failed, false);8 }9);10const { compareKeys } = require("fast-check");11const { run } = require("fast-check");12const { strictEqual } = require("assert");13const compareKeys = require("fast-check-monorepo");14run(compareKeys({ a: 1, b: 2 }, { a: 1, b: 2 }, { a: 1, b: 2 })).then(15 (result) => {16 strictEqual(result.failed, false);17 }18);19If you want to use the compareKeys function, you need to import it from the @dubzzz/fast-check package:20const { compareKeys } = require("@dubzzz/fast-check");

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fast-check-monorepo automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful