Block which keeps track of time a user is in course

Block which keeps track of time a user is in course

by James Kinsman -
Number of replies: 1
I need a block that keeps track of how long a user is in a course,
And then after a periodic amount of time (that the user is in the course), pop up a question.

How can I code a new block which only works while a user is in a course.

Then I can keep track of start time and page reload times in order to track time.

Average of ratings: -