psychopy.org | Reference | Downloads | Github

Changes in the code component are not updated when piloting

Description of the problem:

Hello everybody,

I used the following code chunk to randomize participants in one of three conditions:

possible_cond = [1,2,3];

condition_bid = possible_cond[Math.floor(Math.random() * possible_cond.length)];

psychoJS.experiment.addData('condition', condition_bid);

I changed the code by deleting the first condition;

possible_cond = [2,3];

condition_bid = possible_cond[Math.floor(Math.random() * possible_cond.length)];

psychoJS.experiment.addData('condition', condition_bid);

Depending on the condition, participants run through different routines. The code worked fine, but the change to just two conditions is not working. When I pilot the experiment, I still get randomized in condition 1 (even when I set the variable condition_bid = 2). The corresponding js document in git in the html folder adapted the changes I made in the builder.

I already:

  • deleted cache
  • did hard reloads
  • tried it at a different laptop where the experiment yet was not tested.

UPDATE:
It seems like no changes at all are getting updated online (even changing size of builder created polygons/texts etc.)

Does anyone has an idea what is going wrong?

Thank you very much in advance.

Are you getting a green or a red circle in Builder when you sync?
Any error messages in the Runner?

Hi @wakecarter thanks for your quick reaction!

I am getting a green circle in Builder while sync (if you mean the “sync with web project” button). I am getting no error messages in the Runner:

Pulling changes from remote...
Already up to date.
done
Pushing changes from remote...
done
Successful sync at: 14:35:14, took 3.139s900.7229     INFO     Successful sync at: 14:35:14, took 3.139s

Any ideas? I copied the whole project, pasted it in a new folder and created a new online project: It works fine. Unfortunately, we are in the middle of data collection and I would prefer to stick to the current online project.

Have you done all the steps here?

If Pavlovia refuses to run the latest upload of your experiment, disable the cache via Network conditions in the browser console. You may also need to clear the cache when you first set this (using Ctl-F5, Ctl-Shift-R or equivalent). When you have developer tools showing you can also press and hold the page refresh icon and select Empty Cache and Hard Reload.

Thank you for linking to this post, I did not find this one.

I already tried most of the solutions described there. However, when I run the experiment in private browser mode, the changes finally become visible!! Thank you very much, really appreciate your help.