Contrast Sensitivity Task - Interleaved Staircase

OS (e.g. Win10): Windows 10 Enterprise
PsychoPy version (e.g. 1.84.x): 2020.2.10
What are you trying to achieve?: I’m trying to make a task that will measure the contrast sensitivity to a drifting grating stimulus presented at different spatial frequencies. The contrast of that stimulus should be controlled by a staircase, going 1 db up after one incorrect answer, and 1 db down after two consecutive correct answers. The task should end after 7 reversal for each spatial frequency.
I used the interleaved function, defining all my variables in a condition files, but I can’t make the n up/n down work as I said.

What did you try to make it work?: I’ve tried to define those variables in the condition files, and I even tried adding a piece of code to control them, but neither of it worked as it should.

staircase = data.StairHandler(startVal = 0.9,
stepType = 'db', stepSizes=1,
minVal=0, maxVal=1,
nUp=1, nDown=2, 
nTrials=50, nReversals=7)

What specifically went wrong when you tried that?: The staircase works, but doesen’t follow the 1 up, 2 down rule…

Were you able to make this work by any chance?