# Psychopy to Pavlovia:issue with code

**URL:** https://discourse.psychopy.org/t/psychopy-to-pavlovia-issue-with-code/20033
**Category:** Online experiments
**Tags:** pavlovia
**Created:** [January 29, 2021, 5:50pm UTC](https://discourse.psychopy.org/t/psychopy-to-pavlovia-issue-with-code/20033 "2021-01-29T17:50:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![maui](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@maui](https://discourse.psychopy.org/u/maui)
#### Post date: [January 29, 2021, 5:50pm UTC](https://discourse.psychopy.org/t/psychopy-to-pavlovia-issue-with-code/20033/1 "2021-01-29T17:50:12Z")

</div>

URL of experiment: [TestFinaleSeq1 [PsychoPy]](https://pavlovia.org/run/MariaLuisaSileo/finaltest_seq1)

Description of the problem:  
Hello everyone!  
I have a memory task I built on PsychoPy. The activity works fine on my Mac, but when I try to pilot it on Pavlovia, I enter the participant number and immediately get “Reference error: trialsFinalTest\_seq1\_\_LoopBegin” and the activity fails.  
I tried to solve this problem by changing “code type” from “py” to “both” because I read something like this in the Forum but it still doesn’t work  
i know the problem is between Python code and JS code in Pavlovia but i don’t know how to proceed and how to modify the script  
this is my first experiment so I appreciate any help.  
this is JS code I have below

> **[Sign in](https://gitlab.pavlovia.org/users/sign_in)**
>
> Sign In/Register

 ![Schermata 2021-01-29 alle 10.31.46](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/7/d/7d71d5faf78e3f21e4c59321a628afab7abf7467.png)

---

<div class="post-metadata">

### Author: ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)
#### Post date: [January 29, 2021, 10:52pm UTC](https://discourse.psychopy.org/t/psychopy-to-pavlovia-issue-with-code/20033/2 "2021-01-29T22:52:31Z")

</div>

Hi

In general your code components should be auto unless you know why they need to be something else.

Please show a screenshot of where that variable used.

---

<div class="post-metadata">

### Author: ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)
#### Post date: [December 17, 2024, 7:41pm UTC](https://discourse.psychopy.org/t/psychopy-to-pavlovia-issue-with-code/20033/3 "2024-12-17T19:41:19Z")

</div>

Was your loop called trialsFinalTestSeq1\_ ?

If so, then the problem was probably that it ended on an underscore.
