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

#6211
Jeremy
Keymaster

Sorry, I realize now that I wasn’t very clear when I typed // code your '...' trials here. If you look back at this previous message, you’ll notice that the content of those const variables, ie. what goes inside the [ ] brackets, does not contain Template or newTrial, but only what normally goes inside the parentheses of newTrial.

So in this specific case, you should have:

const alt_training_trial = variable => [
  newTimer(500)
      .start()
      .wait()
  ,
  newImage("sg_picture", variable.SgPictureFile)
      .size(200,200)
      .print()
  ,
  newTimer(200)
      .start()
      .wait()
  ,
  newAudio("sg_voicing", variable.SgVoicingFile)
      .play()
  ,
  newTimer(1500)
      .start()
      .wait()
  ,
  getImage("sg_picture")
      .remove()
  ,
  newTimer(1000)
      .start()
      .wait()
  ,
  newImage("pl_picture", variable.PlPictureFile)
      .size(300,200)
      .print()
  ,
  newTimer(200)
      .start()
      .wait()
  ,
  newAudio("pl_voicing", variable.PlVoicingFile)
      .play()
  ,
  newTimer(2000)
      .start()
      .wait()
  ,
  getImage("pl_picture")
      .remove()
  ,
  newTimer(200)
      .start()
      .wait()
  ,
  newButton("Neste")
      .print()
      .wait()
]

With this corresponding Template command further down in your script (I’m assuming you’ve also defined const alt_test_trial following the same schema as above):

Template( defaultTable.filter(r => r.Type=="alt" ) , 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
)

Let me know if you have questions

Jeremy