Error when importing conditions - whole conditions file excel not importing

URL of experiment: Pavlovia
Maddie Quirk / attentional_history3 · GitLab

Description of the problem:

I’ve come across several threads detailing this same problem, but none of the suggested solutions I have tried implementing have worked. My project works perfectly fine again on Psychopy and I was encountering a freezing error on pavlovia before that I actually can’t tell if it is fixed or not because I can no longer get to the actual experimental trials of my study. I have been testing this study on Pavlovia for several weeks now and this is the first time I have ever gotten this import conditions error that my conditions excel file is not supported (see below).

I’ve read that this could be due to a nested loop where the inner loop can’t access this imported file, but I haven’t changed anything about this structure since I have started testing it and have never had this issue. I also saw that online the selected_Rows variable has to be 0:1 to access a 0 index, so I tried implementing an if statement in the JS to set my $select_trial variable to “0:1” if the index was 0 - that didn’t work. I have also now deleted my experiment several times on Pavlovia and reuploaded to no avail. I also tried changing my .xlsx file to a .csv and still got the same error.

The flow of my main experimental trials is pictured below:

My excel file controls proportions of distractor-present trial presentation, so I would really really like to not have to hard code in all the variables of my trials. Especially when importing my conditions has worked in all previous versions of this exact task. The only thing I have changed is some of the code controlling the trial selection in the condSelect_exp routine. The javascript translation is pasted below.

trial_id += 1;
rand_array = randint(0, 2).toString();
trialTracker.append(rand_array);
runTrials += 1;
duplicateCheck = false;
trackerSize = trialTracker.length;
if ((expInfo["condition"] === "experimental")) {
    if (((trial_id % 3) === 0)) {
        select_trial = randint(0, 9).toString();
    } else {
        select_trial = randint(9, 27).toString();
    }
} else {
    if ((trackerSize >= 2)) {
        if (((trialTracker[(trackerSize - 1)] === "0") && (trialTracker[(trackerSize - 2)] === "0"))) {
            duplicateCheck = true;
        }
    }
    if ((distractorPresent.length === 0)) {
        shuffle(distractorAbsent);
        select_trial = distractorAbsent[0].toString();
        distractorAbsent.pop(0);
    } else {
        if (((distractorAbsent.length === 0) && (duplicateCheck === false))) {
            shuffle(distractorPresent);
            select_trial = distractorPresent[0].toString();
            distractorPresent.pop(0);
        } else {
            if (((rand_array === "0") && (duplicateCheck === false))) {
                shuffle(distractorPresent);
                select_trial = distractorPresent[0].toString();
                distractorPresent.pop(0);
            } else {
                shuffle(distractorAbsent);
                select_trial = distractorAbsent[0].toString();
                distractorAbsent.pop(0);
            }
        }
    }
    if ((runTrials === 27)) {
        distractorPresent = [0, 1, 2, 3, 4, 5, 6, 7, 8];
        distractorAbsent = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26];
        runTrials = 0;
    }
}

With these variables all defined initially at the beginning of the experiment in the select_trial2 component:

runTrials = 0;
distractorPresent = [0, 1, 2, 3, 4, 5, 6, 7, 8];
distractorAbsent = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26];
trialTracker = [];

I don’t believe the code should be producing this error though, but I am yet again at another loss and pretty desperate to resolve this as soon as possible. Any help would be so greatly appreciated.

You misunderstood this advice. For any single row you need x:x+1 to access online.

You currently have a JavaScript error which, in my experience, is most often due to one of the following.

  1. a text element with a size that rounds to zero (e.g. .1) when the units are in pixels.
  2. setting an image as unspecified.
  3. Trying to run an experiment straight after syncing changes when there are lots of resources. To resolve this close and reopen the browser.
  4. Setting a property “during: ISI”.

Thanks for the quick response. That’s my fault then. I came across the reasons for a JS error you have pasted in here in another thread, but I don’t believe one of those to be the issue. I have run this experiment online before with the following code format where my $select_trial variable is set to a random integer within those ranges and even in the JS just being set to a single row index which has worked fine for several different iterations of this experiment.

I have this auto translating into JS right now, but then set it to Both to tweak the JS to this (which could be very incorrect, I am not as familiar with JS) but then it didn’t get passed the initializing experiment window, so I know it is wrong in some capacity, but I am not sure how or where.

if (((distractorAbsent.length === 0) && (duplicateCheck === false))) {
            shuffle(distractorPresent);
            select_trial = distractorPresent[0].toString(); #autotranslated
            distractorPresent.pop(0);
        } else {
            if (((rand_array === "0") && (duplicateCheck === false))) {
                shuffle(distractorPresent);
                select_trial = (distractorPresent[0]:distractorPresent[0] +1).toString(); # what I just tried
                distractorPresent.pop(0);