# Newly created variable in conditions file not recognized

**URL:** <https://discourse.psychopy.org/t/newly-created-variable-in-conditions-file-not-recognized/8094>\
**Category:** Online experiments\
**Created:** [June 12, 2019, 4:48pm UTC](https://discourse.psychopy.org/t/newly-created-variable-in-conditions-file-not-recognized/8094 "2019-06-12T16:48:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rob-linguistics13](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/rob-linguistics13/32/5558_2.png) [@rob-linguistics13](https://discourse.psychopy.org/u/rob-linguistics13)\
**Post date:** [June 12, 2019, 4:48pm UTC](https://discourse.psychopy.org/t/newly-created-variable-in-conditions-file-not-recognized/8094/1 "2019-06-12T16:48:48Z")

</div>

URL of experiment: [here](https://run.pavlovia.org/roberto.petrosino/maskedpriming_2v_list1/html/? __pilotToken=e073ee5c689bab5873576306a85adcba&__ oauthToken=aaca384de17143ecc90f7c7932851480360e477fffe77e815f2e11e9a6f4ccd8)

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?

Thanks!

---

<div class="post-metadata">

**Author:** ![JuliaS](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@JuliaS](https://discourse.psychopy.org/u/JuliaS)\
**Post date:** [June 12, 2019, 5:40pm UTC](https://discourse.psychopy.org/t/newly-created-variable-in-conditions-file-not-recognized/8094/2 "2019-06-12T17:40:47Z")

</div>

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:

 ![response](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/b/1/b1c8ce73d89fe0e8f06bed069626c23ee6039acc.jpeg)

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

Hope this helps!

---

<div class="post-metadata">

**Author:** ![rob-linguistics13](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/rob-linguistics13/32/5558_2.png) [@rob-linguistics13](https://discourse.psychopy.org/u/rob-linguistics13)\
**Post date:** [June 12, 2019, 7:38pm UTC](https://discourse.psychopy.org/t/newly-created-variable-in-conditions-file-not-recognized/8094/3 "2019-06-12T19:38:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rob-linguistics13](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/rob-linguistics13/32/5558_2.png) [@rob-linguistics13](https://discourse.psychopy.org/u/rob-linguistics13)\
**Post date:** [June 13, 2019, 6:20am UTC](https://discourse.psychopy.org/t/newly-created-variable-in-conditions-file-not-recognized/8094/4 "2019-06-13T06:20:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [June 13, 2019, 12:44pm UTC](https://discourse.psychopy.org/t/newly-created-variable-in-conditions-file-not-recognized/8094/5 "2019-06-13T12:44:38Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![rob-linguistics13](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/rob-linguistics13/32/5558_2.png) [@rob-linguistics13](https://discourse.psychopy.org/u/rob-linguistics13)\
**Post date:** [June 13, 2019, 6:09pm UTC](https://discourse.psychopy.org/t/newly-created-variable-in-conditions-file-not-recognized/8094/6 "2019-06-13T18:09:53Z")

</div>

Yes, right.

> [@dvbridges](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [June 13, 2019, 7:15pm UTC](https://discourse.psychopy.org/t/newly-created-variable-in-conditions-file-not-recognized/8094/7 "2019-06-13T19:15:21Z")

</div>

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.
