I have inserted a line of code in one of my text components to show participants their progress, i.e. how many more sentences to go. Works great in Builder, but not online, as the experiment gets stuck at ‘initializing’. I understand that JS has trouble with python f string format, so I’ve also tried .format and %, but neither seems to work online.
This is the code:
$f'Off to sentence {trials_2.thisN+2} of {trials_2.nTotal}'+"\n"+"\n"+'(press any key to continue)'
Thanks @jon for your quick response. The experiment now gets passed the initializing stage, but as soon as the component is up, I receive the error message:
Thank you @jonathan.kominsky,
Doesn’t work in Builder now (cause now String is not defined), but it works online. Guess you gotta choose between the devil and the deep blue sea.
Interestingly, trials_2.thisN remained a fixed number, i.e. it wasn’t updated every repeat (although I’ve selected that option), but just gave me the overall count. I put in a myCount variable that I specified in the Code component instead. Works great.