Reply To: Pairing two lists together

PennController for IBEX Forums Support Pairing two lists together Reply To: Pairing two lists together

#7514
Jeremy
Keymaster

Hello,

This is actually a question that regularly comes back. If you have the same number of words and sentence frames, and you can pair them in any possible ways, you could do something like this. List the sentence frames and the words in the same table:

Sentence,Word
Hello _!,world
Bye _...,Earth

Then you can do something like this:

words = []

Template( row => newTrial("dummy", words.push(row.Word)) )

Template( row =>
  newTrial( "mytrial",
    fisherYates(words),
    word = words.pop()
    ,
    newButton( row.Sentence.replace('_',word) ).print().wait()
  )
)

Jeremy