Help getting started!

Windows11 PsychoPy v2023.2.1

I am new to PsychoPy and coding, and I am trying to set up an experiment with a complicated design. I have two image types with 42 images in each, nameable and unnameable, and I am looking to compare restudy to practice retrieval.

I have set the image paths as such:

Define image file paths

nam_files = [“Objects_and_lures/inanimate{}.jpg”.format(format(image_number, “02d”)) for image_number in range(1, 43)]
unn_files = [“NOUN_and_lures_2/abstract{}.jpg”.format(format(image_number, “02d”)) for image_number in range(1, 43)]

I need to have 14 blocks; each block needs to have a study round with 3 images from each group in random order (so that each image is only presented once), followed by a practice round that alternates every other block to be either 1) just restudy of the same 6 images seen in study, or 2) retrieval practice, which consists of a routine where only an aperture of the original 6 images is shown, followed by a (randomized) serial presentation of each target image and 3 lures. Then, regardless of practice round type, it should be followed by a final test that is identical to the retrieval practice (aperture then target and 3 lures). To make things more complicated, I need to have the test routines interleaved like this: 1study1practice 2study2practice 1test 3study3practice 2test 4study4practice 3test… (If this can be modified later that is fine, but I wanted to mention it in case it was crucial to the structure setup).

I had tried to pick up off the forum/use chatGPT to create this structure, and I was successful to get the study block up and running, however this consisted of me creating 14 study routines each with a loop around itself and then a larger loop around that with a conditions file. I am getting stuck here because the way this is created I do not know how to proceed to get the practice round and test round inserted into this loop system or to read which images are particular to each block. Additionally the 14 routines are just too insane to work with because every time I want to tweak anything I am forced to write code in 14 places.

Can anyone help me with advice to set up my routines/loop structure??

Logically the simplest way to do it would be to have an outer loop and four inner loops: study, restudy, retrieval and test. The study and restudy loops should contain the same routine but given your interleaving it might be better to have different retrieval routines, since they will need to point to different stimuli.

Before the first loop you will probably need a routine with a code component that sets up which loops will run and the list of items to be used in each loop.

Have a look at some of my online demos such as Independent Randomisation and Trial Switching

Thank you!