Error occuring: the argument should be an array of numbers of length 3

URL of experiment: Dual_task [PsychoPy] (Not sure if it will work as its in Pilot mode currently)

Description of the problem:
The error pops up following instructions, so when the stimuli are supposed to appear. I’ve looked through previous posts with this error but cannot seem to find a solution from those. The colours are labelled properly, and all of the arrays have commas in and are the proper length! I’ve tried not using square brackets but the excel file doesnt allow that and turns it into formulas. I’ve skimmed through the JS code and cannot find anything either. Theres a chance its something super small or silly, but I’ve tried to fix it for 2 days and cannot figure it out.

We are using an excel sheet to change the colour and position of two stimuli (see below),
and the code used in the experiment is minimal.
image

Usually I can debug using the browsers console, but it isn’t referring to a specific part of the code like it normally does, so I’m stuck! Do let me know if you require anything.

Thank you in advance!

Hello,

it would be helpful if you posted which array should have a length of 3. Simply copy and paste the error message from Stdout in the runner.

Also show us how you assign the position and colour.

Best wishes Jens

I have no idea which array should have a length of 3! No error tells me where it occurs and looking through the code it doesnt seem like any arrays are out of place.

The error is only occuring online on Pavlovia, not within Psychopy builder, so not getting any errors from the runner (unless there is a way I dont know about?). These are the errors that show from chrome, however the links to JS arent to my JS or parts of the actual code.

For the stimuli, we have used ‘$Position’ to set the position every repeat, and ‘$Rec_Colour’ and ‘$Polygon_Colour’ to set the colours for the stimuli.

Hello tmoore

did you click on “the argument …” This should take you to the line the relevant PsychoJS-line.

See here for debugging online-experiments

Best wishes Jens

Yep - I’m familiar with using it, but in this case it takes me to the end of my code as I dont have a line 727! Only goes upto 722. The other parts also do not link to the actual JS code.

This is what it takes me to, which doesn’t seem to give anything in regards to the JS code?

So I’m not too sure what I can get from this? Sorry to be a pain!

Hello

do you mind sharing your repository or provide a toy-example that gives the same error?

Best wishes Jens

Here is a link to the github repository: Tyler Moore / KB_Dual_task · GitLab

I believe that’s what you mean / need? Let me know if not!

Also, another pilot link incase that helps Dual_task [PsychoPy]

Thank you!!

Hello

pilot link expire within one hour.

Best wishes Jens

Here is a running link, didnt want to just incase credits were used, but remembered it wont be if not completed - sorry!

https://run.pavlovia.org/tmoore5/kb_dual_task

Hi,

did you try to define the colours as suggested in wakecarter’s crib sheet?

When I set the colours to fixed values, the experiment proceeds but ends with another error message. But one problem at a time.

Best wishes Jens

Just tried some of the colour changes from ‘black’ to rgb values according to the sheet but got the same error, what parts did you change? I thought I changed them all but perhaps not? Either that or I may have done it slightly wrong.

Also, what error did you get following that?

Thank you for your help!!

Hello,

I hard-coded everything to black or white in the property-field of the polygon to determine whether this was the cause. When I did that the response-key was unknown but the array-length error was gone.

Best wishes Jens

1 Like

Interesting, I’ll take a look at this tomorrow when I have more time to investigate.

Thank you for your help - may need some more tomorrow!!

Just to close this - I figured out the issue!

The array issue was arising from the Excel conditions sheet we used to set position and colour. Changing the colours from arrays to just the names of the colour sorted that issue!

There was another unrelated issue which was an easy fix.

Thank you Jens for your help!