OtherRaceEffect_Program.psyexp (127.6 KB)
Description of the problem:
Hello, I am trying to include code for an online experiment so that the experiment automatically closes if participants do not agree to participate. Specifically, if they use the mouse (which in my experiment is called Mouse_4) and they click on text labelled “No_Consent_Button” as opposed to text labelled “Consent_Button.” After reading around, this is the code I have created so far, but it does not work:
Code Type: JS in the End Routine Tab
if Mouse_4.ispressedin(No_Consent_Button):
{ return psychoJS.quit('you did not consent. goodbye!', false) }
The experiment just continues even if they press no consent.
Any help would be greatly appreciated.