Issues with DashedSentence on new farm

PennController for IBEX Forums Support Issues with DashedSentence on new farm

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by Avatar zach 1 week, 3 days ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #6933
    Avatar
    zach
    Participant

    Hi Jeremy,

    I’m having a strange bug using DashedSentence on the new farm, even after updating my PennController.js file to 2.0 alpha. I’m doing word-by-word speeded acceptability. I have an image of a character with a speech bubble, so the DashedSentence controller is printing in a Canvas element.

    The first word appears in the correct place, but then it stays there, and the remaining words of the sentence appear word-by-word in a position below the correct position. (More precisely, only alternating words appear. Half of the words don’t appear at all.) Do you have any idea why this is happening? The relevant code is below. The exact same code works perfectly fine in the old farm, and I can just keep using it for now, but it would be nice to transition to the new one.

    Thanks,
    Zach

            newImage("sb1", "personA_left_inplace.png")
                .settings.size(sb_width, sb_height)
            ,
            newText("guise1_name", "Taylor")
            ,
            newCanvas("sprcanv", canv_width, canv_height)
                .center()
                .add( sb_x_left, 0, getImage("sb1"))
                .print()
            ,
            newController("DashedSentence", {s: row.Sentence, mode: "speeded acceptability", blankText: "+", display: "in place"})
                .print( ds_x_left, ds_y , getCanvas("sprcanv") ) 
                .log()
                .wait()
                .remove()
            ,
            getCanvas("sprcanv").remove()
    #6934
    Jeremy
    Jeremy
    Keymaster

    Hi Zach,

    For some reason using print(x,y,canvas) adds the Controller element twice onto the page. I need to fix this for the next release of PennController. In the meantime, use canvas.add:

    newController("DashedSentence", {s: row.Sentence, mode: "speeded acceptability", blankText: "+", display: "in place"})
    ,
    getCanvas("sprcanv")
      .add( ds_x_left, ds_y , getController("DashedSentence"))
    

    Jeremy

    #7000
    Avatar
    zach
    Participant

    Hi Jeremy,

    A belated thanks for this! With canvas.add, I’m not sure how to get wait to work properly. With the code below, it just hangs at the final word. Any idea how to fix this?

    Thanks,
    Zach

    newImage("sb1", "training_sb_inplace.png")
                .settings.size(sb_width, sb_height)
            ,
            newCanvas("sprcanv", canv_width, canv_height)
                .center()
                .add( sb_x_left, 0, getImage("sb1"))
                .print()
            ,
            newController("ds1", "DashedSentence", {s: row.SentenceText, mode: "speeded acceptability", blankText: "+", display: "in place"})
            ,
            getCanvas("sprcanv")
                .add(ds_x_left, ds_y , getController("ds1"))
                .wait()
                .remove()
    • This reply was modified 3 weeks, 1 day ago by Avatar zach.
    • This reply was modified 3 weeks, 1 day ago by Avatar zach.
    • This reply was modified 3 weeks, 1 day ago by Avatar zach.
    #7005
    Jeremy
    Jeremy
    Keymaster

    Hi Zach,

    You are calling wait on the Canvas element: there is no wait command on Canvas elements. You want to call it on the Controller element instead:

    newImage("sb1", "training_sb_inplace.png")
        .size(sb_width, sb_height)
    ,
    newController("ds1", "DashedSentence", {s: row.SentenceText, mode: "speeded acceptability", blankText: "+", display: "in place"})
    ,
    newCanvas("sprcanv", canv_width, canv_height)
        .center()
        .add( sb_x_left, 0, getImage("sb1"))
        .add(ds_x_left, ds_y , getController("ds1"))
        .print()
    ,
    getController("ds1")
        .wait()
    ,
    getCanvas("sprcanv")
        .remove()
    

    (I called remove on the Canvas element, but since you meant to call wait on the Controller element, I’m not sure which element you wanted to remove)

    Jeremy

    #7031
    Avatar
    zach
    Participant

    This worked well – thank you!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.