Hello,
I am experiencing a problem when synching my experiment online: I have an image stimulus in the builder, called ‘Slides’ and this is supposed to be filled with a conditional and randomised slide deck.
In the offline version this is working without problems and also in a previous online version without the slide deck randomisation I had no issues. So I am assuming that this might be related to this new code snippet. Any help would be more than appreciated
Thanks,
Jasmin
Loop: Interim
Trial: InitializeInterim
Tab: End Routine
var Cond;
messageType = "interim";
Cond = Math.random(["Gain", "Loss"], {"size": 1});
Loop: interim
Trial: messages
Tab: Begin Routine
key_resp = new core.Keyboard({psychoJS: psychoJS, clock: new util.Clock(), waitForStart: true});
idx = 0;
selectedDeck = [];
if ((messageType === "introduction")) {
selectedDeck = introSlide;
}
if ((messageType === "interim" && Cond === "Gain")) {
selectedDeck = interimSlideGain;
gainc = 'gain';
CDN.push(gainc);
}
if ((messageType === "interim" && Cond === "Loss")) {
lossc = 'loss';
selectedDeck = interimSlideLoss;
CDN.push(lossc);
}
if ((messageType === "thanks")) {
selectedDeck = thanksSlide;
}
thisSlide = selectedDeck[idx];
Each Frame:
theseKeys = key_resp.psychoJS.eventManager.getKeys({"keyList": ["left", "right"]});
if (theseKeys) {
if (((theseKeys[0] === "left") && (idx > 0))) {
idx -= 1;
} else {
if (((theseKeys[0] === "right") && (idx < (selectedDeck.length - 1)))) {
idx += 1;
} else {
if (((theseKeys[0] === "right") && (idx === (selectedDeck.length - 1)))) {
continueRoutine = false;
}
}
}
}
thisSlide = selectedDeck[idx];
Slides.setImage(selectedDeck[idx]);
The image stimulus refers to a builder component with the name ‘Slides’