Informed Consent and Slider color

This is my situation so far (hopefully you can help me…):

  1. The scroll text for the informed consent doesn’t appear in pavlovia, even if I use your js script in the code component…

  1. the obj error persists, and it occurs with this specific routine:

  1. I had my instructions alligned to the left, but when I run the exp in Pavlovia they become centre alligned with a different Font (I used Arial and it turns to Times)

Also, an issue which I am not able to fix is: after applying some changes to the experiment, I don’t see any updated version in my pavlovia account. Am I doing it wrong?

Do you have any suggestions for any of these problems?

Thank you so much,

Daniela

Your first issue suggests that you have pasted code from my JS file into your Builder code components instead of opening my Builder file.

I would therefore be very surprised if anything is working since you will end up with duplicated code and code in the wrong place.

Sorry, I can’t follow you.

What do you mean with opening your Builder file? I went to your Github page and found only the scripts. I am quite worried I can’t fix anything by myself :frowning:

In your crib sheet I found the code for the text alignment, but the result is not as expected because everything is moved too much to the right and words are cut:

Daniela

The Builder file is .psyexp and can be opened in PsychoPy Builder.

Your text is too far to the right because the x position needs to be negative by half the wrap width instead of central when left aligning.

Oh ok! I managed to open your Builder now, thanks!

I am copying the components in my experiment for the scroll text but I get this error:

line 87, in
if float(expInfo[‘fontSize’])>0:
KeyError: ‘fontSize’

expInfo means the dialogue box that starts the experiment which you can customise in Experiment Settings.

You could just set fontSize = .05 (or whatever) in code.

Thanks, I fixed it!!!
Sorry for bothering, now, the error is:
line 329, in
lines = scrollText.text.split(’\n’)
NameError: name ‘scrollText’ is not defined

Is your text component called scrollText?

It wasn’t, thanks, I understood and changed all my components’ names.

I am almost there, 2 issues now:

  • Too many blank lines to reach “Press space to continue”. How can I make the scroll shorter?
  • The command “Press space to continue” doesn’t work.

Are you setting the font size in your text component with the fontSize variable or have you used a fixed number?

Can you find the code I use to end the routine? I can’t remember if I have a keyboard end but you could simply add a keyboard component.

I use the fontSize variable for the text component. Although if I put $fontSize it returns an error, so I left fontSize. But still if I put a fixed number like 0.03 there is a lot of white space as well.

OK, keyboard component added for continuing with the next routine. Thanks!

Also, because when I run it in Pavlovia the error “win is not defined”, I added the start routine like in your demo, but this error appears:

Alert 4205:Python Syntax Error in ‘Begin Experiment’ tab. See '//code_JS from crib sheet
’ on line number 1 of the ‘Begin Experiment’ tab.
For further info see 4205: Probable syntax error detected in your Python code — PsychoPy v2021.1

I don’t know why because it is exactly as you put in the crib sheet…

Did you put the JS code (designed for a JS only code component) on the Python side of an Auto code component?

I fixed it! Thank you for the suggestion.

After that, other error messages appeared: ‘psychoJS’ not defined, ‘win’ not defined and so on. I think I managed to solve them following your crib sheet for latest versions, but there is something weird that happens. When I add this code in the start routine:

It says "Unexpected token in line 2 ‘Begin Experiment’ ". If I remove the code, it runs locally but returns an error online. In contrast, if I keep it, it runs online but not locally. Is there something wrong in my setup?

The last thing I need to ask you is how to adjust the text alignment in the scrollText component. In my laptop it works fine, but when I run it in Pavlovia, the text is center aligned, completely moved to the left with the initial part of the sentences cut, and the right scroll bar disappeared:

Can you see?
What can I do?

Thanks!

Dani