psychopy.org | Reference | Downloads | Github

Selecting blocks/loops

Hi,
I have 2 different loops (’'block1" and “block2”) and one larger loop above them (“selectBlock”). I want to choose between these two smaller loops in sequentional manner, e.g. Block2, Block1, Block1, Block2, etc. How can I do this?
I insterted routine called “selection” inside that outer loop and before two inner loops and I assumed that I need a code component there but I don’t know how it should look like.

Thanks in advance,
Caroline

Hi Caroline,

Not sure if there’s a more elegant solution, but you could adapt the attached example. Note that it would be possible to have multiple routines enclosed by loop1 and/or have a loop inside loop1 that repeats routines.

Hope this helps.

Jan

alternate_block_order.psyexp (7.3 KB)
repLoops.xlsx (8.4 KB)

Thank you, it worked :slight_smile:

Hi @jderrfuss your example file (psychopy file) does not open. I assume it has a code component and I want to have it if it’s possible. Could you please update it? Or do you think I can’t open it?
And also can I ask you if I want to run one of the blocks each time without repetition. I mean randomly. I have two groups: English and French languages groups and I want to allocate my participants randomly each group.

I have two different loops and one outer loop for selecting one of the groups (Blocks). I want to use fullRandom but does not figure out how?

Do you have any suggestions?

Many thanks for your help.
Best,
Zehra

Hi @Zehra,

I’ve just checked and could open the .psyexp file without any issues. I right-clicked on the link and then clicked on “Save link as…” to get the .psyexp file.

Let me know if it still doesn’t work for you. (By the way, there is no code component.)

Hope this helps.

Jan

Hi @jderrfuss,

Yes, I did it before. Just right-clicked on the link --Download linked file as… but it downloaded as XML (honestly I don’t know what it means).
Normally I can open other files but yours does not work for me.

Many thanks for your reply.
Best wishes,
Zehra

Hi @Zehra,

You can either copy and paste the XML stuff into a text file and manually change the file extension to .psyexp, or you could use a different browser to download the file (e.g., Chrome or Brave).

Jan

Hi @jderrfuss,

You’re right! It worked when I used Chrome.

Thanks!
Best,
Zehra