Hi,
I am designing a donation experiment.
I have to randomly display the number of ‘ratingrt_raw’ in the condition file 20 times(the loop reps is 20).
If the number on the screen is 0, the loop continues. If it is not 0, the loop must be stopped.
I thought the variable that display the number on the screen is .setText(ratingrt_raw)
or pick_rt
, which is the name of the block itself showing the text.
So I entered the following code.
# *pick_rt* updates
if t >= 0.0 and pick_rt.status == NOT_STARTED:
# keep track of start time/frame for later
pick_rt.tStart = t
pick_rt.frameNStart = frameN # exact frame index
pick_rt.setAutoDraw(True)
miss = pick_rt.setText()
if miss == 0.0:
continueRoutine = True
else:
continueRoutine = False
trials_3.finished = True
frameRemains = 0.0 + 8.0- win.monitorFramePeriod * 0.75 # most of one frame period left
if pick_rt.status == STARTED and t >= frameRemains:
pick_rt.setAutoDraw(False)
I tried to define the miss variable as pick_rt
, but the result was not different.
Regardless of the number, the loop continued.
How can I solve this problem?
I appreciate for your help in advance.
+Routine components
# Initialize components for Routine "pick_charity"
pick_charityClock = core.Clock()
pick_char = visual.ImageStim(
win=win, name='pick_char',
image='sin', mask=None,
ori=0, pos=(0, 0), size=(1.0, 1.0),
color=[1,1,1], colorSpace='rgb', opacity=1,
flipHoriz=False, flipVert=False,
texRes=128, interpolate=True, depth=-2.0)
pick_rating = visual.TextStim(win=win, name='pick_rating',
text='default text',
font=u'Arial',
pos=(0.7, 0), height=0.1, wrapWidth=None, ori=0,
color=u'black', colorSpace='rgb', opacity=1,
depth=-3.0);
pick_rt = visual.TextStim(win=win, name='pick_rt',
text='default text',
font=u'Arial',
pos=(0.7, -0.8), height=0.1, wrapWidth=None, ori=0,
color=u'black', colorSpace='rgb', opacity=1,
depth=-3.0);