OS (e.g. Win10): Win10 PsychoPy version (e.g. 1.84.x): v2021.2.3 Standard Standalone? (y/n) If not then what?: y What are you trying to achieve?:
Shuffle subsets of trials:
I have 14 blocks of 3-6 trials each.
I want to shuffle the trials, only within the block
For example:
In the 1st block, I have 3 trials that I want to shuffle amongst themselves.
In the 2nd, I have 6 trials to shuffle amongst themselves.
In the 3rd, I have 6 trials to shuffle amongst themselves.
…etc.
In the 14th, I have 3 trials to shuffle amongst themselves.
I want to keep the sequential order of the blocks.
What did you try to make it work?:
I have tried inserting two loops, one for sequential blocks and another for randomized trials.
The downside is, I have to create 14 conditions files, which is not preferable.
(Slightly unrelated, but I also have 10 counterbalanced groups, each group with 14 blocks, so this ends up being a lot of conditions files that I’d rather not make).
I’d prefer to take subsets of trials from a single conditions file.
I have tried inserting customized code.
This is pseudo-code, but:
I have a conditions file, each trial is labeled with block number it corresponds to. #for each block, n = 1 to 14 #compile trials with corresponding block number #shuffle this temporarily created conditions file #present randomized trials
What specifically went wrong when you tried that?:
Code does not work, I’m not sure how to put pseudocode into practice.
No error code, sorry. I just get errors that certain “names” don’t exist, and this is because I don’t know how to call the correct subsets of trials, for every block.
Nor do I know how to randomize each subset of trials.
To access the first three trials of a spreadsheet use a variable for the selected rows, e.g. useRows and in your sequential spreadsheet put useRows as 0:3. The second entry would be 3:9 for the next 6 trials.
Hi! Thank you for your discussion, it was really helpful.
I’m figuring out the same problem, where did you inserted the additional ‘$’ to make it work? Thank you.
The way to do this is to create $testRows mathematically.
You could have an outer loop pointing to a spreadsheet with two rows of a column called, say, offset with values 0 and 9 and an inner loop with three rows pointing to a column called, say, startRow with values 0, 3 and 6.
Then you would need a calculation in a code component before the blocks loop of