oTree Forum >

Skipping pages and going directly to a new round after some choice

#1 by boma

I program a game in oTree studio. The game has 5 rounds (so "Constant: num_rounds=5"). Each round has two stages.

- We are in round 1 stage 1. In stage 1 a player has a choice between yes or no. If he chooses yes, he sees the page "result of stage 1" and then continues with round 1 stage 2. In stage 2 the player has another choice between yes or no. No matter his choice, he sees the page "result of stage 2" and he continues with round 2 stage 1.

- We are in round 1 stage 1. Again, in stage 1 a player has a choice between yes or no. Now, different to above, assume he chooses no, then he finishes early in the sense that he also goes to the page "result of stage 1" but then he continues with round 2 stage 1, i.e. he skips the round 1 stage 2.

How can I implement the skipping of stage 2?

Thank you for your help!

#2 by woodsd42 (edited )

https://otree.readthedocs.io/en/latest/pages.html#is-displayed 

That function should do what you want.  Write the if statement to condition on the stage 1 answer.

Edit: sorry, didn't see the otree studio bit.  I don't know where that option would be but I'm sure something equivalent exists.

#3 by boma

It worked with the function "is_displayed", thank you very much for your quick help!

Write a reply

Set forum username