Reply To: DashedSentence in a PennController trial

PennController for IBEX Forums FAQ / Tips DashedSentence in a PennController trial Reply To: DashedSentence in a PennController trial

#5466
snederve
Participant

Hi Jeremy,

Thanks for posting this! I’m working with the native Ibex calling in a CSV from elsewhere. Getting the sentences works great, but I have one problem:
I would like to include comprehension questions that relate to the sentence the participants just saw. In your message, the comprehension questions are independent, so they are randomized as separate elements. I can’t seem to figure out how I can stay within the same environment and have the comprehension questions show up.

So I copied your code, and I only randomize the item “Sentence” (a column label in my csv). So I understand why the questions don’t show up. However, if I add “comprehension” to the shuffle sequence, they just show up randomly and are not associated with the previous sentence. Do you know how I can make the comprehension questions correspond to the previous sentence? Should I call in a specific column from a row?

PennController.ResetPrefix(null)
// Sequence of randomly picked pairs of test + control trials
PennController.Sequence( "practice" , rshuffle("Sentence") )
// This is the standard way of defining items in Ibex
var items = [
    ["practice", "DashedSentence", {s: "This is a practice item so that you know what the task looks like"}]
]

 PennController.Template( "CSV_Template.csv", 
  row => ["Sentence", "DashedSentence", {s: row.Sentence}] 
 )
 
 PennController.Template( "CSV_Template.csv",  // So I'm sure I shouldn't put this here, but I can't make it work as part of the PennController.Template() above. CSV column labels correspond with code.
    row => PennController( "comprehension" ,
    newText("CompQ", row.CompQ)
       .print()
    ,
    newText("Negative feedback", "Not correct!")
   ,
   // This is a dirty javascript trick to randomize the answers
   newScale("result", ...[row.Results1, row.Results2].sort(()=>0.5-Math.random()) )
       .labelsPosition("right")
        .print()
        // We wait until the participant selects the right answer
       .wait(
         getScale("result").test.selected(row.Results1)
                .failure( getText("Negative feedback").print() )
        )
  )
)

Again, thanks a lot for building this. I’m happy to do SPRs in PC Ibex and have all my experiments done on the same platform.

Thanks.
Sander