URL of experiment: version2_4Img [PsychoPy]
Description of the problem: This is an experiment which shows the preview of the images and then asks the participants to test by asking to solve the puzzle (which is to reorder the image grid) Later the ‘checkAnswer’ is the function which validates the answer. In my case it is always ‘Incorrect’ which is due to ‘picked’ is not able to extract the ‘.image’ but when I tried to check with ‘.name’ it is displaying correctly (img1, img2…). Not sure what went wrong. Any leads would be appreciated
This a piece of JS code:
for (let piece of pieces) {
if (piece.contains(mouse) && mouse.getPressed()[0] === 1 && newPiece === ‘undefined’) {
newPiece = piece;
picked.push(newPiece)
console.log(newPiece.image);
}
}
newPiece.image should print ‘Images/1.jpg’ but instead it’s printing
img1 = new visual.ImageStim({
win : psychoJS.window,
name : ‘img1’, units : ‘norm’,
image : ‘Images/1.jpg’, mask : undefined,
ori : 0.0, pos : [(- 0.425), (- 0.37407407)], size : 1.0,
color : new util.Color([1, 1, 1]), opacity : undefined,
flipHoriz : false, flipVert : false,
texRes : 128.0, interpolate : true, depth : -1.0
});