Issue converting piped text to JS for PSychopy

I am trying to pipe text into a prompt on my study (i.e. reference variables from elsewhere in a string of text participants read). I used the following syntax previously to pipe in variables (1 is the name of a task subjects were assigned to, the other is a multiple choice response they made). Both work when I only use ONE at a time, ONCE. However, when I try to use BOTH in the same statement, Psychopy at first accepts it (i.e. lets me edit a routine), but later throws a traceback error when I try to export to Pavlovia. Is Psychopy | Pavlovia | JS incapable of handling more than one piped text in the same statement? (It works when I just reference mc_choice_3 or thisTaskLab one time, but if I reference one of these >1 in the same statement, or I try to include both of them, it throws that traceback error.)

$'For certain individuals, these tasks are shown to reveal things about their personalities when they pick'+ thisTaskLab + ' more because '+ mc_choice_3.labels[mc_choice.rating-1] + '. Below are certain personality features in our model that are tied to acting out of ' + mc_choice_3.labels[mc_choice.rating-1] + ' on '+ thisTaskLab + '. We’re interested in your intuition—which do you think was you?’

Example of what it should read like:

For certain individuals, these tasks are shown to reveal things about their personalities when they pick task A more because it was fun. Below are certain personality features in our model that are tied to acting out of it was fun on task A. We’re interested in your intuition—which do you think was you?

Traceback error:

Traceback (most recent call last):
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py”, line 1344, in onPavloviaSync
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py”, line 793, in fileExport
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 74, in generateScript
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 247, in compileScript
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 219, in _makeTarget
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 268, in writeScript
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/routines/_base.py”, line 338, in writeInitCodeJS
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/components/text/__init__.py”, line 161, in writeInitCodeJS
TypeError: __str__ returned non-string (type NoneType)

Check your quotes. As pasted, the last one is ‘smart’ and needs to be 'dumb'.

Thanks so much @wakecarter for replying. Sorry, I’m not that adept with this kind of code, and was just using something I got from someone else. Could you please elaborate what was wrong with the quotes?

The apostrophe before We’re is simple (straight up and down) and denotes the start of a portion of text

The apostrophe in We’re is at an angle (luckily, since otherwise it would end the text)

The apostrophe after you? (at the very end) is at an angle and is therefore failing to do its job of ending the text.

1 Like

Man alive! My sincere thanks, that one has been troubling me for several days.