Hi all,
As I found in several posts, in order for the slider to be drawn in online experiments, we need to define another component (say a mouse and a box with the label of “NEXT”) so participants first respond to the slider and then click on the box. The problem with this method is that if someone clicks on the box, it will go to the next trial, without responding to the slider.
I used the following code to stop this and it works. However, now if someone clicks on the screen before the mouse and box appear (which they appear after 5 secs), then the map undefined error would show.
// continue if both slider and mouse is clicked
if (mouse_confidence.getPressed()[0] === 1) {
clickable = [save_box];
for (const obj of clickable) { // for each clickable stim, check if it contains the mouse
if (obj.contains(mouse_confidence)) {
if (obj === save_box && slider_confidence.getRating()) {
continueRoutine = false;
} else {
continueRoutine = true;
}
}
}
}
Any idea on how to solve this problem? Thanks.