Creating Nested Loops for Stroop Task

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Windows10
PsychoPy version (e.g. 1.84.x): 2021.2.3
Standard Standalone? (y/n) If not then what?:
What are you trying to achieve?: I have built the stroop task for a class assignment using the builder component and it runs perfectly. However, my professor has asked that we use two languages and two different fonts as well. I am also very new to this and have never used any coding software before.

What did you try to make it work?: I read the chapter on bilingual stroop task in the text “Building Experiments in PsychoPy” and following the steps does not work for me and it will crash. I created two conditions files, one containing the English words and the other containing Spanish words. I also created another two files that contains the two language groups (each with a different order). Now I understand that I can use nested loops for this and that the outer loop can be used to choose which condition file that should be used. What I don’t understand is where the files (with the conditions) go. The text book gave this expression to be placed in the conditions file field of the inner loop: $language + ‘.xlsx’ and this expression: $’ Group ’ + group + ’.xlsx’ to be used in the outer loop. Now if the condition file field contains these expressions they cannot contain a conditions file, so where do these files go so the programs knows where to pull the information from?

What specifically went wrong when you tried that?:
Include pasted full error message if possible. “That didn’t work” is not enough information.
This is what it says when I try to run it:

Running: C:\Users\maddy\OneDrive\Desktop\PSYC4021\

3640.3085 INFO Loaded monitor calibration from [‘2022_01_20 10:01’]
File “C:\Users\maddy\OneDrive\Desktop\PSYC4021\”, line 125
trialList=data.importConditions(’ Group ’ + group + ’.xlsx’ ),
SyntaxError: invalid character in identifier

Experiment ended.

You have spaces either side of Group inside your quotes.