Hello All, I’m very new to this. Please let me know how I can clarify this!
URL of experiment:
If you tell me how to add this, I will!
Description of the problem:
I have been coding up my experiment, which I eventually hope to post on Pavlovia, using the builder view. I’ve already encountered and gotten around several errors when uploading my working psychopy code online (such as needing to explicitly define cos() as Math.cos(), which makes the builder/psychopy version not run anymore).
I have not yet figured out a way to include a custom shape
I need to add an arc with a varying length (degrees) on every trial. I understand that visual.ShapeStim is the way to do this, but I’m having trouble actually implementing it. In the “custom code” section of my routine I have tried typing:
Test1 = visual.ShapeStim(win, lineColor = ‘green’, vertices = ProgVertices, pos = (0,0), autoDraw = True));
However, this throw a “/* Syntax Error: Fix Python code */” in the right window, and the compiling just doesn’t seem to happen (as there is no error thrown on Pavlovia, but neither is there a stimulus!)
I’ve attempted to add the new stimluls to the .html file, but then it disappears anytime I update the builder view/recompile/try to push to the web, so I have no idea if that might work…
Could someone please help me.
A). add a stimulus, preferably in the builder coder window and
B). have a section of code that takes the two edges of the arc and makes an array of vertices for the ShapeStim, as I have been having trouble with for-loops in py/js (py uses range, which js doesn’t like, and any js version I’ve tried also has thrown up the “/* Syntax Error: Fix Python code */” and doesn’t compile.