I would like to discuss the best strategies to measure the time of an AFCS session going between two users Tom the teacher and Sam the student. It is important since the pay per use model of AFCS will of course impact our way of making the client pay.
- When Tom says the session is starting by toggling a button, the timer should start being taken into account only if two users are present in the room. Sam also see the timer but can not interact with it.
- When Tom toggles off the button, the timer should stop.
- If Tom or Sam disconnect the timer should stop.
For now my idea was the following:
If two users are in the room and timer is on:
BOTH tom and sam start pinging a web server every minute.
When the ping is received a "session id" "user" "time stamp" is saved on the server.
Every 30 min a cron checks the matching time between student/teacher and record the session duration in a more appropriate way.