CSSE1001 / MyPyTutor

Interactive tutorial application for Python3.
Other
7 stars 12 forks source link

Timestamps for submissions/deadlines aren't in the same time zone #92

Closed jgat closed 9 years ago

jgat commented 9 years ago

When a user submits a task, the web server takes the current timestamp in UTC, but the due dates (17:00 on the respective days) are stored on the server in UTC+10. This timezone difference doesn't appear to be accounted for in the server code, meaning that students can submit code "on time" up to 10 hours after the intended deadline.

sapi commented 9 years ago

I think the best solution is for the server to store due dates in UTC.

The tutorial creation script can handle the conversion.

pjritee commented 9 years ago

I agree - it's a one-time conversion

sapi commented 9 years ago

@jgat Did you intend the hacky fix in 1bcb282 to fix this, or to be undone when we apply a proper fix?

jgat commented 9 years ago

That's only semi-relevant to this issue (that fix was for the web-view of submissions for issue #87). I made that change when I was very tired and wasn't bothered to find out if there was a better way to do timezone conversion (I hope that there is a better way, but I'm not sure). That fix should be readded into the progress script.

It's probably not that hacky, something like that should go in the script which generates the due-dates that get stored on the server.

sapi commented 9 years ago

Gotcha. I normally use pytz, combined with dateutil where necessary, but I'm yet to see timezone code anywhere which doesn't look hacky in some form or another :P

I'll add it into the due dates script when I get a chance.