I’m running an experiment online.
After participants finish their task in Pavlovia, I want to re-direct them to a Google forms link to fill-in a post-experimental questionnaire.
The hack I used is to insert a button in PsychoPy associated with the following code in Python:
import webbrowser
webbrowser.open(“https://link would be here”, new=1)
In Javascript for Pavlovia, it is translated as:
import * as webbrowser from ‘webbrowser’;
And I receive an error:
"Unexpected token: * " ← referring to the import statement.
Any ideas on how I can do this for the online version in Pavlovia?
It works well in PsychoPy locally.
Small caveat (but will have to deal with it now):
In the window for the link, there is no translation from python to javascript so I can only remove the import statement from javascript.
Hence, I remove it altogether, compile the code for online JS use, but it will not work locally as the import statement is missing from Python and I get an error regarding that, as can be seen in the below image.
In my case, after I remove the import statement in PsychoPy and re-compile to sync with web project, the online version works fine, as well as the button for online.
Once I click it, it automatically opens a new tab in Google Chrome going at the google forms (accessing the link from the button).
Hello, I am also running an experiment online. But I would like to present the Forms first and then direct the participants to the experiment in Pavlovia. Do you know a way this could work?
Thank you in advance @fmtoma@wakecarter