OS (e.g. Win10): Windows 11 PsychoPy version (e.g. 1.84.x): 2024.2.4 Standard Standalone? (y) If not then what?: What are you trying to achieve?:
I have 48 stimuli in an excel sheet. 8 stimuli need to be presented sequentially every “fullexp” loop (total:6). The group of 8 stimuli should be different every loop. But, the group of eight words presented in triala1, triala2, triala3, and triala4 should be the same the entire loop. The 4 trial loops also have code in the Num. repeats slot for counterbalancing purposes, so I believe I need code for this solution but I have not been successful so far. Any help would be greatly appreciated.
This indicates that you have tried to read an element from an empty list. Yourlist.pop() removes the last element from your list. So each time you pop() your list gets shorter by one element until there is no element left. You are calling yourlist.pop() one too many times.
Am I right in assuming that you have modified the code to suit your needs?
Does that mean that you say the same set of eight words in all relevant routines despite the fact that your looped over the the routines six times?
OK, I hope I have understood your experimental procedure correctly.
Insert a routine before your loop fullexp. In this routine, add a code component and specify the following in the Begin experiment tab of this code component
useRows = '0:1'
stimList = ['0:8','8:16','16:24','24:32','32:40','40:48']
shuffle(stimList) #if you want random block presentation
Set the loop fullexp to 6 iterations. Leave the condition file empty.
Add a routine containing a code component as the first routine in the fullexp loop. In the begin routine tab of this code component, add
useRows = stimList.pop()
Then add your stimulus presentation routines, each surrounded by its loop, and set repetition to 1. Set the condition file to the Excel file containing your stimuli, and set the Selected rows parameter to $useRows. If you want a random presentation of the stimuli in a block, set the Loop type to random.