It would be great to know if it’s possible
Thanks in advance
I use nested loops quite often.
Are you trying to use .thisN?
Thanks for your response! I apologise - the problem turned out to be something completely different which I’ve now fixed. (If this helps anyone, it was that I was using variables named ‘image’ and ‘sound’ which seems to work in the Python but not JS version).
I actually now have another problem with converting from Psychopy to JS. I’m trying to put in a stimulus which appears for a variable duration. To do this, I’m defining a variable at the beginning for the duration called ‘intertrialint’, and will ultimately want to set this to a changing value each repeat of the routine.
However, while I can pass the ‘intertrialint’ variable into the ‘duration’ part of the stimulus in Psychopy (Python), when I try to run this online (with JS) it says ’ ReferenceError: asarray is not defined’.
Having looked at the JS version of the script, this seems to be because in the Python version it has a line saying ‘from numpy import … asarray’
whereas in the JS version it just skips to asarray being used, in the line:
frameRemains = 1.0 + asarray(intertrialint) - psychoJS.window.monitorFramePeriod * 0.75; // most of one frame period left
My experiment is: SequenceTask1 [PsychoPy]
Thanks so much
I’ll add image to my crib sheet list
Variable names to avoid are: core, index, Object, Length, Number, round, sound, Symbol, t, thisTrial, trials, util, visual.
About the asarray problem. In another thread I’ve got a little pointer that might help? Error message: asarray not defined - #3 by thomas_pronk