| Reference | Downloads | Github

Exit online experiment by click

I am trying to make a consent form with the text in the center, and two buttons Agree or Disagree on the sides. The idea is that (1) if participants click on AGREE, the experiment continues, and (2) if they click on DISAGREE, the experiment exits.

I so far managed to implement option (1).

Any idea for option (2)?
My idea was to make a Javascript code component with an IF statement.

if XXX {
quitPsychoJS(‘Goodbye!’, false)

What should I insert as “XXX”?