Splitting rows into half and loop read one of the half rows

Hi there,

My question is how to divide rows into two and read separately without repeating for loops. I have an excel file with only one condition [columns] and 52 questions [rows]. For my script, I created a routine associated with this excel file, and a loop for this routine. I need to run the loop twice. In each loop, I want the routine to randomly display 26 questions from the excel file without repeating the questions.

I tried shuffling the rows and selecting the row [0:26] for the routine. The questions were randomized and ran smoothly of displaying 26 different questions in the first loop. However, for the second time of looping, it repeated the same questions that were displayed in the first loop. I think it issue is because I specified to select the row [0:26] which makes it unable to read other rows that are over 26, but I took me so long to think of it, and unable to figure out how to make the loop display questions without repeating. Could anyone help me out? Any hint will be highly appreciated!

This is my code and routines:

If anything that is unclear, I would love to provide more information. Thank you so much in advance!!

What I would do is have an outer loop which iterates through all the rows and either two inner loops or simply routines which customise based on the value of trials.thisN

My apologize. I’m not quite sure what you mean by inner loops. Do you mean adding a extra loop outside the shame_block (contains Qs_shame and break routines)?

Here’s a demo for a simple task. I’ve added to my Online Demos page.

Counterbalancing code | try it

This demo uses an outer loop to randomise across a set of stimuli, but runs one task for the first half of the items and a different task for the second half.