Reply To: Randomize order of audio files

PennController for IBEX Forums Support Randomize order of audio files Reply To: Randomize order of audio files

#4875
Jeremy
Keymaster

Hi!
Unfortunately there’s no pure-PennController way of doing this yet, but here is a simple enough workaround injecting some javascript in a trial script (fisherYates is an Ibex-native function):

AddHost("https://upload.wikimedia.org/wikipedia/commons/") // This is where the files are

newTrial(
    newButton("start").print().wait().remove()
    ,
    randomAudios = ["8/8f/Nl-winputje.ogg","2/2a/Nl-zonderegisters.ogg"],fisherYates(randomAudios)
    ,
    newAudio(randomAudios[0])
        .play()
        .wait()
    ,
    newAudio(randomAudios[1])
        .play()
        .wait()
    ,
    newButton("ok").print().wait()
)