oTree Forum >

Randomly occurred round-wise result page problem in a public good game_deployed via Heroku

#1 by Tanmoy

I am running a 10-round public good experiment on Heroku. After each round, participants can observe their contributions to the public and private account. And then they proceed to the next round. First session went smoothly. In the second session, in some rounds participants observe wrong results; e.g. a participant contributed 5 and 15 to public and private account, respectively (total endowment is 20 tokens), however in the round result page the participant observed 5 and 0, respectively.

I made sure that, as long as 20 tokens are not distributed between these two accounts, the next button is inactive. That is, without allocating all 20 tokens participants can not proceed.

Surprisingly, session 3 and 5 went well, without such problem, but session 4 had such a problem. Also, it is to be noted that, this problem is not occurring in all rounds or for all participants. It is random.

I have crosschecked the code in local server, as well as production server, it is working fine, without any issue.

I will be grateful if anyone can identify the problem and provide me with some solutions.

Thank you.

#2 by BonnEconLab

@Tanmoy wrote,

> I will be grateful if anyone can identify the problem and provide me with some solutions.

This will be impossible without having any knowledge of your code.

#3 by Tanmoy

@BonnEconLab

Thank you for your response. The code is working fine in Sessions 1, 3, and 5 but not working in Sessions 2 and 4, in some rounds for some participants. If there was any issues regarding the code, then the problem would occur for all sessions, all participants, all rounds. Which is not the case (as far as I understand).

So, can this problem be associated with Heroku?

Thank you.

#4 by BonnEconLab

A wild (?) guess: You wrote,

> ... e.g. a participant contributed 5 and 15 to public and private account, respectively (total endowment is 20 tokens), however in the round result page the participant observed 5 and 0, respectively.
>
> I made sure that, as long as 20 tokens are not distributed between these two accounts, the next button is inactive. That is, without allocating all 20 tokens participants can not proceed.

Could it be that participants were still able to proceed by simply pressing enter? That might explain why the 5 was recorded while the 15 was replaced by 0.

You wrote,

> Also, it is to be noted that, this problem is not occurring in all rounds or for all participants. It is random.

I very much doubt that your issue is indeed random or introduced by Heroku (unless Heroku uses a different Python version than you use locally).

> If there was any issues regarding the code, then the problem would occur for all sessions, all participants, all rounds. Which is not the case (as far as I understand).

No, not necessarily. If it is not the ability to proceed by pressing enter that I have guessed above, the issue must be caused by some variation between the sessions that has some unintended influence on the execution of your code. (You could imagine, for instance, that some session sizes are odd, while the sizes of other sessions are even, and your payoff calculation is incorrect for odd-sized sessions.)

#5 by Tanmoy

Thank you for the reply.

You raised an important point -

> Could it be that participants were still able to proceed by simply pressing enter? That might explain why the 5 was recorded while the 15 was replaced by 0.

I should check whether pressing "Enter" they can move forward. I made sure of clicking "Weiter" button, but not "Enter".

> No, not necessarily. If it is not the ability to proceed by pressing enter that I have guessed above, the issue must be caused by some variation between the sessions that has some unintended influence on the execution of your code. (You could imagine, for instance, that some session sizes are odd, while the sizes of other sessions are even, and your payoff calculation is incorrect for odd-sized sessions.)

Regarding this, payoff calculation is right. All sessions are of same size (39 participants - 13 groups [three-player public good game])

I will check the "Enter" issue first.

Thank you very much for your comments. It is greatly appreciated.

#6 by Tanmoy

@BonnEconLab

I checked the code and also went for a test run, simply by pressing "Enter" it is not possible to proceed. As, the "Weiter" button is inactive until all tokens are distributed, "Enter" also doesn't work.
Even when they distribute all tokens, by pressing "Enter" they can not move forward, only by clicking the button they can move forward.

I will check for the version compatibility.

So, I am clueless !!

#7 by BonnEconLab

@Tanmoy wrote,

> I checked the code and also went for a test run, simply by pressing "Enter" it is not possible to proceed.

Hmmmm. When I include an `<input type="text">` in my HTML template, I can advance to the next page by pressing [Enter] even in the complete absence of a `{{ next_button }}`. All I need to do is hit [Enter] as long as the cursor is positioned in the text input field.

(If I include only `<input type="radio">` or `<select>`, this does not work.)

Interestingly, as soon as I include a `<button disabled>`, hitting [Enter] does not work anymore. So, when you write,

> as long as 20 tokens are not distributed between these two accounts, the next button is inactive

do you mean that the `disabled` attribute is set initially and then removed via JavaScript when the two values sum up to 20?

If this really is not the solution to your issue, feel free to send me your code via e-mail.

> All sessions are of same size (39 participants - 13 groups [three-player public good game])

I only used the session size as an example for some arbitrary element in your code that causes this unintended consequence.

Write a reply

Set forum username