Hi,
Running experiments online in pavlovia is new to me and I have only basic knowledge about coding in python.
I am trying to push in a pavlovia stroop task with a specific kind of order stimuli - color of words should not be in the same color one after the other.
In my local computer I use code component to shuffle rows in excel file and it work:
Here is the code from begin experiment to shuffle:
import pandas as pd
import random
while 1:
choices = pd.read_excel(“blocks.xlsx”)
choices = pd.DataFrame.to_dict(choices.T)
shuffle = []
last = “”
while choices:
remaining = choices
if last:
remaining = [choices[x] for x in choices if choices[x]['color'] != last['color'] ]
remaining = pd.DataFrame(remaining)
remaining = pd.DataFrame.to_dict(remaining.T)
if not remaining:
#no valid solution
break
newElement = random.choice(list(remaining))
last = remaining[newElement]
shuffle.append(remaining[newElement])
for each in choices:
if choices[each]['index'] == remaining[newElement]['index']:
del choices[each]
break
if not choices:
pd.DataFrame(shuffle).to_excel("after_shuffle.xlsx", index=False)
break
I have a problem with pushing experiments in pavlovia. I see window with “Intilazing experiment” and then it freez. Nothing else happened…
What did you try to make it work?:
I had tried to debug it and see how it works in dev tool and in js script and I saw syntax errors when packages such as numpy append in script. I know that packages from python do not work in pavlovia. I want to ask - is it possible to do order my stimuli in this specific order - the same color of words should not repeat one after another
I couldn’t figure out how to make it work online without these packages but with this conditional order. Is it possible in another way?
Further information: I used PsychoPy Version 2021.1.2 (Builder) for programming.
Can anyone please help me? Any help will be greatly appreciated!!