Text stim formatting

URL of experiment: https://run.pavlovia.org/MJB/pc

Description of the problem:

I am sure this is a common problem but I haven’t found just the right answer:
In my experiment I use formatted text sims that include variables.

for example, one of the text boxes (set top update on every repeat) reads:

$u"You will now have to reproduce the intervals you have experienced between %s  and the appearance of the triangle.  \n\nSince you have experienced 5 of these  intervals, you will have to reproduce 5 intervals in a row\n\n\nPress SPACE to proceed" %CNC

This works fine locally, but on Pavlovia this means that it simply displays NaN on the screen.

What do I need to do to make this work on JS?
Thanks!

Hello Marc,

this is python formatting style but online you speak JavaScript. Take a look in Wake Carter’s crib-sheet

This example might already help you:

$'The experiment is finished. Please note your participant-code: ' + partcode + ' and send an e-mail witht the subject ... to ????@???.?? for course credit \n\n Continue with j'

partcode is a variable created ealiert in the script.

Best jens

Hello Jens,

Spot on and thanks a million. That was exactly what I needed!
Marc

@Marc_Buehner

Do you mind marking it as solution? It facilitates finding it.

Best Jens

Of course – sorry I had just replied within my email client…