A different plan is needed to run it online. I had planned to create a new conditions file, but thats not as easy online, but this works. In the example attached, I use words presented on screen for the stimuli, where h1a and h2a are healthy foods, u1a etc are unhealthy foods.
foodRatings routine and trials loop
The food words are stored in a conditions file called
foods.xlsx. Each food is presented using a text component and the ratings are collected using a Slider, with categories for good and bad. In a code component, there are two variables created in the
Begin Experiment tab. The
foodChoices variable contains two sets of lists, one for healthy food and one for unhealthy food. The
exemplars variable contains the list of exemplars, these will have to be typed in by you. Good foods are added to the healthy category, along with exemplars, and bad foods are added to the unhealthy category, along with exemplars. Exemplars are filtered by matching the first two characters of a food e.g.,
h1 to all exemplars starting with
h1. Each time a food is added to the foodConditions container, each list is shuffled for randomisation.
stopGo and trials_2
This routine presents the words rated as good or bad, along with their exemplars, that were stored in
foodCondtions. The loop has a template conditions file called
stopGo, that has keys (either “h” or “u”) to access the healthy or unhealthy food choices in
foodConditions. The order of healthy and unhealthy is randomised via the loop. Press space for go on this routine. This loop only runs for 1 block, if you want more, just change the nReps value in Trials_2 to your number of blocks required.
Things to do
- Decide what makes a stop and go trial, and add an extra column to the
stopGo conditions file, to help calculate error rates. The extra column will contain
space for each go trial, or whatever the correct response should be.
- Add instructions
Here are the example files to run, and the URL to see it running online.
foodRating.psyexp (15.2 KB)
foods.xlsx (7.8 KB)
stopGo.xlsx (7.8 KB)