I am trying to run my task online but I get this error in the developers tools, I have looked at the line in which this refers to, but I’m not sure what is wrong with it?
line 446: {‘name’: ‘scenes\1343022512_e0e46f57ae.jpg’, ‘path’: ‘scenes/1343022512_e0e46f57ae.jpg’},
It’s an issue with the Windows file path in the ‘name’ field. Windows uses \ to mark folders in file paths, while linux-based servers like pavlovia use /. Note that the actual ‘path’ field uses / here.
The problem is that \ is also how you create an “escape sequence” in a string, meaning that anything immediately following the \ is not interpreted as the character that is typed but as something else. For example, you can write \n in a string and it will be read as “start a new line”, or \t to add a tab, or \' to write a quote mark inside a string that is already in quotes (I had to put it in the code tag here or it gets interpreted as an escape sequence for a particular character, e.g. ').
Anyway, an “octal escape sequence” is \ followed by numbers indicating a location in memory. So, the ‘name’ field of your stimuli is being interpreted as “scenes[octal escape sequence]”, and JS doesn’t like those, which is giving you this syntax error. To fix this you need to change the name of the stimuli to not use the backslash, or not start with a number after the backslash. If you do want to include a backslash in the stimulus name, you can use \\, which is the escape sequence for the backslash symbol itself (again if I just type it outside a code tag it looks like this: \).