Stuck in one trial.

PennController for IBEX Forums Support Stuck in one trial.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5802
    gdemeurisse
    Participant

    Hi Jeremy,

    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!

    Grace

    #5806
    Jeremy
    Keymaster

    Hi Grace,

    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()
    )

    Jeremy

    #5850
    gdemeurisse
    Participant

    Hi Jeremy,

    Thank you so much! That ran just as I wanted it to. I appreciate your help!

    Grace

    • This reply was modified 3 years, 8 months ago by gdemeurisse.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.