Variables empty in online script (looping over dictionaries)

I usually start with an auto code component, write the Python code then switch the code type to Both and edit the JS code.

In principle I like to have experiments that work offline as well as online (which isn’t always possible) so that the experiment can potentially be tested offline as well. I sometimes test a new experiment offline prior to the initial sync.

Hi @littlethumb123,
In the code component, you have a few options: one is py → js “auto-translate”, another is “both” (you edit py and js codes manually yourself), and there is also only py or only js. As @wakecarter said, the js is for running the experiment online, and python is for running it locally; they behave slightly differently which is why many people run into problems when trying to put their study online if it has code components.
I used the “both” option so that I could edit each side independently, because the “auto-translate” didn’t translate this piece of code very well for online studies. Hope that helps.

Thanks for the reply! It is very clear!