Reply To: Choosing subet of items to present

PennController for IBEX Forums Support Choosing subet of items to present Reply To: Choosing subet of items to present

#6232
Maria Evjen
Participant

Hi!

Thank you, I have e-mailed you a link to my experiment! And yes, I am realising that my experiment is quite difficult to code, I really couldn’t have done it without all your help!

The precedeEachWith solution works great, but I’m having difficulties with the Selector in the test trials. I implemented your code above like this:

const alt_test_trial = variable => [
    getVar("target").test.is("sg")
        .success( 
            newTimer(500)
                .start()
                .wait()
            ,
            newImage("pl_picture", variable.PlPictureFile)
                .print()
            ,
            newTimer(200)
                .start()
                .wait()
            ,
            newAudio("pl_voicing", variable.PlVoicingFile)
                .play()
            ,
            newTimer(2000)
                .start()
                .wait()
            ,
            getImage("pl_picture")
                .remove()
            ,
            newImage("sg_picture", variable.SgPictureFile)
                .print()
            ,
            newTimer(200)
                .start()
                .wait()
            ,
            newAudio("sg_voicing", variable.SgVoicingFile)
            ,
            newAudio("sg_devoicing", variable.SgDevoicingFile)
            ,
            newSelector("target")
                .log()
                .add( getAudio("sg_voicing"),getAudio("sg_devoicing") )
                .shuffle()
                .test.index( getAudio("sg_voicing"), 0 )
                .success(
                    getAudio("sg_voicing").play().wait(),
                    getAudio("sg_devoicing").play().wait(),
                    getSelector("target").keys("1","2").wait()
                )
                .failure( 
                    getAudio("sg_devoicing").play().wait(),
                    getAudio("sg_voicing").play().wait(),
                    getSelector("target").keys("2","1").wait()
                )
            ,
            newTimer(500)
                .start()
                .wait()
        )
        .failure( 
            newTimer(500)
                .start()
                .wait()
            ,
            newImage("sg_picture", variable.SgPictureFile)
                .print()
            ,
            newTimer(200)
                .start()
                .wait()
            ,
            newAudio("sg_voicing", variable.SgVoicingFile)
                .play()
            ,
            newTimer(2000)
                .start()
                .wait()
            ,
            getImage("sg_picture")
                .remove()
            ,
            newImage("pl_picture", variable.PlPictureFile)
                .print()
            ,
            newTimer(200)
                .start()
                .wait()
            ,
            newAudio("pl_voicing", variable.PlVoicingFile)
            ,
            newAudio("pl_devoicing", variable.PlDevoicingFile)
            ,
            newSelector("target")
                .log()
                .add( getAudio("pl_voicing"),getAudio("pl_devoicing") )
                .shuffle()
                .test.index( getAudio("pl_voicing"), 0 )
                .success(
                    getAudio("pl_voicing").play().wait(),
                    getAudio("pl_devoicing").play().wait(),
                    getSelector("target").keys("1","2").wait()

                )
                .failure( 
                    getAudio("pl_devoicing").play().wait(),
                    getAudio("pl_voicing").play().wait(),
                    getSelector("target").keys("2","1").wait()

                )
        )
]

In addition to the .remove() problem, it appears that the script can’t play the sg_voicing files and the pl_voicing files when these are targets. When I run the experiment, the trigger audio file is played, but both when the target is singular and when it is plural, the voicing files are not played. The sg_devoicing and pl_devoicing files, on the other hand, are played. There are some exceptions though, so that sometimes, it appears randomly, both the voicing and the devoicing file are played, or neither are played, but this seems to be rare. At times more than one item is shown (both images and audio) in one trial as well. When there is a file that can’t be played, the selection with the keys does not work either, I assume this is because the trial is stuck and is not getting to the key assignment part. Do you know why this could be?

Thanks again!

Maria