Changing the flow of the test according to the participant's reaction?

Hello everyone.

I’m a beginner in Psychopy. In my research, I show participants some photographs. I ask the participant to determine whether there is an expression of emotion in the photograph displayed on the screen. If he chooses yes, I will ask him to choose which emotion it is. However, if he chooses no, the next stimulus will appear on the screen. Is it possible for me to create a test this way where the flow changes according to the participant’s reaction?

Thanks for help.

You set your “what emotion is this” routine to end using continueRoutine = False if the response to the previous question was no.

Thank you for the answer. I tried to do as much as I could understand. However, I haven’t got any results yet.

You can see the two stages of the test I prepared below. Participants can answer the question ‘are there any expressions of emotion’ in the first stage by pressing the ‘d’ or ‘k’ button (resp1). ‘d’ means yes, ‘k’ means no. Accordingly, I added a code to the second stage and wrote it as in the photo. However, even if the ‘k’ key is pressed, the question ‘what emotion expression is this’ continues to come. I’m open to suggestions on where I might have gone wrong.




reps1 is the name of the keyboard component.

You want

if resp1.keys == 'k':

in order to check whether k was pressed in Step 1.

Also, your code should be in Begin Routine. continueRoutine = False does nothing in End Routine because the routine is already ending.

Thank you so much. It worked!

hello, Im also a beginner and I want to implement something similar. I remember reading that if I alter the code in coder view, I wont be able to continue in builder mode? Could you clear that up for me?

Thanks in advance

I never make changes in the Coder view.

I add and edit code components in the Builder view.

Do you have some resources from where I can see examples of how the code component works

There’s currently an issue with continueRoutine = False in Begin Routine.

Please could you start a new thread which clarifies what you are trying to do, and what you have tried so far?

sorry for the delay, i did make a separate post on a tangential topic. Excel formula formatting not translating to output file any input would be appreciated!