Reply To: Resources not loading with attention checks

PennController for IBEX Forums Support Resources not loading with attention checks Reply To: Resources not loading with attention checks

#9955
Jeremy
Keymaster

Hi,

Use the javascript ternary conditional operator instead of a PennController Var element so that you don’t create an Audio element for rows that miss a valid value in the attentionCheckWord cell:

...(row.attentionCheckWord ? [
    newAudio("attentionCheckWord", row.attentionCheckWord)
        .play()
        .log()
    ,
    newText("Did you hear this word on the previous screen?")
        .print("center")
    ,
    newText("Yes (F)")
        .print("center at 35vw", "middle at 60vh")
    ,
    newText("No (J)")
        .print("center at 65vw", "middle at 60vh")
    ,
    newKey("AttChAnswerW", "FJ")
        .log()
        .wait()
] : [])

Jeremy