Looping whole experiment with different excel files for blocks

Hi,

I would like to create loops/blocks within my experiment since I want it to run online without having the participant open 4 separate tasks for each block. The task will have 4 blocks of 30 trials, each will need to run the whole way through until the feedback. There are 3 excel files present, familiarisation, encoding and retrieval. I wanted to know if there is a way to get a loop to run the whole experiment 4 times with all 3 excel files being different each loop. Is this possible?

I have attached the basic builder template I am using but I have added various coding elements to this so ideally I would like to find a way I can add this onto the code directly.

The outer loop can point to a spreadsheet with three columns containing the names of the excel files for each iteration. Then put those variable names into the inner loops starting with a $ so they are interpreted as variables/code.

is this what you mean

and in the conditions I put $Familiarisation_practice for the first iteration or the name of the excel file i created called $Repeats_2?

Repeats_2.xlsx is the conditions file for the outer loop (if that’s its name).

$familiarisation_practice (small f) is the conditions file for the familiarisation practice inner loop.

thank you,

I am getting an error saying it can’t find familiarisation_1 file. I checked and there’s no spaces in the excel file and its spelled correctly.

Ah. You (we) forgot about the extension. Try

$familiarisation_practice + '.xlsx'

i tried and now it says this

psychopy.exceptions.ConditionsImportError: Bad name: familiarisation_practice.xlsx

"Parameters (column headers) cannot contain punctuation or spaces"

ive checked for spaces in the excel but there arent any.

Perhaps there is an extra column.

i made another excel from scratch to see if that was the issue and it still says the same error.

Try with an incognito tab and then upload your spreadsheet if you have the same issue.

Personally I check spreadsheets (if I can’t tell) by saving them as CSV and then opening in a text editor.

this is the CSV in text editor

You shouldn’t have .xlsx in the column names

“Parameters (column headers) cannot contain punctuation or spaces”

The “.” is punctuation

ah i see, it works now, however it is starting from familiarisation_1 rather than the practice.

Ah…your spreadsheet didn’t have column titles at all. Put the practice spreadsheets below the titles.

I added the titles now, and this is the following error

trialList=data.importConditions(familiarisation_practice +'.xlsx'), 
NameError: name 'familiarisation_practice' is not defined

Is this the name of one of your columns in your spreadsheet?

yes

Please could you show a screenshot of your flow and then the loop definitions?


the loop definitions are the same for the other 2 loops, just with the condition file name changing

Please could you show the loop screenshot for trials_4 (the outer loop)?