Reply To: Selector problem

PennController for IBEX Forums Support Selector problem Reply To: Selector problem

#6442
Jeremy
Keymaster

Hi Giorgio,

I’m not sure why you encounter this specific problem, but I can suggest a few edits that hopefully will help with it:

Template("recotask", row =>
    newTrial("Reco",
        defaultImage.size("25vw","35vh")
        ,
        newImage("TARGET",row.FIGURATARGET).print("center at 50vw", "middle at 20vh"),
        newImage("SECOND",row.IMA2).print("center at 50vw", "middle at 80vh"),
        newImage("THIRD",row.IMA3).print("center at 25vw", "middle at 50vh"),
        newImage("FOURTH",row.IMA4).print("center at 75vw", "middle at 50vh")
        ,
        newSelector("objeto")
            .add(getImage("TARGET"), getImage("SECOND"), getImage("THIRD"), getImage("FOURTH") )
            .shuffle()
            .disable()
            .log()
        ,
        newButton("escucha").print("center at 50vw","middle at 50vh").wait().remove()
        ,
        newAudio(row.audio).play().wait()
        ,
        getSelector("objeto").enable().wait()
        ,
        clear()
        ,
        getImage("TARGET").print("center at 50vw", "middle at 50vh")
        ,
        newTimer(1000).start().wait()
        ,
        clear()
        ,
        newVar("correct").global().set(true)
        ,
        getSelector("objeto").test.selected(getImage("TARGET"))
            .failure(getVar("correct").set(false))
        ,
        newButton("Next").print().wait()
    )
    .log("correctChoice", getVar("correct"))
)

First I got rid of the recognizz newTrial, which improperly embedded a Template command. I replaced all the percentage coordinates with viewport coordinates, and got rid of the intermediate up/left/down/right Canvas elements. Since Selector elements have a shuffle command, I used that instead of the fisherYates method. I also replaced the .test.selected part: I test getImage("TARGET") instead of simply "TARGET". I also use a global Var element to report whether the choice was correct as an additional column in the results file

Let me know if you have questions, and whether that solved the problem

Jeremy