URL of experiment: Sign in · GitLab
Description of the problem: I’m trying to run a loop that will only execute one row (out of 8) of an excel file. This works in python, but not online. The loop works fine online if I leave the “Selected rows” field blank, though. When I try selecting a specific row (say 0), and run it online, the variable are undefined. This (below) is how I set the loop up in builder.
From looking at the code (below), looks like the key might be setting up the triallist parameter to select a specific row using importConditions using a code component.
var consent_loop;
var currentLoop;
function consent_loopLoopBegin(thisScheduler) {
// set up handler to look after randomisation of conditions etc
consent_loop = new TrialHandler({
psychoJS: psychoJS,
nReps: 0.125, method: TrialHandler.Method.RANDOM,
extraInfo: expInfo, originPath: undefined,
trialList: (((((('dom' + dom) + 'fin') + fin) + 'habf') + habf) + '.xlsx'),
seed: undefined, name: 'consent_loop'
});
psychoJS.experiment.addLoop(consent_loop); // add the loop to the experiment
currentLoop = consent_loop; // we're now the current loop
I tried setting up selec = importConditions(psychoJS.ServerManager, (((((('dom' + dom) + 'fin') + fin) + 'habf') + habf) + '.xlsx'),0)
in a code component in the “begin experiment” tab, and then using it as the trialList argument for consent_loop, but this wouldn’t even let the study start running.
Ideas? Thanks!