X,Y coordinates specified in a Conditions file is causing "Object { origin: "util.toNumerical", context: "when converting an object to its numerical form", error: "unable to convert undefined to a number"" error

I went to put my experiment online yesterday and began seeing a error after my welcome message page:

Unfortunately we encountered the following error:

  • when converting an object to its numerical form*
  • unable to convert undefined to a number*

Try to run the experiment again. If the error persists, contact the experiment designer.

When I looked into the HTML, I found these messages:

*DEBUG unknown | import attributes from: {“instruText”:"(text for directions)",“text_xpos”:0,“text_ypos”:0}

Object { origin: “util.toNumerical”, context: “when converting an object to its numerical form”, error: “unable to convert undefined to a number” }*

FATAL unknown | {“origin”:“util.toNumerical”,“context”:“when converting an object to its numerical form”,“error”:“unable to convert undefined to a number”}

Since this appears to be triggered by my text coordinates, I did some digging. It seems like my conditions file where the text coordinates are listed is being ignored or is causing this util.toNumeric issue. Currently, the x position and y position are each stored in their own column and each row is one page/loop repeat.
Currently, my experiment is frozen on this “unfortunately we encountered the following error” page and will not continue.

Other background, this experiment is built in builder and uses condition files for the directions and trials.These files all contain text, x/y coordinates, and correct key responses that are used as variables within each builder routine. It works totally fine locally, but started having these issues when it moved online.

Any help fixing this would be amazing! Thank you.

Solved!
I solved this error by creating a routine for each page of the directions instead of having all the directions run through a conditions file. It seemed like the empty cells (ie, the pages where a stimuli didn’t have to be displayed) were not liked by JS.

Hi fnwalsh,

How exactly did you do this? I am running into this exact same problem right now, where I have white squares appear on a grid for an n-back task, and I define the coordinates with the combined Xs and Ys for where the squares appear in an excel spreadsheet. Your solution to this may actually be really helpful to me, but I have no idea how you implemented it.

Hi mcphedrm,

My solution to this problem might not fix your trial to trail issue. I basically hard coded the directions so that each page was it’s own routine. Then that way, all the coordinates were specified to that specific direction page.

For your issue, I wonder if you could draw dummy squares for the non-needed squares and then make the polygon color the same as the background color so that they do not appear. That way, you have coordinates in every cell, but you do not show the squares. You would need n number of squares columns where you specify the color.

i.e.,
trial square 1 square 2 square 3 square 4
1 black white white black
2 white black white black
3 white white black black