Each of your app’s Views will display a form to the participant.
Even if the participant does not need to fill anything out, they will usually at least see a button that takes them to the next page in their sequence.
pTree forms are based on Django Forms and ModelForms.
Your forms are defined in forms.py in your app.
The current participant, match, treatment, and experiment objects. These are provided for you automatically.
You can put any code here to customize how a particular field gets displayed.
This method will make an IntegerField (or FloatField, etc.) display as a dropdown menu with each amount displayed as a currency amounts.
You need to call this in your form’s initialize_form() method, like this:
def initialize_form(self):
# in this example, self.treatment.offer_choices() returns a list like [0, 10, 20, 30, 40, 50]
self.make_field_currency_choices('amount_offered', self.treatment.offer_choices())