I am not a developer but you might like to expore this course dedication block.
General developer forum
Block which keeps track of time a user is in course
This discussion has been locked so you can no longer reply to it.