forked from mgutierrezc/tanaka-2010
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pages.py
50 lines (31 loc) · 961 Bytes
/
pages.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from otree.api import Currency as c, currency_range
from ._builtin import Page, WaitPage
from .models import Constants
class Introduction(Page):
pass
class Example1(Page):
pass
class Example2(Page):
pass
class Example3(Page):
pass
class Example4(Page):
pass
class Decision1(Page):
form_model = 'player'
form_fields = ['first_choice_1', 'second_choice_1']
class Decision2(Page):
form_model = 'player'
form_fields = ['first_choice_2', 'second_choice_2']
class Decision3(Page):
form_model = 'player'
form_fields = ['first_choice_3', 'second_choice_3']
def before_next_page(self):
self.player.set_payoffs()
class Results(Page):
def vars_for_template(self):
final_payoff = self.participant.payoff_plus_participation_fee()
return dict(f_p=final_payoff)
page_sequence = [
Introduction, Example1, Example2, Example3, Example4,
Decision1, Decision2, Decision3, Results]