# Randomize only parts of experiment

**URL:** <https://discourse.psychopy.org/t/randomize-only-parts-of-experiment/7568>\
**Category:** Builder\
**Created:** [April 29, 2019, 9:56am UTC](https://discourse.psychopy.org/t/randomize-only-parts-of-experiment/7568 "2019-04-29T09:56:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anyway](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@anyway](https://discourse.psychopy.org/u/anyway)\
**Post date:** [April 29, 2019, 9:56am UTC](https://discourse.psychopy.org/t/randomize-only-parts-of-experiment/7568/1 "2019-04-29T09:56:45Z")

</div>

macOS PsychoPy version v3.0.0b13

Hi everyone,  
the flow of my experiment is following:  
Part A (Intro) - Part B (Instruction + trials) - Part C (Instruction + trials) - Part D (instruction + trials) - Part E (Instruction + trials) - Part F (end).

What I would like:  
Randomize order of Part C and E (leaving all the other parts constant).  
Hence, participants will either go through  
A B **C** D **E** F  
or  
A B **E** D **C** F

I tried to put loops around C and E and another loop around C-E, but then I had the problem with D being inbetween.

what is the most simple way to change the order of C and E while leaving the order/position of the other blocks constant?

thank you very much for your help

---

<div class="post-metadata">

**Author:** ![jderrfuss](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jderrfuss/32/5245_2.png) [@jderrfuss](https://discourse.psychopy.org/u/jderrfuss)\
**Post date:** [May 2, 2019, 12:43pm UTC](https://discourse.psychopy.org/t/randomize-only-parts-of-experiment/7568/2 "2019-05-02T12:43:47Z")

</div>

Hi,

This depends on what exactly varies between blocks C and E: Instructions? Input files? Trial routines?

If it’s just instructions and/or input files, a simple code component would be sufficient to take care of randomising or counterbalancing C and E. If the actual trial routine is different, things will probably be more complicated.

Jan
