I was shown the code below by another expert, and it's worked wonderfully for the parts where i needed to just send the time spent on one page to the database.
However, there are a few pages where it would be easiest that it keeps the time over a number of pages. I have a learning section for this module/quiz where there are different pages of information they can review before taking the test questions. I want to know how long they spend looking at those pages, they can move freely between the 5 pages until they click the finished link in the navigation.
Is there a way to accomplish what i'm looking to do? Thanks for any help.
var currentTime = new Date();
var startTime = currentTime.getTime();
var endTime = new Date();
var elapsedTime = (endTime.getTime() - startTime);
form1.elapsedTime.value = elapsedTime;
<form id=form1 target=_blank>
<input type=hidden name=elapsedTime>
<input type=submit onclick="getElapsedTime()">