URL of experiment: Sign in · GitLab
When I run the experiment online it does not load the csv files. I have 3 csv files defining different trial sequences for different conditions. Participants are randomly assigned to different conditions using a code component
In python:
resp_mode = np.random.randint(2)
if resp_mode==0:
# ----- Unimanual -----
resp_mode2 = np.random.randint(2)
if resp_mode2==0:
# --- LHand ---
cond_file = 'seq_uL.csv'
intro_btext = "Press D for acw, C for cw"
elif resp_mode2==1:
# --- RHand ---
cond_file = 'seq_uR.csv'
intro_btext = "Press M for acw, K for cw"
else:
# ----- Bimanual -----
cond_file = 'seq_b.csv'
intro_btext = "Bimanual"
& in javascript
resp_mode = np.random.randint(2);
if ((resp_mode === 0)) {
resp_mode2 = np.random.randint(2);
if ((resp_mode2 === 0)) {
cond_file = "seq_uL.csv";
intro_btext = "Press D for acw, C for cw";
} else {
if ((resp_mode2 === 1)) {
cond_file = "seq_uR.csv";
intro_btext = "Press M for acw, K for cw";
}
}
} else {
cond_file = "seq_b.csv";
intro_btext = "Bimanual";
}
In builder, in trials Properties dialogue, I set the conditions to be $cond_file
.
This works when running it in python - I am randomly assigned to different conditions.
But - when running it online I get the following error message:
(Langle is the first variable to be called that is defined in the csv files) - this suggests that I am not loading the csv file correctly. I thought it might be because the csv files were not in the “resources” folder in the html - but this didn’t work either. Neither did specifying the file by hand (i.e. instead of it being random, replacing $cond_file
with seq_b.csv
. Neither did specifying the path (resources/seq.csv
).
Any thoughts?
Thanks for your time!