Before_next_page and timeout happened

768 views
Skip to first unread message

Jiaqing Liu

unread,
Mar 7, 2021, 5:06:37 AM3/7/21
to oTree help & discussion
Hi Chris,

I'm trying to use a timeout on a page and tried the code on the documentation here: https://otree.readthedocs.io/en/latest/timeouts.html#timeout-seconds
Capture.PNG

When I run this I get the following error: TypeError: before_next_page() missing 2 required positional arguments: 'player' and 'timeout_happened'

The traceback shows: self.before_next_page()

How do you call before_next_page and pass the two missing arguements?

Thanks in advance,
Jia

Chris @ oTree

unread,
Mar 7, 2021, 8:14:56 AM3/7/21
to Jiaqing Liu, oTree help & discussion
This tutorial is for the new format. Upgrade oTree and create a new project with startproject. 

Sent from my phone

On Mar 7, 2021, at 6:06 PM, Jiaqing Liu <jiaqin...@gmail.com> wrote:

Hi Chris,

I'm trying to use a timeout on a page and tried the code on the documentation here: https://otree.readthedocs.io/en/latest/timeouts.html#timeout-seconds
<Capture.PNG>


When I run this I get the following error: TypeError: before_next_page() missing 2 required positional arguments: 'player' and 'timeout_happened'

The traceback shows: self.before_next_page()

How do you call before_next_page and pass the two missing arguements?

Thanks in advance,
Jia

--
You received this message because you are subscribed to the Google Groups "oTree help & discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to otree+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/otree/3b85986b-dee8-45d1-8858-45fed130bcf9n%40googlegroups.com.
<Capture.PNG>

Jiaqing Liu

unread,
Mar 7, 2021, 3:43:40 PM3/7/21
to oTree help & discussion
Hi Chris,

By new format do you mean Otree lite? Im currently running 3.3.11

Thanks,
Jia

Chris @ oTree

unread,
Mar 7, 2021, 3:47:04 PM3/7/21
to oTree help & discussion
The tutorial you are following is based on the new no-self format described here: https://otree.readthedocs.io/en/latest/misc/noself.html

If using oTree Lite (oTree 5), you can choose between the "no-self" and "self" format.
oTree 3 only supports the "self" format.

The documentation for the "self" format is here: https://otree.readthedocs.io/en/self/

Jiaqing Liu

unread,
Mar 7, 2021, 10:54:38 PM3/7/21
to oTree help & discussion
Thanks Chris!

Jia
Reply all
Reply to author
Forward
0 new messages