I’m a complete beginner and I started out with the new book (Peirce & MacAskill), which is great by the way. In Chapter 8 (p. 118-120) I came across a problem with counterbalancing blocks of trials based on a custom variable in theexperiment settings dialog box. I try to provide enough info below.
Thanks in advance for your help!
PsychoPy version: 1.90.1
Standard Standalone? y
What are you trying to achieve?: Counterbalance the order of 2 blocks (Maori/English Stroop versions) based on a Group variable (A or B) defined in the experiment settings. This is an exercise in the new book (Peirce & MacAskill, 2018) on pages 118-120.
What did you try to make it work? Used a very basic Stroop design prepared in previous exercises, which works fine. Created 2 .xlsx files (GroupA.xlsx and GroupB.xlsx) both containing a single “language” variable referring to the order of the languages (English-Maori for GroupA and Maori-English for groupB). Folder also contains 2 .xlsx condition files for each of the languages (English.xlsx and Maori.xlsx). Next, added a custom variable named
group in the Experiment Info dialog box. Referred to this in the BlocksLoop using:
$'Group' + group + '.xlsx' In the TrialLoop I already used a reference to the two language files:
$language + '.xlsx'
What specifically went wrong when you tried that?:
##### Running: C:\Data Eva\Onderzoek\PsychoPy\Exercises\Stroop\new2\Stroop.py ##### Traceback (most recent call last): File "C:\Data Eva\Onderzoek\PsychoPy\Exercises\Stroop\new2\Stroop.py", line 170, in <module> trialList=data.importConditions('Group' + group + '.xlsx'), NameError: name 'group' is not defined