PennController for IBEX › Forums › Support › Can we use template literals in Pcibex? › Reply To: Can we use template literals in Pcibex?
May 10, 2023 at 8:06 am
#10551
Larissa_Cury
Participant
Hi, Jeremy! Thank you very much! I’ll dig in into your answer, thanks! One more thing, I’d like to use a template literal to salute my participant. I thought thatr ‘var’ was a global variable, but I cannot do things such as
newText('salute',
hi, ${ID})
Why is that? How can I ‘use’ the ID var?
I was able to do sth as:
let welcomeMsg = 'maria'
// 👉 Instructions trial
newTrial("instructions",
defaultText
.center()
.print()
newText("instructions-1", <code>hi, ${welcomeMsg}</code>)
)
just a note: I’m adding the template literals between ` , but the forum is formatting into a block code 🙂
- This reply was modified 1 year, 6 months ago by Larissa_Cury. Reason: editing my answer