| Reference | Downloads | Github

Curious if Psychopy Will Fit My Needs

Hey all!

I’m new to PsychoPy and am looking to build an online experiment. I’m going through all the tools and guides on the website, but I was hoping to get some feedback regarding whether it would be possible to build my experiment in Psychopy for an online study.

I’m tasked with building a decision making experiment called a Sugar Production task. In this study, a participant imagines that they manage a sugar factory wherein they must determine the number of workers required to produce a certain goal amount of sugar each day. At the end of each day, they are informed of the amount of sugar they produced based on their number of workers. Little do they know, there is a formula used to determine their output based on:

-The amount of sugar from the previous trial
-The number of workers chosen
-A random amount of error (-1, 0, or +1)

This formula is used to generate an amount following their typed response for the number of workers they choose. Thus, the formula should calculate the production amount after they respond and show them on the next screen as they perform their allocation of workers for the next day.

Keeping in mind that there is a goal amount, I need the program to understand that once the formula output is equal to the goal amount of sugar, the goal amount changes as they essentially use the same formula to compute a new goal amount. Therefore, I need the program to take their response, plus the previous output, plus the random error, to generate a new output for each day.

This is sort of what a single trial would look like:

Would a program like this that would require a formula computing and updating feedback in the background be possible using PsychoPy? Thank you!


Updating a formula based on previous trials is very easy to do in a code component (Python with an auto translate to JavaScript for online).

Text input (the digits) currently also requires code. Do you want to have decimals and/or a large range of numbers? If not you could make it visually more appealing by having the participant select “meeples”

Best wishes


Thank you so much for your help! The participant chooses a number between 1-12 in whole numbers.

In that case the way I’d probably do it would be to have 12 meeples standing in a row (12 image objects) and perhaps change their opacity or colour based on the hover position of the mouse (e.g. if you hover over meeple 8 then meeples 1-8 have opacity 1 and meeples 9-12 have opacity .5) with the value submitted on a click.

If you want the experiment to work on a mobile then you’d need a separate submit button because you need to treat hover (.contains) as a click with a touchscreen.

Meeple image public domain from Meeple Icons - Download Free Vector Icons | Noun Project

I’d also recommend looking at my crib sheet.