URL of experiment: https://run.pavlovia.org/KDaughters/validation-study-1/html/
Description of the problem:
I’m trying to incorporate participants consent at the beginning of an online study. Participants must answer three consent items before beginning the study. If they select a cross for any of the consent items the study should quit so that they cannot proceed. To do this I have created ‘buttons’ using the mouse component and a code component to quit the study based on their mouse response.
The study works fine in builder, but two things happen when I try to run it online: 1) the ‘buttons’ don’t work in safari, they aren’t recognised so the study gets stuck; 2) if I run it in chrome, the buttons work fine, but it seems to ignore the code and carry on to the next routine regardless of response.
I suspect this is due to errors in my attempt to convert python into JS. My code is below:
End Routine - Python:
print (consent_1_resp.clicked_name)
if consent_1_resp.clicked_name == [‘cross_1’]:
core.quit()
End Routine - JS:
console.log (consent_1_resp.clicked_name);
if (consent_1_resp.clicked_name == [‘cross_1’]){
core.quit();
}
I’ve used other relevant topics to solve some problems (I’m no longer getting the “failed to parse as JS” error, or getting stuck on the ‘initializing experiment’ page, but struggling on how else to edit the JS. Any suggestions would be much appreciated!
Katie