Hi there! I am trying to use counterbalancing in my experiment so I want the condition entered in the dialogue box (it will be a number from 1-8) at the beginning to determine which set of cues is used later in the experiment and I am not sure how to do this.
The code for the dialogue box looks like this
expName = 'testcodingHW' # from the Builder filename that created this script
expInfo = {'condition' : '','session': '001', 'participant': '', }
dlg = gui.DlgFromDict(dictionary=expInfo, title=expName)
if dlg.OK == False:
core.quit() # user pressed cancel
expInfo['date'] = data.getDateStr() # add a simple timestamp
expInfo['expName'] = expName
Based on the condition we were hoping it would pull from an excel file that would determine which set of cues to use. The excel file looks like this
Then we have a different excel file which looks like this
and it specifies the rest of the information about the trial and we were hoping to connect the excel files so the “Conditions” file pulls from the “Counterbalancing” file so it knows what cues to use, but we want it to only refer to the row in the “Counterbalancing” file that corresponds to the condition for that specific participant.
The code we have for the “conditions file” is like this but we are not sure how to change it so it does the above.
extraInfo=expInfo, originPath=-1,
trialList=data.importConditions('conditions.xlsx', selection="0:280"),
seed=None, name='trials')
thisExp.addLoop(trials) # add the loop to the experiment
thisTrial = trials.trialList[0] # so we can initialise stimuli with some values
# abbreviate parameter names if possible (e.g. rgb = thisTrial.rgb)
if thisTrial != None:
for paramName in thisTrial:
exec('{} = thisTrial[paramName]'.format(paramName))
Thank you so much, we are totally beginners so would appreciate any help at all!!