Error with online experiment-stuck on initilising

Which code do you mean?

Your error implies that you have a variable that you are using to open Groupx.xlsx but something has gone wrong with your definition of x so it is coming out as undefined.

This one. I defined my loop as ‘Group’+conditions2+‘.xlsx’. For conditions2, I am trying to randomly select between A, B, or C as my excel files are named as GroupA, GroupB or GroupC. I know how to do it in Python but I am confused about the javascript. Can you help me? Thank you!

That looks fine so I would use the print / console log option to work out which step is failing.

The code components looked like this.


The loop look like this.
When I am running online, as I get to the step with the loop, the condition file was unable to be selected. Please let m know if this is a clear description or if further clarification is needed. Thank you again for your help!

Have you checked the value of conditions2 straight after you set it?

I am not sure what you mean by this.

Did you find the bit about the browser console in my crib sheet?

The code you provided seems to be working and an excel file was selected. However, I am still running into the same error. I am going to see if I could figure out what is causing this error.

Which routine is the code component in? I assume it’s in a Begin Experiment tab but my guess is that it also needs to be in a routine that comes earlier than the loop it is randomising.

1 Like

Ah, I put the code component in the routine under the loop. I am going to try to put the code component earlier and see if that is what is causing the trouble, thanks!

That was the exact issue! I added the code component before the loop and it worked nicely! Thank you so much for your help!

Hello,

I am having an issue with my online script as well. Everything is uploaded online but I am not able to pilot it since it is stuck on “initializing the experiment”