PennController for IBEX › Forums › Support › Using Group for two different blocks
- This topic has 4 replies, 2 voices, and was last updated 4 years, 5 months ago by
Avery.
-
AuthorPosts
-
April 4, 2020 at 1:21 pm #4990
Avery
ParticipantI feel like there must be a simple solution for this, so apologies if I’m asking the obvious:)
I’m working with a two-block design with 18 orders. The crucial thing is that each order is tied to a unique set of items in each block–so order A has specific items in Block1 and specific items in Block2, Order B has different items in Block 1 and in Block 2, etc.
Currently, I’m just using javascript to generate a random list and assign the subset of items relevant to that list in each block, but I would rather use Ibex’s Group feature if I can.
I’ve tried concatenating the lists for each block into a single .csv, hoping that if Group assignment happens when the experiment initializes it might assign them to the same group in both blocks, but it seems that having each Group in the .csv file twice caused an issue (the resulting file reported the Group as NULL). What might a better way of doing this be?
April 4, 2020 at 4:29 pm #4992Jeremy
KeymasterHi,
I’m not sure I understand your design, but wouldn’t a table like the one below work the way you want?
AddTable("myTable", `ItemNumber,ButtonText,Group,Block 1,Lorem,A,1 2,ipsum,A,1 3,dolor,A,1 4,sit,A,2 5,consectetur,A,2 6,adipiscing,A,2 7,elit,B,1 8,sed,B,1 9,do,B,1 10,eiusmod,B,2 11,tempor,B,2 12,incididunt,B,2`) Sequence( randomize("block-1") , "break" , randomize("block-2") ) newTrial( "break" , newButton("Start second half").print().wait() ) Template( "myTable" , row => newTrial( "block-"+row.Block , newButton(row.ButtonText).print().wait() ) .log( "OrderGroup" , row.Group ) )
This is just illustrating two order groups, my understanding is that you’d want to have 18 of them so using letters as group labels you would add rows until you have an R group. I used different items on every single row (different item numbers and different button text).
Is this the kind of thing you want to do?
Jeremy
April 4, 2020 at 5:41 pm #4996Avery
ParticipantThank you for the reply, and sorry for the poor description, but yes! That’s what I’m trying to do.
What I had tried was basically this
Trial,trialImage,trialAudio,Group,Block,imageLeft,imageRight 1,blanket.jpg,blanket_accent.mp3,A,training,NA,NA 2,fridge.jpg,fridge_accent.mp3,A,training,NA,NA 3,bed.jpg,bed_accent.mp3,A,training,NA,NA 1,blanket.jpg,blanket_accent.mp3,B,training,NA,NA 2,fridge.jpg,fridge_accent.mp3,B,training,NA,NA 3,bed.jpg,bed_accent.mp3,B,training,NA,NA 1,NA,hand_accent.mp3,A,test,hand.jpg,unlabeled1.jpg 2,NA,egg_accent.mp3,A,test,unlabeled2.jpg,egg.jpg 3,NA,milk_accent.mp3,A,test,milk.jpg,unlabeled3.jpg 1,NA,hand_accent.mp3,B,test,hand.jpg,unlabeled1.jpg 2,NA,egg_accent.mp3,B,test,unlabeled2.jpg,egg.jpg 3,NA,milk_accent.mp3,B,test,milk.jpg,unlabeled3.jpg
where Group of course was Group and Block was Block, like yours. I suppose the .CSV is correct, then, so now I’m wondering why it seems to have trouble. It moved through the trials and selected a Group just fine before I added the training trials.
Here’s the rest, basically:
//training Template( PennController.defaultTable.filter("Block","training") , variable => newTrial( newAudio("trainingAudio",variable.trialAudio) .play() , newImage("trainingImage", variable.trialImage) .print() , newKey("J") .log() .wait() ) .log( "ID" , getVar("ID") ) ) //test Template( PennController.defaultTable.filter("Block","test") , variable => newTrial( newAudio("testAudio",variable.trialAudio) .play() , newImage("left", variable.imageLeft), newImage("right", variable.imageRight), newCanvas(1400,680) .add( 0 , 0 , getImage("left") ) .add( 730, 0 , getImage("right") ) .print() , newKey("FJ") .log() .wait() ) .log( "ID" , getVar("ID") ) ) SendResults()
It’s adapted right from the tutorial. I used defaultTable because my CSV is currently the only one in the folder.
April 4, 2020 at 6:04 pm #4998Jeremy
KeymasterI just tested your table (replacing filenames to point to files in my project) and your code, and it seems to be working fine
I added labels to the trials though, ie. I added "training", after newTrial( in the first Template command and "test", after in the second one, and I referenced them in the Sequence command: Sequence( "intro" , "training" , "test" ) (I had to add an intro trial first to set the ID Var element)
What is the unwanted behavior that you observe?
EDIT: oh, did you add .log( "Group" , row.Group ) to the closing parenthesis of each newTrial command? Ibex also adds another Group column to the results file, which has a slightly different meaning, so you want to make sure you’re logging the value directly from your table
-
This reply was modified 4 years, 5 months ago by
Jeremy. Reason: note about Ibex adding a group column to the results file
April 4, 2020 at 6:19 pm #5000Avery
ParticipantAh, that did it! I saw the other Group column and was confused, but now that I’ve added that line, it records as expected.
Thanks again!:)
-
This reply was modified 4 years, 5 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.