I put 1 in the nReps in Loop 1 (the condition file has 200 items, and I want the experiment goes through all of them sequentially) and 11 in Loop 2 so that 11 stimuli in Loop 2 will be randomly presented.
I think this code I put in ‘trial_1’ works as after 10 items from trial_1, it moves on to trial_2 (loop 2)
myCount = 0
myCount = myCount + 1
if myCount%10==0 and myCount>0:
Loop1.finished = True
But I have no idea how to prevent loop 1 keeps repeating from item 1-10. It just does not go to item 11-20 and so on.
Hey, please take a look at the following example I created for you: 2Loops.zip (30.2 KB)
Loop1 goes from rows 0 to 8 (from the first spreadsheet), then Loop2 takes a random row from the second spreadsheet.
Then Loop2 goes from 9 to 17, and Loop2 takes another random row from the spreadsheet.
The random rows from the spreadsheet won’t repeat themselves.
Let me know if I understood you correctly.
This is an example of the way I implemented it:
$str(loop1Reps)+":"+str(loop1Reps+9)
P.S.
I just noticed the conditions from the second spreadsheet have double the items. It shouldn’t matter for the principal of this method, but it will stop half way through the first spreadsheet.
Thank you so much!! This design has definitely solved my problem! It ran perfectly on Psychopy
But when I wanted to run on Palvlovia, the experiment couldn’t be initiated and there was an uncaught ReferenceError: loop1Reps is not defined. Is it because the Python code does not successfully compile to the JS code?
You might just need to put loop1Reps = 0 in Begin Experiment.
However, you may also need to set the selected rows as a variable in a code component (e.g. useRows = ) so the str() code can be translated to JavaScript.
Happy I could help
I didn’t know you needed it for an online experiment, but what wakecarter added is supposed to solve it.
Let me know if it goes smoothly.