# Perception Tasks Randomization

**URL:** <https://discourse.psychopy.org/t/perception-tasks-randomization/40984>\
**Category:** Builder\
**Created:** [August 3, 2024, 8:21pm UTC](https://discourse.psychopy.org/t/perception-tasks-randomization/40984 "2024-08-03T20:21:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Avichai\_Bachar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/avichai_bachar/32/41257_2.png) [@Avichai\_Bachar](https://discourse.psychopy.org/u/Avichai_Bachar)\
**Post date:** [August 3, 2024, 8:21pm UTC](https://discourse.psychopy.org/t/perception-tasks-randomization/40984/1 "2024-08-03T20:21:07Z")

</div>

Hello,  
I’ve created 3 perception tasks as part of my experiment (as seen in the attached picture). The problem is that I would like them to be presented randomly but I don’t know how to do this. I know that I have to create a bigger loop that encompasses them all, but I don’t know what to set in it’s properties and what information to insert in the excel file. I would like to get some help.  
Thank you very much!

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/1/e/1e393349489494cbe1ebc1031833b2a0b7a7132e.png)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [August 4, 2024, 6:47am UTC](https://discourse.psychopy.org/t/perception-tasks-randomization/40984/2 "2024-08-04T06:47:01Z")

</div>

Have a look at this post for a commonly recommended approach.

> [@Randomizaing Loops](https://discourse.psychopy.org/t/randomizaing-loops/37708):
>
> System: macOS Version 11.5.1 Psychopy version: v2023.2.3 I am designing a study where participants will be presented with four conditions, and 18 randomized sentences will be presented in each condition. As shown in the screenshots, I want to randomize the four loops without mixing any conditions within. In that case, only HigherKey, LowerKey, Instrumental and Control will be randomized, but not the sentences between conditions. I have three loops here, the most inner one is a loop to show …

---

<div class="post-metadata">

**Author:** ![Avichai\_Bachar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/avichai_bachar/32/41257_2.png) [@Avichai\_Bachar](https://discourse.psychopy.org/u/Avichai_Bachar)\
**Post date:** [August 4, 2024, 4:49pm UTC](https://discourse.psychopy.org/t/perception-tasks-randomization/40984/3 "2024-08-04T16:49:12Z")

</div>

Thanks for your comment.  
I followed the instructions, and it went well until I created the outer loop. I gave the columns in the excel file the names of the inner loops but the program doesn’t launch the experiment and exits with code 0. Print screen is attached.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/7/8/78d0aea1df6d420ece20a7b3cba222b47d06fca6.png)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [August 4, 2024, 6:02pm UTC](https://discourse.psychopy.org/t/perception-tasks-randomization/40984/4 "2024-08-04T18:02:55Z")

</div>

Exit code 0 means no errors.

Please could you show one of your inner loops and the spreadsheet you use for your outer loop?

---

<div class="post-metadata">

**Author:** ![Avichai\_Bachar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/avichai_bachar/32/41257_2.png) [@Avichai\_Bachar](https://discourse.psychopy.org/u/Avichai_Bachar)\
**Post date:** [August 4, 2024, 6:46pm UTC](https://discourse.psychopy.org/t/perception-tasks-randomization/40984/5 "2024-08-04T18:46:03Z")

</div>

Properties of one of the inner loops:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/9/a/9a80740b303472a15f717667e4e453a1fb57a420.png)  
Spreadsheet of the outer loop:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/1/6/1675b0b58670b5026e02601cd65381627d485607.png)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [August 4, 2024, 6:48pm UTC](https://discourse.psychopy.org/t/perception-tasks-randomization/40984/6 "2024-08-04T18:48:49Z")

</div>

Change Num repeats of SIN\_Trial to SIN\_Trial (your spreadsheet column) and change the name of the loop to, e.g. SIN\_Loop

Repeat for your other inner loops

---

<div class="post-metadata">

**Author:** ![Avichai\_Bachar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/avichai_bachar/32/41257_2.png) [@Avichai\_Bachar](https://discourse.psychopy.org/u/Avichai_Bachar)\
**Post date:** [August 4, 2024, 7:02pm UTC](https://discourse.psychopy.org/t/perception-tasks-randomization/40984/7 "2024-08-04T19:02:12Z")

</div>

It works! Thank you my friend, you helped me a lot!
