Urgent---Online does not work though local works

InI.psyexp (26.5 KB)
Please see the relevant part of the routine attached.

Example of a trial (image, word and imagery must be incongruent):
1- select an image
If the image = red, then word and imagery cannot be red (.remove(1) )
2. select a word
If word = blue then imagery cannot be blue either (.remove(5))
3. select an imagery
Since the image is red word is blue imagery cannot be either.
imagery = purple

My custom (I do not work in coder mode) Py code is auto-translated to Js. The code works locally, but not work online.
What can be the reason?

In online study, the color is randomly picke in all trials. Sometimes the items are matching. But in local run, it never presents the same color, exactly in a way I want.

remove doesn’t work online

I know added below code as you suggested before. Though, it does not still work. I was working when I have had more conditions.

  Array.prototype.remove = function(value) {
  return this.filter(function(ele){ 
              return ele != value; 

Any idea?

Your help is much appreciated.

Your Builder file only have one code component set to Both. I would recommend separating into at least two (one Auto and one Both) to ensure that as much of the code as possible uses the transliterater.

I can’t see where you are defining Array.prototype.remove

I am sorry, I am not sure if I understood correctly. Should I add another code component and paste the Py code and have auto-translated Js code? Wouldnt this way experiment repeat the presentation of items?

It is set to both only for hiding the cursor. I used auto-translation for the JS code.

The Array.prototype.remove is in compiled JS script. I do not know where to put it in the custom code.

You checked my code and inserted this code exactly in the below location.It was working before though, when I have 5 conditions. When I reduce it to 1, it stopped working.

Should I change its place? It is before the experimental trial (that I sent the example) starts.
This is your edit:

This is mine: