# Can not Run online

**URL:** <https://discourse.psychopy.org/t/can-not-run-online/43308>\
**Category:** Online experiments\
**Tags:** pavlovia\
**Created:** [December 17, 2024, 1:42pm UTC](https://discourse.psychopy.org/t/can-not-run-online/43308 "2024-12-17T13:42:52Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![XCMa](https://avatars.discourse-cdn.com/v4/letter/x/f05b48/32.png) [@XCMa](https://discourse.psychopy.org/u/XCMa)\
**Post date:** [December 19, 2024, 9:09am UTC](https://discourse.psychopy.org/t/can-not-run-online/43308/21 "2024-12-19T09:09:06Z")

</div>

Dear wakecarter,

Thank you for replying.

Sorry for the confusing about the arrow button. The right arrow is the keyboard button ‘→’. And the arrow button on the keyboard use to turn the page. And I use a code in routine.

 ![截屏2024-12-19 09.04.33](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/7/8/78bd850538efa7b0fbf085d7533adfe067c786d2.png)  
 ![截屏2024-12-19 09.04.44](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/e/4/e41aa8390eb8b45f1e0a695050cb0d7a5f6014f0.png)  
 ![截屏2024-12-19 09.04.54](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/6/1/611bd3472e675e5e0c87f0352319bf1ec51ba388.png)  
 ![截屏2024-12-19 09.05.08](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/6/6/66ea16730a732da9d39ac5404defd76af07b3d37.png)  
 ![截屏2024-12-19 09.05.13](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/2/5/25e7e8bf26f8e8ddae0f0a8716f435d6168d5cd7.png)

Yours sincerely,  
Xiaochen

---

<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 19, 2024, 9:20am UTC](https://discourse.psychopy.org/t/can-not-run-online/43308/22 "2024-12-19T09:20:56Z")

</div>

Is Consent\_keyResp set to record all keys?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/4/6/4609fc4277ec277b054f1e15617ad54bf4ff4881.png)

Is it set to end the routine?

![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/1/8/18944a9d884ab82a7d558216039026ad5454c064.png)

---

<div class="post-metadata">

**Author:** ![XCMa](https://avatars.discourse-cdn.com/v4/letter/x/f05b48/32.png) [@XCMa](https://discourse.psychopy.org/u/XCMa)\
**Post date:** [December 19, 2024, 9:36am UTC](https://discourse.psychopy.org/t/can-not-run-online/43308/23 "2024-12-19T09:36:00Z")

</div>

Yes, I have set end the routine in the Consent\_keyResp. And I set it to record all keys this time (it store last key previously), but the arrow button still does not work.

Best Wishes,  
Xiaochen

---

<div class="post-metadata">

**Author:** ![JensBoelte](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jensboelte/32/9060_2.png) [@JensBoelte](https://discourse.psychopy.org/u/JensBoelte)\
**Post date:** [December 19, 2024, 9:41am UTC](https://discourse.psychopy.org/t/can-not-run-online/43308/24 "2024-12-19T09:41:37Z")

</div>

Hello

Setting the key to **end the routine** and setting it to **record all keys** will not work together. Either you end the routine by pressing a key. Or you record all keys. What do you mean by

> [@XCMa](#):
>
> but the arrow button still does not work.

?

Best wishes Jens

---

<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 19, 2024, 9:47am UTC](https://discourse.psychopy.org/t/can-not-run-online/43308/25 "2024-12-19T09:47:52Z")

</div>

Set it to record first or last key. With all keys, Consent\_keyResp.keys will be a list, e.g. [‘right’]

You can also use if ‘right’ in Consent\_keyResp.keys

---

<div class="post-metadata">

**Author:** ![XCMa](https://avatars.discourse-cdn.com/v4/letter/x/f05b48/32.png) [@XCMa](https://discourse.psychopy.org/u/XCMa)\
**Post date:** [December 19, 2024, 9:51am UTC](https://discourse.psychopy.org/t/can-not-run-online/43308/26 "2024-12-19T09:51:30Z")

</div>

Dear JensBoelte,

Sorry for the confusion.

The first time, the setting of Consent\_keyResp is ‘end the routine’ and ‘record last key’, but it does not work. And I thought I need to set it to ‘record all keys’. So I changed it in the second time, it still does not work.

Yours sincerely,  
Xiaochen

---

<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 19, 2024, 10:02am UTC](https://discourse.psychopy.org/t/can-not-run-online/43308/27 "2024-12-19T10:02:26Z")

</div>

If it’s still not working, try `print('Consent_keyResp.keys',Consent_keyResp.keys)` to see what is being pressed.

---

<div class="post-metadata">

**Author:** ![JensBoelte](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jensboelte/32/9060_2.png) [@JensBoelte](https://discourse.psychopy.org/u/JensBoelte)\
**Post date:** [December 19, 2024, 10:20am UTC](https://discourse.psychopy.org/t/can-not-run-online/43308/28 "2024-12-19T10:20:00Z")

</div>

Hello

What do mean by this

> [@XCMa](#):
>
> So I changed it in the second time, it still does not work.

?  
The routine does not end? The consentslideN does not change? As far as I can tell, you want the participant to be able to move forward and backward through your eight (?) conset-slides? Am I correct?

Best wishes Jens

---

<div class="post-metadata">

**Author:** ![XCMa](https://avatars.discourse-cdn.com/v4/letter/x/f05b48/32.png) [@XCMa](https://discourse.psychopy.org/u/XCMa)\
**Post date:** [December 19, 2024, 10:42am UTC](https://discourse.psychopy.org/t/can-not-run-online/43308/29 "2024-12-19T10:42:00Z")

</div>

Dear JensBoelte,

Yes, you are correct! I want to participant to be able to move forward and backward through my eight conset-slides. But the routine does not end when I press ‘right’ on the keyboard

I changed the setting of Consent\_keyResp from ‘record last key’ to ‘‘record all keys’’ in the second time as well as ‘end the routine’. But I know that was wrong thought what you told me. So I changed them to the original setting: ‘end the routine’ and 'record last key.

Yours sincerely,  
Xiaochen

---

<div class="post-metadata">

**Author:** ![XCMa](https://avatars.discourse-cdn.com/v4/letter/x/f05b48/32.png) [@XCMa](https://discourse.psychopy.org/u/XCMa)\
**Post date:** [December 19, 2024, 10:50am UTC](https://discourse.psychopy.org/t/can-not-run-online/43308/30 "2024-12-19T10:50:47Z")

</div>

Dear wakecarter,

I use the code you send me in the Each frame tab. Then I run the local experiment (the local one aways run good), it shows the bellow information.

Yours sincerely,  
Xiaochen

 ![截屏2024-12-19 10.50.29](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/f/b/fbf1c15da8590c90841b5d87870fa7553698a719.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:** [December 19, 2024, 11:01am UTC](https://discourse.psychopy.org/t/can-not-run-online/43308/31 "2024-12-19T11:01:51Z")

</div>

Please put it in End Routine at the bottom and also add `print('consentslideN',consentslideN)`

---

<div class="post-metadata">

**Author:** ![XCMa](https://avatars.discourse-cdn.com/v4/letter/x/f05b48/32.png) [@XCMa](https://discourse.psychopy.org/u/XCMa)\
**Post date:** [December 19, 2024, 11:13am UTC](https://discourse.psychopy.org/t/can-not-run-online/43308/32 "2024-12-19T11:13:33Z")

</div>

Dear wakecarter

1. I put it in there and press right and left keys to turn pages.  

2. And I made a demo of this program by copying the routine. The local experiment can run, but the online one can not. And also show another problem.  

[OnlinePracticeArrowPress.zip](https://discourse.psychopy.org/uploads/short-url/qSuLIl65xyHDj1O9uBsqzvzuihE.zip) (4.3 MB)

Yours sincerely,  
Xiaochen

---

<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 19, 2024, 11:30am UTC](https://discourse.psychopy.org/t/can-not-run-online/43308/33 "2024-12-19T11:30:52Z")

</div>

If you want your experiment to run online, start by changing the Python code components to Auto.

> [@wakecarter](#):
>
> Please put it in End Routine at the bottom and also add `print('consentslideN',consentslideN)`

Your local experiment is now working correctly? What was the final fix? I note that you didn’t add this second print statement.

---

<div class="post-metadata">

**Author:** ![XCMa](https://avatars.discourse-cdn.com/v4/letter/x/f05b48/32.png) [@XCMa](https://discourse.psychopy.org/u/XCMa)\
**Post date:** [December 19, 2024, 8:55pm UTC](https://discourse.psychopy.org/t/can-not-run-online/43308/34 "2024-12-19T20:55:36Z")

</div>

Dear wakecater,

1. Sorry for the confusion. I upload the wrong folder. Now, I am changing the Python code to Auto and can run it online.

Thin link is:

[https://run.pavlovia.org/student\_M/demoarrow/?\_\_pilotToken=3c59dc048e8850243be8079a5c74d079&\_\_oauthToken=aaec2efaf471f2acd15b2cffafbc1bbeea26aad4b12d77a89e641b9fb5d9e147](https://run.pavlovia.org/student_M/demoarrow/? __pilotToken=3c59dc048e8850243be8079a5c74d079&__ oauthToken=aaec2efaf471f2acd15b2cffafbc1bbeea26aad4b12d77a89e641b9fb5d9e147)

The local file:

[OnlinePracticeArrowPress.zip](https://discourse.psychopy.org/uploads/short-url/mynJ9EaWhvZRxAgFnPaSdqONRp4.zip) (4.3 MB)

Thank you very much! You always help me lot.

1. However, there are other problems with my actual experiment. The inter-trial interval should be 0.3s, but it seems it is 0 when I run it online. Moreover, the screens, including the countdown function, seem to disappear, which uses a code component in the builder.

 ![截屏2024-12-19 20.51.05](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/6/6/667cf140ad1c38ff73415761cbf46424206099c4.png)  
 ![截屏2024-12-19 20.51.16](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/e/5/e5b17efb212f7206fc21759a5bfc3225c3dc7ca7.png)

Yours sincerely,  
Xiaochen

[Previous page](https://discourse.psychopy.org/t/can-not-run-online/43308.md?page=1)
