Please use the code for the countdown, remove that part
// Is the time up?
if (remain <= 0) {
remain = 0;
// Stop the timer
window.clearInterval(timerInterval);
// Display a message (optional)
alert(„The time is up.“);
// Redirect the participant to the next page (optional)
SoSciTools.submitPage();
}
change timeLeft
so that the questionnaire provides the time when the timer started, that is in PHP code
// Save the start time into the variable $timestart
if (!isset($timestart)) {
$timestart = time();
registerVariable($timestart);
}
this together with that
// JavaScript to display timer
$timeGone = time() - $timestart;
// Instead of JS01 the identifier of the text must be entered here
show('JS01', array(
'%timeGone%' => $timeGone
));
And back in the JavaScript
var timeGone = %timeGone%;
...
var remain = timeGone + timePage;
You can rename "remain" throughout the script, but technically that should be it.