Hi all,
URL of experiment: Face-Project/OtherRaceEffect_Program.psyexp at main · PaigeKemp/Face-Project · GitHub
Extra information: All the extra files (I.e., jpg’s, and xlsx’s) to run the experiment are in located here:
Description of the problem: I am trying to convert my local experiment to an online format, and I have been informed by many other forum topics that the code import random
does not work online because it is Python and you have to convert everything to Javascript. I have attempted to use the crib sheet which has been promoted by @wakecarter many times and I believe I have changed my code accurately. For example, my code has now been changed from (Code: Auto → JS):
import * as random from 'random';
var format, formats;
formats = [1, 2, 3];
format = random.choice(formats);
to (Code: JS):
function random_character() {
var chars = "ABC";
return chars.substr( Math.floor(Math.random() * 3), 1);
}
condition = random_character();
But now I am uncertain on how to access the three different xlsx files (B1_A.xlsx, B1_B.xlsx, B1_C.xlsx) I have per loop based on whether the format is A, B, C. I have tried changing the condition of the loop to:
$“B1_” + condition + “.xlsx” however the “Ok” button always seems to be disabled and so I cannot move forward.
Any help on resolving this issue would be fantastic, I appreciate all the help I can receive.
Best,
Paige