Insert an quiz app in the middle of an multiple-round app

67 views
Skip to first unread message

Khoi Nguyen

unread,
Sep 22, 2021, 12:05:02 AM9/22/21
to oTree help & discussion
Hi Chris and everyone,

I want to build an experiment of Public Goods game with the following sequence:
1) A trial round (which is exactly the same as the real round)
2) A quiz
3) 12 real rounds

Because (1) and (3) are basically the same thing and I don't want to duplicate code, I try setting the app sequence as below:

app_sequence=['public_goods', 'quiz', 'public_goods']

However, otree does not allow duplicated apps in the sequence. Then, how should I implement the sequence above?

I appreciate any ideas. Thank you for the amazing otree platform.

Chris @ oTree

unread,
Sep 22, 2021, 12:09:50 AM9/22/21
to oTree help & discussion
See the appcopy/sandwich design in otree-snippets: https://www.otreehub.com/projects/otree-snippets/

Chris @ oTree

unread,
Sep 22, 2021, 12:10:41 AM9/22/21
to oTree help & discussion
or you can put it all in 1 app, and in the 2nd round you use is_displayed to skip all the game pages and only show the quiz pages.

Khoi Nguyen

unread,
Sep 22, 2021, 12:17:14 AM9/22/21
to oTree help & discussion
So the sandwich design requires duplicating the __init__.py file, but avoid copying the HTML templates?

Khoi Nguyen

unread,
Sep 22, 2021, 12:18:51 AM9/22/21
to oTree help & discussion
I would like to avoid the second solution because I have made the quiz app generic enough to be used across multiple experiments.
Reply all
Reply to author
Forward
0 new messages