Reply To: Choosing subet of items to present

PennController for IBEX Forums Support Choosing subet of items to present Reply To: Choosing subet of items to present

#6203
Jeremy
Keymaster

Hi Maria,

Based on your previous messages, I think you would do something like this for your specific design:

alt = randomize("alt")
non = randomize("non")
fil = randomize("fil")

picked_alt = pick(alt, 29)
picked_non = pick(non, 17)
picked_fil = pick(fil, 18)

repeat_alt = pick(randomize(picked_alt), 15)
repeat_non = pick(randomize(picked_non), 5)
repeat_fil = pick(randomize(picked_fil), 10)

Sequence( 
  "intro",
  rshuffle(picked_alt, picked_non, picked_fil),
  "transition",
  rshuffle(
    repeat_alt, repeat_non, repeat_fil, 
    pick(alt,15), pick(non,5), pick(fil,5) // Don't know how many fillers are left
  )
)


newTrial("intro", newVar("phase", "training").global() )
newTrial("transition", getVar("phase").set("test") )


const alt_training_trial = row => [
  // code your 'alt' training trials here
]
const non_training_trial = row => [
  // code your 'non' training trials here
]
const fil_training_trial = row => [
  // code your 'fil' training trials here
]


const alt_test_trial = row => [
  // code your 'alt' test trials here
]
const non_test_trial = row => [
  // code your 'non' test trials here
]
const fil_test_trial = row => [
  // code your 'fil' test trials here
]


Template( "alt_table , row =>
  newTrial( "alt" ,
    getVar("phase").test.is("training")
        .success( ...alt_test_trial(row) )
        .failure( ...alt_training_trial(row) ) 
  )
  .log("phase", getVar("phase") )
  // You might want to add more logs
)
Template( "non_table , row =>
  newTrial( "non" ,
    getVar("phase").test.is("training")
        .success( ...non_test_trial(row) )
        .failure( ...non_training_trial(row) ) 
  )
  .log("phase", getVar("phase") )
  // You might want to add more logs
)
Template( "fil_table , row =>
  newTrial( "fil" ,
    getVar("phase").test.is("training")
        .success( ...fil_test_trial(row) )
        .failure( ...fil_training_trial(row) ) 
  )
  .log("phase", getVar("phase") )
  // You might want to add more logs
)

I didn’t test this code, but hopefully it should give you the idea

Let me know if you have any questions

Jeremy