I have an experiment where you have to find a hidden target coin (red). To do this there is a cue that appears then you have to use a rectangular net to respond (drag to where you think the hidden coin is).
I have a code component (net_code) defining the drag and drop capability of the net (builder component is called net_shape) and I think that could be where the problem is based on this error message from the developer tools:
What is curious here is that it doesnât look like you are using the .toNumerical method anywhere in your script. Can I please check, is this a relatively new error and, if so, at what point in your commit history would you say the error appeared? (just to try and pin down where this could be coming from)
It was today- where it says âRemoved conditions fileâ
Weirdly when I was working on it on Friday the error was:
TypeError: undefined is not an object (evaluating âthis._guiâ)
I donât think I had changed anything since then other than adding a conditions file (as this was part of a solution to this error according to another thread) and change the size of the net.
Hi
I am also getting this error. My experiment was working fine on the pilot last week, and when I went to pilot today to show it to someone, it is now giving this error but I havent made any changes inbetween!
Is there a way to find out which object is undefined, or which line of code it is which is causing this problem?
I havenât been able to solve the error but to see where the error is coming from you want to access the developer tools/console whilst the experiment window is still open.
To access these on mac its option + cmd + j and for Windows it is Ctrl + shift + i
I think I have fixed this for my experiment!
Online it didnt like that the position of one of my stimuli was a variable defined in an excel sheet. (Position: $(LR,UD) ) because it meant that at the begining of the experiment there was no position defined for the image.
To get around this I added a piece of code into the problem routine where under Begin Experiment I defined my position variables (LR = 0 & UD = 0) so that the position is never undefined, but once the routine loads it uses the LR and UD variables from the excel sheet.
That solved that error for me but am just trying to figure out how to get this to work with out the conditions file ( I am looking to update my stimulus position frame by frame so using a conditions file over rides my code to do this I think). Thanks again for your response though as it helped my understanding of what was going wrong
Hi,
Hmm yes I think your right a conditions file wont work for what you need.
Maybe within your code for updating the position every frame you could define a starting position in Begin Experiment so that the position is never undefined?
Hi, I have come back to this again using a conditions file. Is the syntax for defining the starting position in Java Script (Begin Experiment):
my_stim_pos = 0;
my_other_stim_pos = 0:
I can get rid of the error now (thank you so much!) but I cannot get the conditions file to kick into action so the position throughout the experiment is 0,0.
I am facing a similar issue. How exactly did you manage to get the conditions file to kick into action?
As soon as I implement a custom code to define the position at the beginning of the experiment, it wonât recognise the positions defined in the conditions file anymore.
I think I got rid of trials = None and that helped.
I think there were other things I tried but I canâ remember them off the top of my head. If you show some screenshots of your code I might be able to help. Iâm quite new to this myself but I hope my struggles can lead to something useful.
As far as I understand, if this an experiment created in builder with a code component what you want to do is put your first_x = 0 in the âBegin experimentâ tab and then put the rest of your code in âBegin routineâ.
This means that at the start of the experiment you will be telling the computer that the value is in fact defined (defined as 0 initially) to remove error. Then as the experiment begins, the builderâs conditions files should take over as they are the default.
Additionally, I remember that to get my experiment to fully commit the changes to the online experiment I had to clear my browser cache on my google chrome.
thanks for your reply. I tried all that with the builder but unfortunately, it doesnât work.
The error âunable to convert undefined to a numberâ is gone as soon as I put an initial value in the âBegin experimentâ tab but the builderâs conditions file wonât take over. It just stays at the initial value.