oTree Forum >

Payoff variable generated by oTree

#1 by boma

Hi everyone

I use oTree studio. There is something not working concerning the payoffs.

I use the REAL_WORLD_CURRENCY_CODE Euro. I use points: 0.01 real_world_currency_per_point. The participation_fee is 0. Players make decisions and in the very end in the last app I show them the variable {{ participant.payoff }} and {{ participant.payoff_plus_participation_fee() }}. This is their cumulated payoff.

The problem is that what they are shown does not correspond to what is then saved in the end in the Excel under the variable participant.payoff. Do you have any idea how this can be? Thank you!

#2 by BonnEconLab

Without any additional information the issue is very difficult to diagnose. Please provide code or at least an example of what is displayed to participants that is different from what is written in the Excel file.

I quickly checked this in a test experiment of mine, via including

<p>
        <code>player.payoff</code> {{ player.payoff }}<br>
        <code>participant.payoff</code> {{ participant.payoff }}<br>
        <code>participant.payoff_plus_participation_fee()</code> {{ participant.payoff_plus_participation_fee() }}<br>

in the template of a page and

    @staticmethod
    def before_next_page(player, timeout_happened):
        player.payoff += 100

in __init__.py (in the class for the previous page).

Everything works as expected — also in the Excel file: `participant.payoff` + `session.config.participation_fee` equals the value that is displayed via `{{ participant.payoff_plus_participation_fee() }}`.

#3 by boma

Thank you for your quick reply!

I show them:
<p>
Your payout in this study, in points, amounts to: {{ participant.payoff }}
</p> 

<p>
The following exchange rate is applied: 100 points = 1 Euro.
</p> 

<p>
Thus, your payout in euros is: {{ participant.payoff_plus_participation_fee() }}
</p>

When I try it out by myself with the demo version, everything works.
Also when I try it out by myself in the server, everything works.
But when doing the actual experiment and players arrive at different times to this last page (all the players in the same matching group arrive at the same time, so the payoff is not adjusted in the end), the participant.payoff in points that they see is different from the participant.payoff in the Excel. The difference ranges from +-160 points. The Excel is the correct amount, so what they see is wrong. Also, it's not for everyone wrong. Only around 50% see a wrong participant.payoff (either too low or too high) and for the other 50% it was correct. But there is no system such as that players that arrive first see a wrong payoff and players that arrive later see a correct payoff or something like that. It seems random. Could it have something to do with the points/currency?

I hope this is more precise. Thank you a lot for your help!

#4 by BonnEconLab

I reran my code with more than a single demo participant, with multiple rounds, and I also switched to using points in combination with the real_world_currency_per_point conversion rate. Everything works fine.

So, without knowledge of your source code, it will be hard to impossible to diagnose the cause of your issue.

Write a reply

Set forum username