Open peterlcsteele opened 2 years ago
Thanks for reporting this. Yes, it looks like something along the line isn't accounting for timezones. I'll try to investigate tomorrow.
"Tomorrow" is a mere 6 months later, but I've just had a look at this. I couldn't reproduce it, but I have found another exciting bug where the reported time spent was off by an hour. (see numbas/Numbas#17)
I've tried the following combinations of time zones:
The time was recorded correctly in every case. The only difference I can think of is that I'm using a local sqlite3 database, instead of postgresql. I can't easily set up a postgresql server in a different time zone.
Does this happen for every attempt, or just some? It looks like all of them, which suggests that there's just a timezone conversion failing to happen somewhere. I can't see where, though: the "time taken" is calculated on the client, and purely by subtracting Date
objects created locally.
What have you put for TIME_ZONE
in numbasltiprovider/settings.py
? What happens if you set your PC's time to UTC+0 and start an attempt?
The issue is demonstrated in the following screenshots. This installation is using Sydney/Australia (GMT+10) timezone - perhaps this is causing the issue.
Statistics page:
Attempts: