re-taking randomized item order

PennController for IBEX Forums Support re-taking randomized item order

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #7667
    jonesanam
    Participant

    Dear Jeremy,

    I couldn’t find anything in the documentation about this, so here is my question:

    In our experiment, participants have to listen to three audio-recordings in randomized order and rate each of them via scales. This part already works via Sequence(randomize(“Item”)). Every experimental item is called “Item” in the script and the only difference is the audio file inserted and the element names for logging the ratings – So far, so good.

    Now, we want to include a second run, where participants listen to the same audios again, and this time answer questions via textboxes for each recording. Our question is: How do we get the order of the items in this second run to be exactly the same randomized order as in the first run?

    Thanks a lot in advance! Last time your support was so helpful and I was hoping that this time you could help us out again. 🙂
    Jones

    #7668
    Jeremy
    Keymaster

    Dear Jones,

    You will have to write some custom javascript for that. The idea is to store the audio references in an array that you shuffle, and use that array to generate both types of trials. Then you can run the trials themselves in their original order, since the references will have been randomized anyway

    Assuming you are using a CSV file with a column named Audio that references filenames, your code should look like this:

    Sequence("start","Item","ItemQ")
    
    newTrial("start", newButton("Start").print().wait() )
    
    audios = []     // audios will reference the audios in a randomized order for simple playback
    audios2 = []    // audios2 will ultimately be a copy of audios
    // Create dummy trials to browse the table and feed then shuffle audios
    Template( row => newTrial( audios.push(row.Audio),fisherYates(audios) ) )
    
    // Now create the Item trials reading the audio references from audios
    audio = ""
    Template( row =>
        newTrial( "Item",
            audio = audios.shift(), // Extract next entry from audios
            audios2.push(audio)     // Place it in audios2
            ,
            newAudio( audio ).play().wait() // Play back the audio
            ,
            newButton( "Next" ).print().wait()
        )
        .log("audio", audio)    // Log which audio was played
    )
    
    // Now create the ItemQ trials reading the audio references from audios2
    audio = ""
    Template( row =>
        newTrial( "ItemQ",
            audio = audios2.shift() // Extract next entry from audios2
            ,
            newAudio( audio ).play().wait() // Play back the audio
            ,
            newTextInput("answer", "What did it say?").print().log()
            ,
            newButton( "Next" ).print().wait()
        )
        .log("audio", audio)
    )

    Jeremy

    #7871
    jonesanam
    Participant

    Dear Jeremy,

    thanks again for helping out so much, it is appreciated a lot 🙂 As we have developed our experimental design a bit further, I have a follow-up question:

    In the advanced version, we are looking to do the same thing with two different sets of audios, and switch sets every time the link is clicked, so that every other participant . I feel like this could be achieved by combining the above code with a second CSV that assigns lists – However, I haven’t been able to figure out how to bring these two things together on my own. Could you please help out again? 🙂

    (The current version of the experimental trial is pretty much still the same: the code from your last reply, with one CSV containing one column with the audio file names of one of the sets. In case it helps, this is the experiment: https://farm.pcibex.net/experiments/GUiEra/edit)

    Again, thanks a lot in advance and I hope you have a great start into the new week!
    Jones

    #7880
    Jeremy
    Keymaster

    Hi Jones,

    Simply add a column named Group to your table, and list different audios for the different values in that column, eg:

    Audio,Group
    openguise_m_sd_a.wav,A
    openguise_m_namgram_a.wav,A
    openguise_m_namlex_a.wav,A
    openguise_m_sd_b.wav,B
    openguise_m_namgram_b.wav,B
    openguise_m_namlex_b.wav,B

    Note that if you really want to switch sets every time the link is clicked, you will need to insert a SetCounter trial at the beginning of your Sequence so as to increase the counter whenever a new participant starts your experiment (who will possibly not complete it)

    Jeremy

    #8427
    jonesanam
    Participant

    Hi Jeremy,
    thanks again for having helped us out so much – a new issue came up and we were hoping that you might be able to look over it too: We ran a test of the study above and it appears that some things do not get logged to results. This happened twice, both times with the corresponding scale for the audio openguise_m_namlex_a.wav (even though our understanding is that the exact same trial runs three times, only selecting a different audio each time). I am attaching the slightly modified code and a sample of how the results look below.

    Thank you in advance, we appreciate your work!
    Jones

    audios = []     // audios will reference the audios in a randomized order for simple playback
    ,
    audios2 = []    // audios2 will ultimately be a copy of audios
    // Create dummy trials to browse the table and feed then shuffle audios
    ,
    Template("OG-audios.csv", row =>
        PennController( audios.push(row.Audio),
        fisherYates(audios) )
        )
    
    // Now create the Item trials reading the audio references from audios
    ,
    audio = ""
    ,Template( row =>
        PennController( "Item",
            audio = audios.shift(), // Extract next entry from audios
            audios2.push(audio)     // Place it in audios2
            ,
        newAudio( audio )
                .center()
                .once()
            ,
        newImage("message","MessageOpenGuise.png")
                .size(708,522)
            ,
        newCanvas("Message", 708,522 )
            .add(   0, 0, getImage("message"))
            .add( 150, 360, getAudio(audio))
        .print()
             ,
            newText("Bewertung","<p><br>Bitte der Aufnahme eine Gesprächssituation zuordnen. Hat die Sprecherin mit einer <b>Freund*in</b> oder einer <b>Lehrer*in</b> gesprochen? Dazu Punkt auf der Skala auswählen. </p>")
              .settings.css("font-family", "calibri").settings.css("font-size", "18px")
               .center()
                .print()
        ,
        newCanvas(600,120)
            .add(50, 0, getText("Bewertung"))
            .center()
            .print()
          ,
        newScale("Skala1", 9)
            .settings.css("font-family", "calibri").settings.css("font-size", "22px")
            .settings.labelsPosition("bottom").color("white")
            .settings.before(newText("<b>Freund*in</b>"))
            .settings.after(newText("<b>Lehrer*in</b>"))
            .center()
            ,
        newCanvas(600,50)
            .add(150, 0, getScale("Skala1").settings.log("final"))
            .center()
            .print()
        ,
            newButton( "Weiter" )
                .center()
                .print()
                .wait(getScale("Skala1").test.selected()
                  .failure( newText('errorage', "<br>Bitte Punkt auf der Skala wählen.").color("red") .center().print() )
                )
        )
        .log("audio", audio)    // Log which audio was played
        )
    1663664587,REDACTED,PennController,9,0,Item,NULL,PennController,12,_Trial_,Start,1663664360727,openguise_m_sd.wav,NULL
    1663664587,REDACTED,PennController,9,0,Item,NULL,Scale,Skala1,Choice,6,1663664370706,openguise_m_sd.wav,NULL
    1663664587,REDACTED,PennController,9,0,Item,NULL,PennController,12,_Trial_,End,1663664374041,openguise_m_sd.wav,NULL
    1663664587,REDACTED,PennController,10,0,Item,NULL,PennController,13,_Trial_,Start,1663664374043,openguise_m_namlex.wav,NULL
    1663664587,REDACTED,PennController,10,0,Item,NULL,PennController,13,_Trial_,End,1663664380715,openguise_m_namlex.wav,NULL
    1663664587,REDACTED,PennController,11,0,Item,NULL,PennController,14,_Trial_,Start,1663664380717,openguise_m_namgram.wav,NULL
    1663664587,REDACTED,PennController,11,0,Item,NULL,Scale,Skala1,Choice,1,1663664387670,openguise_m_namgram.wav,NULL
    1663664587,REDACTED,PennController,11,0,Item,NULL,PennController,14,_Trial_,End,1663664391514,openguise_m_namgram.wav,NULL
    #8428
    Jeremy
    Keymaster

    Hi Jones,

    Do you get a warning when you download your results file saying that some rows might be missing?

    I don’t see any issues with your code and am unable to reproduce the problem

    Jeremy

    #8541
    jonesanam
    Participant

    Hi Jeremy,

    thanks for your reply! There is no warning message during download or when running the experiment. We’re currently trying to find the problem with our associate IT experts, if we find out anything I’ll let you know.
    Have you maybe heard of a similar issue before?

    Jones

    #8544
    jonesanam
    Participant

    …an idea came up: We are using a local installment of IbexFarm from our home university (Humboldt-Universität zu Berlin), do you think the root of the issue could lie there?

    Jones & Team

    #8546
    Jeremy
    Keymaster

    Hi,

    I can’t imagine how a local installment of the Ibex Farm could produce the results file that you report: there’s one line missing in the middle, but all the lines are sent at once to the server, and they should all be written to the results file as a block

    Jeremy

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