Set duration as a variable

In order to set the duration of an image as a variable, I extracted the duration of each item, included it within the spreadsheet as a variable: $duration, and input that variable name into the duration field within the image. It works well on builder offline, but it doesn’t work online.

The error message as following:
Unfortunately we encountered the following error:
TypeError: Assignment to read-only properties is not allowed in strict mode
Try to run the experiment again. If the error persists, contact the experiment designer.

So, how can I deal with this problem?

Any help is greatly appreciated!

I would start by renaming the variable to something other than duration. This sounds a lot like a conflict where it can’t tell which “duration” you’re referring to, the stimulus property or the variable that sets a value for the stimulus property. Call it something like $myDuration or something and see if that fixes it.

Thanks a lot !
I saved the “condition.xlsx” file as “condition…csv” file. Now, the online experiment can run well.
I will try your suggestions and see if it also works.

Thanks again~

I want to set duration as a variable but I don’t know how to do.I try to input all duration conditions in an excel.xlsx,and input the variable name into the duration field in the image module like using other variable.However,it doesn’t work.The error said ‘NoneType’ object is not callable.
I wanted to find a solution on this website,and saw your topic,so can you teach me how to figure out this problem please?