PennController for IBEX › Forums › Support › Stuck in one trial.
- This topic has 2 replies, 2 voices, and was last updated 2 years, 10 months ago by gdemeurisse.
July 18, 2020 at 12:28 am #5802gdemeurisseParticipant
I’ve been writing this code as follows
newTrial( newText("the cat jumped over the moon in pajamas") .print() , newImage("one", "thecatinpajamas.png") .size(200,200) // .print() , newImage("two", "themooninpajamas.png") .size(200.200) // .print() , newCanvas(450,200) .settings.add( 0, 0 , getImage("two") ) .settings.add(250, 0, getImage("one") ) .print() , newKey("FJ") .wait() ) SendResults() newTrial( newText("Thank you for your participation!") .print() , newText("Click here to validate your participation") .print() )
And I’ve been unable to get my code to run past the first two images in the canvas. Instead of moving onto SendResults() after hitting the “F” or “J” key after the first trial, it says “progress” with a blank screen and doesn’t move any further.
The way I am trying to get this experiment to run is to display a sentence with two side-by-side images in a canvas. Following that, I want to display a Flanker image.
Before posting here and before scripting “SendResults” I’ve also tried adding a third image: newImage(“three” , “flanker.png”). I had the third image uploaded in my resources file as a .png file and it was entitled the same as it was in my script. I tried scripting the third image two ways: I tried to add it to my canvas along with the first two images, and I tried scripting it to run after my first canvas. When I had the third image in the trial, it didn’t run regardless of where in the script it was. PCIbex showed no syntax errors. I also tried adding .wait() under my canvas, but the images were erased when I included that.
In short, regardless of whether or not I add more variables within the same trial, or add a second trial, I cannot get my experiment to move beyond the first key press of “F” or “J” and the first canvas (the first two side-by-side images).
I’ve consulted two multi-trial scripts that I have access to and the two PCIbex tutorials (the older one and the newer Zoom webinar tutorial) and I’m not quite sure where I might be scripting wrong.
Thank you in advance!
GraceJuly 20, 2020 at 11:05 am #5806JeremyKeymaster
Your script works as intended: it shows the two pictures side by side, waits for a keypress on F or J, then reaches the end of the first trial so it moves to the next one, namely the SendResults trial, and after that it moves to the next (and final trial) where it prints two Text elements and immediately reaches the end of the trial, thus moving to a final empty screen. Just add something like newButton().wait() after printing your second Text element to fool the script into waiting on that trial forever.
Re. your third image, I am not sure what’s happening, but people have identified a bug with the farm where, if you name a file with an uppercase extension (eg. flanker.PNG) the experiment won’t run (you get a blank screen). Also, there is no wait command for the Canvas element (see the list of commands here).
Here is a script that should print all the images as you intend, as long as you have correspondingly named files (case-sensitive) under Resources (I don’t insert a linebreak before single commands, but you can keep them there if you prefer):
newTrial( newText("the cat jumped over the moon in pajamas").print() , newImage("one", "thecatinpajamas.png").size(200,200) , newImage("two", "themooninpajamas.png").size(200.200) , newCanvas("onetwo", 450,400) .settings.add( 0, 0 , getImage("two") ) .settings.add(250, 0, getImage("one") ) .print() , newKey("FJ").wait() , getCanvas("onetwo").remove() , newImage("flanker.png") .size(200.200) .print() , newButton("Next") .print() .wait() ) SendResults() newTrial( newText("Thank you for your participation!").print() , newText("Click here to validate your participation").print() , newButton().wait() )
JeremyJuly 22, 2020 at 11:21 pm #5850gdemeurisseParticipant
Thank you so much! That ran just as I wanted it to. I appreciate your help!
- This reply was modified 2 years, 10 months ago by gdemeurisse.
- You must be logged in to reply to this topic.