PennController for IBEX › Forums › Support › re-taking randomized item order
- This topic has 8 replies, 2 voices, and was last updated 2 years ago by Jeremy.
-
AuthorPosts
-
January 12, 2022 at 10:46 am #7667jonesanamParticipant
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. 🙂
JonesJanuary 12, 2022 at 12:26 pm #7668JeremyKeymasterDear 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
March 13, 2022 at 2:21 pm #7871jonesanamParticipantDear 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!
JonesMarch 14, 2022 at 2:08 pm #7880JeremyKeymasterHi 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 yourSequence
so as to increase the counter whenever a new participant starts your experiment (who will possibly not complete it)Jeremy
September 20, 2022 at 5:31 am #8427jonesanamParticipantHi 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!
Jonesaudios = [] // 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
September 20, 2022 at 12:51 pm #8428JeremyKeymasterHi 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
September 24, 2022 at 6:04 am #8541jonesanamParticipantHi 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
September 26, 2022 at 7:11 am #8544jonesanamParticipant…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
September 26, 2022 at 11:29 am #8546JeremyKeymasterHi,
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
-
AuthorPosts
- You must be logged in to reply to this topic.