| Reference | Downloads | Github

Newly created variable in conditions file not recognized

URL of experiment: here

Description of the problem:

After creating a new project and updating the .js file with the relevant changes, I realized I forgot to create the column for checking the correct key responses (named corrAns) in my conditions file. When I test the experiment, the variable does not seem to be recognized at all (i.e., the cell for key.corr is empty in the output file), even though I believe the right variable is defined in the appropriate key component.

I have already tried to:

  1. refresh/bypass the cache
  2. use different browsers (Safari, Chrome, Firefox)
  3. delete the old csv file and upload a new csv file with the new variable

…but none worked. This is rather strange…any ideas?


Hello @rob-linguistics13,

This could be due to number of reasons, for example due to not selecting “Store Correct” in your keyboard component. I’ve attached a picture of what an example keyboard component should look like:

As you can see both “Store correct” and “Force end of Routine” should be ticked.

Hope this helps!

In the Builder and the relative js file everything seems fine - the key component is set to store the correct answer and force end of the routine. The only thing missing was the actual variable column in the relative csv file. My impression is that the js file, once created, does not get the eventual updates on the linked .csv files.

I just discovered that I was modifying the wrong conditions file. I thought the js file was linked to the conditions file in the main folder, but then I realized that it is instead linked to the conditions files in the html/resources subfolder.

For anyone having similar problems in the future:

  1. You want to update the conditions file that is stored in html/resources of your git project.
  2. Once you have done that, clear cache and refresh the page.

Hi @rob-linguistics13, thanks for the update. For clarity, I think your situation is different from most users. Most users will want to update their conditions file in the parent folder, not in the html folder, because when they sync their task from Builder, Builder will copy the files from the parent folder to the html/resources folder, and will thus overwrite any changes made in the html folder. In your case, you are manually editing your js file and uploading to Pavlovia, without exporting the HTML/JS from Builder (because this would overwrite your manual changes).

1 Like

Yes, right.

By the way, I had also tried that, but an error about a conflict between the two versions of the file would keep popping up.

Ok, sounds like you had a merge conflict. This might happen if you made changes to your repository on GitLab, and then made similar changes to the same file on your local computer without first pulling the changes you made in your online GitLab repository. So, when you try to sync, Git has trouble figuring out which changes should be used.

1 Like