-
-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jsPsych on Pavlovia #3491
Comments
Hi Giulia, Are there any errors in your browser console? I ran into a similar issue, and it was because the documentation was outdated. Try replacing the init and finish code with this:
|
Hi! Thank you so much for your response. |
Ah, I see the problem now - your timeline is missing the You also have a redundant jsPsych init call at the end. So your code should look like: // finish connection with pavlovia.org //
var pavlovia_finish = {
type: jsPsychPavlovia,
command: "finish",
participantId: "JSPSYCH-DEMO"
};
timeline.push(pavlovia_finish);
jsPsych.run(timeline);
} You'll also need to change the type parameters on all your trials from strings to objects. For example: var thank_you = {
type: "html-button-response",
stimulus: "<p>You have now completed the experiment. Thank you for participating!</p>" +
'<p>Press any key to close the experiment.</p>',
choices: ["Close"]
}; should be: var thank_you = {
type: jsPsychHtmlKeyboardResponse,
stimulus: "<p>You have now completed the experiment. Thank you for participating!</p>" +
'<p>Press any key to close the experiment.</p>', // removed the choices argument since all keys should be enabled
}; You can find the correct value to enter for trial types in the plugin documentation: (e.g., https://www.jspsych.org/v7/plugins/html-keyboard-response/) |
Hi!
I have set up my jsPsych experiment to run on Pavlovia, and it works perfectly fine locally. However, when I follow the instructions to modify the timeline (see here) and try to pilot the experiment on Pavlovia, I only see a blank page. I’ve read that some variables (e.g., jsPsych.init) no longer work with the latest version, but even after updating the script, it still doesn't run.
Here’s the link to the experiment: https://gitlab.pavlovia.org/giulialoca18/jspsych_bwsnorms/-/blob/master/index.html .
I've tried several potential solutions, and occasionally, I encounter errors related to the plugins I added (although no error is shown in this latest version of the code). I suspect the issue may be linked to the plugins or to the connection with the server.
Could anyone help me identify the problem or suggest which part of the script I should check or modify? Could this issue be related to conflicting versions of jsPsych and Pavlovia?
Thank you in advance for your help!
Giulia
The text was updated successfully, but these errors were encountered: