I need to track the total time the student spend viewing his course pages, after logging, I am using devise gem.
I can store the DateTime.Now when the student starts watching a course, but, I have the following challenges to beat:
the student might open another window tab, leaving the course webpage, how can I pause time tracking while the student not viewing the course webpage, and resume tracking when he return?
to recognizing the student being idle for a certain time ? ( doing nothing or even minimize the browser )
Any hint or help will be more than appreciated, is there a specific gem or jQuery plugin that can make the task easier ? or a recommend approach ?