oTree Forum >

Page refresh causes countdown to recalculate

#1 by Rainbow

Thank you very much for reading. I'm very sorry for asking foolish questions again.
In our experiment, I used my own computer as the server and established a local area network using a router, allowing my participants to participate in the experiment using a tablet.
In my experiment, I hope that the subjects can make a choice within 90 seconds. Therefore, I set "timeout_seconds=90" in the init file and referred to the notation in the Otree document in the corresponding HTML file of the page. On this page, I set "the remaining countdown time will only be displayed when there are 30 seconds left.". If the countdown ends and the subject does not actively submit the page, the system will randomly make a selection.
But in actual experiments, I encountered a problem:
We record the time when the subjects enter this stage as time A, and the 90th second after A is recorded as time A‘
The time point when the subject sees the refreshed page is recorded as time B, and 90 seconds after B is recorded as time B‘
If the subject makes a selection during the period A '- B', the system will not be able to correctly save the subject's selection. This phenomenon is particularly evident. If the subject refreshes the page, the countdown of the page will be recalculated from 90 seconds, but in reality, there will be a period of time between A '- B'. How to make the countdown time of the page the same as the actual countdown time?
Have you ever encountered a similar problem? Thank you very much for your help!

#2 by Rainbow

Solved the case. The reason for this issue is that I added a package when hiding the reference timer (I don't know where it came from, probably I copied it online), which prevented the page from refreshing. Just delete him.
The deleted content is as follows:
<script src=“ https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js </script>
I don't know what this is, but I hope it will be helpful to you!

Write a reply

Set forum username