# Text - flip property as var

Hi,

I am a bit baffled by this
I have several text components and I need to manipulate the flip property between them and between trials. The potential values for the flip property are taken by an excel sheet.

Locally it works as intended. But when I try to upload it to Pavlovia it complains. Below the error (see last line). It appears as if Pavlovia expects a literal value for the flip property, not a var.

Is this just me (am I doing something wrong) or is it a bug?

Traceback (most recent call last):
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py", line 1344, in onPavloviaSync
self.fileExport(htmlPath=htmlPath)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py", line 793, in fileExport
target="PsychoJS")
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py", line 74, in generateScript
compileScript(infile=exp, version=None, outfile=filename)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py", line 247, in compileScript
_makeTarget(thisExp, outfile, targetOutput)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py", line 219, in _makeTarget
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\_experiment.py", line 268, in writeScript
entry.writeInitCodeJS(script)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\routines\_base.py", line 338, in writeInitCodeJS
thisCompon.writeInitCodeJS(buff)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\components\text\__init__.py", line 171, in writeInitCodeJS
raise ValueError(msg % self.params['name'].val)
ValueError: flip value should be 'horiz' or 'vert' (no quotes) in component 'O_D1_2'


Hi There,

Thanks for flagging this - this is indeed a bug. As a work around you can change the flip of the text online using the approach in this demo:

fliptxt.psyexp (9.5 KB)
conditions.xlsx (17.9 KB)

Online flip is controlled using the parameters flipHoriz and flipVert which can be either true or false - this appears a little different to the local implementation - I will flag to the dev team.

Thanks and hope this helps!
Becca

Thanks @Becca for looking into it.

Indeed, I was able to solve it on the same day by using the flipVert parameter in a code snippet as you describe in your post. But I wanted to keep the post up in case it was a bug and be flagged accordingly.

Thanks again.