I was wondering if there is any way I can use the same JS script for two different lists of stimuli (instead of creating two different scripts, and therefore two different projects on pavlovia).
With local PsychoPy, I would just create an item field in the diag box at the beginning of the experiment and then have the subject select it according to my needs, as shown here.
Given that my new experiment is going to be online, I would like to be in control of the two lists to feed the script with. What I was imagining is, for example, control the two lists by specifying the list within the URL of the experiment. From what I gathered in the PsychoPy webpage on online- participant recruitment, I can just use the URL address of my experiment with a specific query string, e.g.:
https://run.pavlovia.org/yourUsername/yourStudyName/index.html?list=list1.csv
The variable list
is then inserted as argument of the loop:
function loopTrialLoopBegin(thisScheduler) {
// set up handler to look after randomisation of conditions etc
loopTrial = new TrialHandler({
psychoJS: psychoJS,
nReps: 1, method: TrialHandler.Method.RANDOM,
extraInfo: expInfo, originPath: undefined,
trialList: list, // <----
seed: undefined, name: 'loopTrial'});
psychoJS.experiment.addLoop(loopTrial); // add the loop to the experiment
currentLoop = loopTrial; // we're now the current loop
...
}
Is that at all possible?