| Reference | Downloads | Github

Saving random subset from inner loop and randomly playing it


I have a cue-target memory experiment with an inner loop and an outer loop. The outer loop has a conditions file containing file names of 40 other excel files. Each of these excel files has 6 trials in them and the outer loop is set to pick a subset of 3 out of these 6 trials from each of the 20 files picked from the outer loop. Participants will have to recall the targets paired to the cue when prompted by the files chosen in the inner loop. Each of the trials in the inner loop will also give a feedback response to what was entered, if it was correct or wrong and if wrong what the answer should be. All is working well up to this point, but now i am stuck at the repeating of the inner loops part.

I want to repeat the inner loop subset 3 times randomly. However setting the nReps to 3 sets the repeat to happen before the subset selection, how can i set the repeats to occur after the subset selection? Also, ideally i would like to be able to save all the selected subsets from the 20 conditions from the outer loop (so a total of 60 trials) and then present them to the participants randomly 3 times.

I have zero coding experience but i cannot figure out a way to do this without having to use codes.

I found that
numpy.random.choice( , ), replacement=False would allow picking of random subsets without repeats. however, the builder’s random function seems to be doing that fine.

numpy.tile ( ,3) would seem to allow the defined variable to be repeated the number of times according to the number i put after the coma.

However, I don’t know how to fit this into the script… I am not sure where to insert them and I am not sure how to define the variable for that.

I have attached the psychopy file here, appreciate any guidance I can get! Thank you so so much in advance.

same repeats test.psyexp (11.7 KB)