Reply To: Sub-experiments with different number of conditions

PennController for IBEX Forums Support Sub-experiments with different number of conditions Reply To: Sub-experiments with different number of conditions

#5237
Jeremy
Keymaster

Hi Angelica,

That’s a smart solution! Though I reckon it would be best if there was a straightforward way of crossing the groups from the different tables. Your solution is probably optimal at the moment.

You can pass the group letter directly in the URL (eg. https://expt.pcibex.net/ibexexps/example/example/experiment.html?group=A) and retrieve it with GetURLParameter, like this:

Template(
    GetTable("test_sc")
        .filter( "group" , new RegExp(GetURLParameter("group")) )
    , 
    customTrial("test_sc_items")
)
    
Template(
    GetTable("test_rep")
        .filter( "group" , new RegExp(GetURLParameter("group")) )
    , 
    customTrial("test_rep_items")
)

EDIT: do you ever want a participant to see SC-A + Rep-2? If not, I’m not sure you even need any of this: PennController cycles through the groups independently from one table to the other, so SC-A (=0) and SC-C (=2) should always be paired with Rep-1 (=0), and SC-B (=1) and SC-D (=3) with Rep-2 (=1), because 2 mod 2 = 0 and 3 mod 2 = 1.

Example:

AddTable("firstTable", `group,item,Text
A,1,Item 1 Group A
B,1,Group B Item 1
C,1,item 1 group C
D,1,group D item 1
B,1,Item 2 Group B
C,1,Group C Item 2
D,1,item 2 group D
A,1,group A item 2`)

AddTable("secondTable", `group,item,Text
a,1,Item-Group: 1-a
b,1,Group-Item: b-1
b,2,Item-Group: 2-b
a,2,Group-Item: 2-a`)

SetCounter()

Template( "firstTable",  row => newTrial( newText("first table").print(),newButton(row.Text).print().wait() ) )
Template( "secondTable",  row => newTrial( newText("second table").print(),newButton(row.Text).print().wait() ) )

Jeremy

  • This reply was modified 3 years, 11 months ago by Jeremy.