Help with triggering conditional routines and components

Hello,

I have two routines in a loop. The first routine is the experiment, and the second is essentially a feedback routine, triggered conditionally.

In routine 1 I track if the answer is correct and the colour, using red_inc and green_inc.

In routine 2 I have this in begin routine
‘’’
if red_inc == 0:
continueRoutine = False
elif green_inc == 0:
continueRoutine = False
else:
continueRoutine = True

‘’’

I then have 2 components within the routine. One is text and the other is image. I have it set that start is set to condition, with if green_inc == 1 for the image and if red_inc == 1 for the text.

The problem I am having is that nothing seems to trigger the routine, and then nothing triggers the components.

I have used print statements and the green/red_inc are increased changed to 1 on an incorrect answer, it just doesn’t then move onto the next routine or show the components.

I get no error, the experiment just runs as though the code doesn’t exist

Have you put “if” in the condition?

Could the value be “1” instead of 1?

Putting “if” in the condition for the components causes a syntax error as if “component” == NOT_STARTED is the first line.

Changing the variable to ‘1’ has made some progress I think. It definitely moves into the next routine (can see from print statements) however neither component displays, it also moves on a correct answer. The experiment then just stays stuck on the black grey screen.

In the end I dropped the conditional components.
Instead I made a “green_incorrect” and “red_incorrect” routine, and set their loop numbers to update based on incorrect answers. This seems to have worked for now.

I’ll be looking more into conditional components because I can’t see why they weren’t working.