Presenting each row of the excel file twice

Hi everyone. I have a simple question and it’s how can I make each row of my excel file to be presented twice before going to the next row? What I’ve been suggested before is to create two routines and put them next to each other in one loop so that both of them refer to the same excel column. But as my experiment becomes too big and complicated that way, I need to find another way for that. I appreciate it a lot if you could help me.

Did you know that you can present the same routine twice? You don’t need to make a copy, which means you don’t have problems with version control.

Yes, but I don’t want the routine to be played twice. Because what my routine does is that it presents rows of one column in the excel file randomly. I want psychopy to choose rows of the excel file randomly but I want the chosen row be presented twice instead of once, before going to the next row. I don’t know if I’m explaining well.

If you have the same routine twice within a single loop, they will both refer to the same row of the spreadsheet.

You could equally put everything in your routine twice, but then you’d need code to record the two responses.

Actually, I think you will need a piece of code to move the data file on a row. Otherwise the second routine will replace the first response.

I don’t need to record responses for these two presentation of the same row. I just what the selected row to be presented twice and I want to do it in a way other than putting two same routines in the loop. I want to use one routine. I there a way to do that?

What triggers the second presentation?

Actually nothing!
To be precise, I need to have two main category of auditory and visual presentations, and within each category, I must present another two category of single stimuli and sequential stimuli. Within each of these subcategories, I must present a trial twice and then a third trial that must be judged by the participant. As you see this is an almost big experiment. If I could counterbalance loops, I could design whole of my experiment the way I want because there are many loops in my experiment that need to be counterbalanced. But as I know we could not counterbalance loops. That’s why I decided to remove extra routines by removing repeated ones.
Can we counterbalance loops consisting of other loops?

In principle I’m sure I could write the experiment counterbalancing you want.

One way to counterbalance loops is to have an outer loop with a spreadsheet containing the names of the spreadsheets used by the inner loop.

Thanks a lot for your reply. Actually that’s what I’ve done. The outer loop contains a spreadsheet containing the spreadsheets that inner loops use. But again it doesn’t present inner loops in random. They are sequential with the order the inner loops appear on the psychopy!
I don’t know if I’ve missed something! for example in loop properties or somewhere else!

Have you selected random order for both loops?

Yes. Both of them are random.

Please could you show screenshots of your flow and your loops?

I’ve used this method before but I saw on another thread that someone else is also having problems with so I guess it’s possible that there’s a bug in recent versions.


This is, in fact, the simplified version of my experiment design (as my experiment is bigger than this). I just wanted you to see that even at this level, I can’t have a randomized loop. As you see in the picture there is auditory part first and then visual part, and it is always presented this way (first auditory and then visual)!!

and another weird thing is that although in the outer loop I’ve set the nRep to 1 but it repeats the loop two times!!

Your outer loop contains two inner loops so they will each be presented once for each row of the spreadsheet your outer loop is pointing at (if there is one)

That isn’t what I meant at all.

I would appreciate if you explain in more details. I don’t know why auditory and visual loops can’t be presented at random and why the order of presentation is auditory, visual, auditory, visual all the time.
While I want it to be auditory, visual OR visual, auditory.

There are two ways to do this, but the most important thing to understand is that you can’t randomise the order of presentation of routines or loops in the flow.

  1. The simple way.

Make a second auditory trials loop that appears after the visual trials loop. Set nReps for the first auditory loop as order and the second as 2-order. NReps for the visual loop should be 1. Use code to allocate order as 1 or 2.
If 2-order doesn’t work use a second variable order2

  1. The elegant way.

Make the routines so that can present visual and auditory. Then have your outer loop and a single inner loop routine. The behaviour of the trial is determined by parameters in the outer spreadsheet.