Reply To: Trouble logging participant information

PennController for IBEX Forums Support Trouble logging participant information Reply To: Trouble logging participant information

#6868
Jeremy
Keymaster

Dear Ana-Maria,

First, make sure that your PennController file is not version 1.9: there is a bug in that version where the post-shuffle order reported in the results file is inaccurate

Once you get the order properly reported in the results file, it’s easy to retrieve which key was pressed: say the picture that was chosen was picture2 and picture2 is third in the reported order, then the key that was pressed was X

If you want to additionally report the filename of each picture in the results file, you can use newTrial().log

Here is a basic code that illustrates those ideas:

Template( row =>
    newTrial(
        newSelector("pictures")
        ,
        defaultImage
            .size("10vw","10vw")
            .selector("pictures")
        ,
        newCanvas("container", "80vw","80vh")
            .color("lightgray")
            .add("center at 25%","middle at 25%",newImage("picture1",row.picture1))
            .add("center at 75%","middle at 25%",newImage("picture2",row.picture2))
            .add("center at 25%","middle at 75%",newImage("picture3",row.picture3))
            .add("center at 75%","middle at 75%",newImage("picture4",row.picture4))
            .print("center at 50vw","middle at 50vh")
        ,
        getSelector("pictures")
            .log()
            .shuffle()
            .keys("E","I","X","M")
            .wait()
    )
    .log("picture1", row.picture1)
    .log("picture2", row.picture2)
    .log("picture3", row.picture3)
    .log("picture4", row.picture4)
)

You can try it out here: https://farm.pcibex.net/r/RONttQ/

Here’s a result line that was generated for the first trial:

1618581521,c12c0535fba1b8e2ff8e0a39d068826c,PennController,0,0,Item-1,NULL,Selector,pictures,Selection,picture2,1618581519920,bear.png,cat.png,chicken.png,deer.png,picture4;picture1;picture2;picture3

As you can see, I chose picture2 and if I look up the order, I see that picture2 ended up occupying the third position after the shuffle: this means that I chose the bottom-left picture by pressing X. Additionally, I see that picture2 was cat.png (note that the order of the filenames in the result line are not shuffled)

You can automatize those associations in R, for example

Let me know if you have questions

Jeremy