Multiple Mouse Clicks

PennController for IBEX Forums Support Multiple Mouse Clicks

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5285
    Farzaneh
    Participant

    Hello Jeremy,

    For the recall phase of my experiment, I want to allow multiple mouse clicks on the same visual stimuli. I also need all mouse clicks to be logged. Below is part of the trial. I cannot figure out how to implement multiple mouse clicks in the ‘new selector’ part of the script. Do you have any suggestions?

    newTrial(
       newImage("one", "Blue.png")
    		.settings.size(220 , 180)
    		.settings.css("border", "solid 1px black"),
       newImage("two", "Yellow.png")
    	    .settings.size(220 , 180)
    	    .settings.css("border", "solid 1px black"),
       newImage("three", "Green.png")
    	    .settings.size(220, 180)
    	    .settings.css("border", "solid 1px black"),
       newImage("four", "Red.png")
    	    .settings.size(220 , 180)
    	    .settings.css("border", "solid 1px black"),
       newCanvas("base1",1000,200)
    	    .settings.add( 370 , 150 , getImage("one") )
    	    .print(),
        newTimer(900)
            .start()
            .wait(),
        getImage("one").remove(),
        getCanvas("base1").remove(),
    	newTimer(1000)
            .start()
            .wait(), ///////////////////////////////////
       newCanvas("base2",1000,200)
    	    .settings.add( 370 , 150 , getImage("two") )
    	    .print(),
        newTimer(900)
            .start()
            .wait(),
        getImage("two").remove(),
        getCanvas("base2").remove(),
    	newTimer(1000)
            .start()
            .wait(), ///////////////////////////////////
        newCanvas("base3",1000,200)
    	    .settings.add( 370 , 150 , getImage("three") )
    	    .print(),
        newTimer(900)
            .start()
            .wait(),
        getImage("three").remove(),
        getCanvas("base3").remove(),
    	newTimer(1000)
            .start()
            .wait(), ///////////////////////////////////
        newCanvas("base4",1000,200)
    	    .settings.add( 370 , 150 , getImage("four") )
    	    .print(),
        newTimer(900)
            .start()
            .wait(),
        getImage("four").remove(),
        getCanvas("base4").remove(),
    	newTimer(1000)
            .start()
            .wait(),///////////////////////////////////
        newCanvas("base5",1000,200)
    	    .settings.add( 240 , 0 , getImage("one") )
    	    .settings.add( 530 , 0 , getImage("two") )
    	    .settings.add( 240 , 230 , getImage("three") )
    	    .settings.add( 530 , 230 , getImage("four") )
    	    .print(),
        newSelector()
    	    .settings.add(getImage ("one"), getImage ("two"), getImage ("three"), getImage("four") )
    	    .settings.log()
    	    .settings.enableClicks()
                 .wait(),

    Thanks so much for your help,

    Farzaneh

    #5286
    Jeremy
    Keymaster

    Hello Farzaneh,

    What exactly do you mean by “multiple clicks on the same stimuli”? What should happen if your participant clicks on the exact same element again?

    As far as I can tell, there is nothing wrong with your script: it will wait for a click on one of the images before moving on from your last wait command, but your participant should still be able to modify their choice (ie. keep clicking on the images) until the end of the trial (that is, unless your script explicitly does something against that). You just need to add "all" in your log command to have all the clicks reported in the results file. Here is a version of your script edited for concision, where I added a “Finish” button to demonstrate that you can modify your choice at will before clicking the button:

    newTrial(
        defaultImage
            .size(200, 180)
            .css("border", "solid 1px black")
        ,
        newTimer("show", 1000),
        newTimer("between", 900)
        ,
        newCanvas("base",1000,410).print()
        ,
        newImage("one", "Blue.png").print( 370 , 180 , getCanvas("base") ),
        getTimer("show").start().wait(),
        getImage("one").remove(),
        getTimer("between").start().wait()
        ,
        newImage("two", "Green.png").print( 370 , 180 , getCanvas("base") ),
        getTimer("show").start().wait(),
        getImage("two").remove(),
        getTimer("between").start().wait()
        ,
        newImage("three", "Yellow.png").print( 370 , 180 , getCanvas("base") ),
        getTimer("show").start().wait(),
        getImage("three").remove(),
        getTimer("between").start().wait()
        ,
        newImage("four", "Red.png").print( 370 , 180 , getCanvas("base") ),
        getTimer("show").start().wait(),
        getImage("four").remove(),
        getTimer("between").start().wait()
        ,
        getCanvas("base")
            .add( 240 , 0 , getImage("one") )
            .add( 560 , 0 , getImage("two") )
            .add( 240 , 230 , getImage("three") )
            .add( 560 , 230 , getImage("four") )
        ,
        newSelector()
            .add( getImage("one") , getImage("two") , getImage("three") , getImage("four") )
            .log("all")
        ,
        newButton("Finish").center().print().wait()
    )

    Jeremy

    #5290
    Farzaneh
    Participant

    Hi Jeremy,

    Basically, participants see four colored squares one after another with some color repeated within each trial (example, blue-blue-red–red-yellow-green). Then they have to recall the colors in the presented order by clicking on the squares. That’s where they’ll need to click multiple times on the same four squares. I think adding “all” to .log(“all”) has fixed the problem. Now, after I click on one of the images, the mouse cursor doesn’t change from hand icon to arrow icon and all clicks are logged in the results file (I hope I’m making sense!).

    Thanks,

    Farzaneh

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