# Copy online experiment

**URL:** <https://discourse.psychopy.org/t/copy-online-experiment/15176>\
**Category:** Online experiments\
**Tags:** pavlovia\
**Created:** [July 20, 2020, 5:42pm UTC](https://discourse.psychopy.org/t/copy-online-experiment/15176 "2020-07-20T17:42:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![haaleemur](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@haaleemur](https://discourse.psychopy.org/u/haaleemur)\
**Post date:** [July 20, 2020, 5:42pm UTC](https://discourse.psychopy.org/t/copy-online-experiment/15176/1 "2020-07-20T17:42:18Z")

</div>

I wanted to copy a standard online experiment, say digit-span, and include it within my own. I was able to fork it and then copy the components over to my computer. However, when I am in the builder, the js code does not appear for these components (code components). Therefore, when I attempt to run the copied experiment there are lots of errors as the auto js misses important distinctions.

Is there any way to get the JS code that was being previously successfully used in the builder to establish the online experiment.

---

<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:** [July 21, 2020, 7:01am UTC](https://discourse.psychopy.org/t/copy-online-experiment/15176/2 "2020-07-21T07:01:42Z")

</div>

Are you using PsychoPy 2020?

---

<div class="post-metadata">

**Author:** ![haaleemur](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@haaleemur](https://discourse.psychopy.org/u/haaleemur)\
**Post date:** [July 21, 2020, 6:35pm UTC](https://discourse.psychopy.org/t/copy-online-experiment/15176/3 "2020-07-21T18:35:07Z")

</div>

yes I am. I am aware of the nifty AutoJS, which does work, but it causes many errors. For example it can’t figure out how to translate the code component for showing what the subject is typing on the screen using the .join function.

---

<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:** [July 21, 2020, 6:52pm UTC](https://discourse.psychopy.org/t/copy-online-experiment/15176/4 "2020-07-21T18:52:54Z")

</div>

> [@Psychopy to pavlovia error](https://discourse.psychopy.org/t/psychopy-to-pavlovia-error/14000/4):
>
> Ah. I think I see the problem. In Python the syntax is delimeter.join(array) and in JavaScript the syntax is array.join(delimeter) How about displayText='' for Idx in range(len(array)): displayText +=array[Idx]

---

<div class="post-metadata">

**Author:** ![haaleemur](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@haaleemur](https://discourse.psychopy.org/u/haaleemur)\
**Post date:** [July 21, 2020, 9:21pm UTC](https://discourse.psychopy.org/t/copy-online-experiment/15176/6 "2020-07-21T21:21:49Z")

</div>

for reference, I was trying to copy this adaptive DS [https://gitlab.pavlovia.org/gadiel22222/digit-span](https://gitlab.pavlovia.org/gadiel22222/digit-span)

---

<div class="post-metadata">

**Author:** ![haaleemur](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@haaleemur](https://discourse.psychopy.org/u/haaleemur)\
**Post date:** [July 23, 2020, 5:44am UTC](https://discourse.psychopy.org/t/copy-online-experiment/15176/7 "2020-07-23T05:44:25Z")

</div>

I tried this, and

```auto

for (var idx = 0, _pj_a = key_resp2_2.keys.length; (idx < _pj_a); idx += 1) {
    screen_text += key_resp2_2.keys[idx];
}

```

doesn’t work because ‘cannot read property ‘length’ of undefined’

do I have to import some module?
