So now we have a very simple experiment that works locally, let’s see how we would get that online.
Before we take our study online it is important for us to understand a bit about how PsychoPy generates an experiment that can be read by your browser (using PsychoJS) as well as how we can host the study online (using pavlovia.org)
When we make an experiment in PsychoPy builder, it is writing our experiment in Python code under the hood. Now it also writes our experiment to JavaScript via PsychoPy’s sister library PsychoJS.
If you prefer to write experiments in pure code, you can use Javascript using PsychoJS.
But, in general it will be faster, less bug prone and easier to share with non-coders if you use Builder.
Once we have our experiment written in JS, we need a way to “host” it online. Pavlovia is:
A secure server for running experiments and storing data.
A gitbased version control system.
A huge open access library of experiments (that you can add to!)
If the task that you need doesn’t already exist - push your own! Before you get started try to make sure you:
Have a fresh folder that contains only one .psyexp file and the resources needed by that file.
It can also be helpful to make sure your folder is not in a location already under git version control.
Once you have made your experiment and made sure that your local folders are organised neatly ( with one .psyexp file in this location) you’re ready to sync your project to pavlovia!.
Once you have synced your study you will find it in your Dashboard on pavlovia.org under “Experiments”.
Piloting versus running - piloting will produce a token that lets you run your study for free for one hour, a data file will automatically download so that you can inspect it. Running will generate a URL to share with participants - no data will be downloaded locally using that link.
CSV or DATABASE - cav will generate a csv file per participant that will be sent to your gitlab repository (so it will be public if you make the repo public). Database will append all participants data to a single file (it will not be sent to gitlab).
Inside the experiment settings of PsychoPy you can configure the online settings of your experiment.
There are two ways we can find and use existing experiments from Pavlovia:
From within pavlovia itself using the explore tab.
From within PsychoPy itself using the search globe.
We could directly fork an experiment on pavlovia.
Then, search for that inside PsychoPy and sync it to our desktop. We could actually fork + sync in PsychoPy itself!
Fork existing projects
Version control
Add lab members to projects to work on the same files
Easy sharing of your task (open science)
You can change the visibility of your task at any time under permissions.
good as allows easy data sharing
Something to bare in mind if you are collecting protected data
So we have created a basic experiment, pushed it online and learnt about how we could share it.
But what if we want something more complex?
Let’s talk about some other types of responses we can get and how these can make our experiment more flexible.