Shuffling stimuli and carrying over to subsequent task condition

Hello. Happy new year! I’m programming a task that has 2 conditions (active vs passive). Before and after each condition, I ask participants to rate stimuli on different scales. Does anybody have advice on how to shuffle stimuli such that those selected for the rating scales are the sames ones used in respective conditions?

So, selecting 32 random stimuli out of a list of 64 for the first half of my flow, the remaining 32 for the second half of my flow.

I currently have 6 loops (pre-rating, condition 1, post-rating; pre-rating, condition 2, post-rating). Does this make sense or should I just have them all in one giant loop?

I hope this makes some sense!

Thank you for any help!

I’ve just written a demo called Trial Switching that could help. It shows you how to preload the stimuli into a list of dictionaries. You could then shuffle and slice [0:32] this list to reduce it to 32 conditions and then refer to it in future loops.