MoralCode/ClassClock

ClassClock time does not match between two devices

Opened this issue · 4 comments

When comparing ClassClock's countdown between two devices, the times may not match. This is due to the fact that ClassClock uses the time of the device it is loaded on (using javascript's Date() function) and inconsistencies between the time settings of different devices may cause differences in the displayed time.

Temporary workaround: Because this issue is the result of differences between device time settings, making sure both devices time settings are set to "set time automatically" should mitigate this issue until a proper fix is available

Planned Fix: The ClassClock database already has a timezone field for storing the timezone that a school was created in. This could potentially be used to fetch the time from a network time server (the same ones that almost every device sets their time from) and adjusted to this timezone to allow ClassClock to show consistent countdown times for everyone.

With this new cross-device consistent time source a number of things can be done:

  1. fix the countdown times so that they match across devices (duh)

  2. alter the time that ClassClock displays at the top to also show this modified time

  3. alternatively, DONT alter the time displayed at the top and display a message to users that the countdown time has been adjusted and that they should check their devices time settings

Feel free to leave comments or suggestions if you think this should be done differently

another fix since many schools may already be using a wireless/synchronized clock system (like https://www.innovationwireless.com/markets/k12-schools.html), ClassClock may be able to find a way to hook into that.

It could be possible to connect to a time server such as time.nist.gov or time.windows.com

yeah i was thinking about that, although i think those specific services operate using the NTP protocol which may be a little overkill for this use case as it only really needs to be accurate to within a second or two.

The other thing i was thinking of was to just use the time of the server where the ClassClock web app is being hosted, which should be able to just be read from the Date header of the responses from the API.

Having a "time source" that can be set on a per-school basis might be better to allow schools to sync ClassClock with whatever their wall clocks are synced from so that things stay consistent with the clocks that students are used to using. However, this per-school time source is a pretty "stretch" feature that i haven't looked too far into.

Because of the issues in #23 with the development branch being kinda disorganized and blocked by the admin panel addition and no free time on my side to work on it, I haven't gotten around to implementing any kind of time-syncing yet.

Since this issue has been opened i have also been working on improving the accuracy of https://github.com/NodeGuy/server-date so all the classclock webapps an just sync their time with the server, so that they are all relatively close to each other time-wise (id say within 100 or 200 ms is probably acceptable for this. sub-100 would be nice if it is not too much additional effort though (as thats the limit Ive heard of for user perceptibility)

Just wanted to drop this info here mostly for posterity in case someone else decides to pick up this torch and continue it