Assign a truth value to the picture verification tasl

PennController for IBEX Forums Support Assign a truth value to the picture verification tasl

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10420
    JunLyu
    Participant

    Hi Jeremy,

    I have working on a picture verification task where participants judge whether the text description in the picture matches the content of the picture (e.g., the text box in the picture says “Two dogs are sleeping under the tree” but there is only one dog in the picture, where participants are supposed to press “F” or “J” to make a decision”). The program works but I cannot make the isCorrect function work. Below is the code:

    Template("items.csv", row =>
        newTrial("experimental-trial",
            newTimer("break", 1000)
                .start()
                .wait()
            ,
            newImage("image", row.Image)
                .size(500, 500)
           ,
            newCanvas("myCanvas", 500,500)
                .add(0, 0, getImage("image"))
                .center()
                .print()
                .log()
            ,
            newVar("isCorrect")
                .global()
            ,
            newKey("keypress", "FJ")
                .log()
                .wait()
            ,
            newSelector("selection")
                .test.selected(row.isCorrect)
                .success( getVar("isCorrect").set(true) )  
                .failure( getVar("isCorrect").set(false) )
        )
        .log("group", row.Group)
        .log("item", row.Item_ID)
        .log("condition", row.Condition)
        .log("isCorrect", getVar("isCorrect"))
    )

    The results file show “FALSE” for all my choices. Could you please kindly show me what is wrong with my code?

    Best,
    Jun

    #10421
    Jeremy
    Keymaster

    Hi Jun,

    Use .test.pressed() on your Key element to test which key was pressed, instead of .test.selected() on an unused Selector element

    Jeremy

    #10425
    JunLyu
    Participant

    Thank you Jeremy! It works now.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.