ReferenceError: screen_text is not defined

What error are you getting when you try to sync?

im not getting an error, it says successful sync but on pavlovia it doesnt reflect this

Try pressing the green sync icon instead of the details button. It should go green on a successful sync.

thanks! its uploaded now…but im not sure what this means?

According to my crib sheet

'delimeter'.join(array) needs to be manually translated into array.join("delimeter");


is this here?

In Builder by switching the Auto code component to Both.

i cant seem to find anywhere that says ‘delimeter’? as what i understood from the crib sheet is that it needs to be edited

screen_text = ''.join(key_resp_4.keys

needs to be changed to

screen_text = key_resp_4.keys.join("");

just to confirm: i change it to ‘both’ then change the code on the right hand side such as:

You seem to have edited the left hand side.

oh sorry! i meant left…and i leave the right side as is?

The JavaScript is on the right hand side.
You should edit the right hand side.

yes ive changed it! thank you. i changed it for the other codes too and have syncd it onto pavlovia.
However, what is this?


i believe this is the offending code:

but i am not sure if it is referring to line 3 or 7?

Probably both.

You could try replacing both with key_resp_4.keys.pop().

I’ve never used .remove myself.

thanks! I changed it on the left side on both lines, however, as its set to ‘both’ for the code type, im unsure how this would be on the js side. Would it be the same as what you suggested? (lines 21 and 27)

It’s set to Both because of the join, isn’t it?

What I do is copy the JS I need to edit to a comment (starts with a #) on the Python side, set the component to auto, make the edits, then reset it to Both and copy the JS edit back to the right hand side.

yes! it was set to both because of the join. thanks for the tip, i have changed the js code accordingly also for all the routines that needed the change.


i dont know what this refers to however? i checked the crib sheet and the errors listed there, but could not find anything that may be linked to the error i am getting

You seem to have a lot of Py only code components and don’t seem to have a code_JS component set up as per my crib sheet. PsychoPy Python to Javascript crib sheet 2021 - Google Docs

after looking through the crib sheet, i dont quite understand what to do? so i am guessing it is what is outlined on page 2 of the crib sheet, but i do not fully get it.
So in my first routine, i add a new code component that is only psycho js?