moodle/mod/hotpot/v6/source/hp6timer.js_

34 lines
614 B
Plaintext

//CODE FOR HANDLING TIMER
//Timer code
var Seconds = [intSeconds];
var Interval = null;
function StartTimer(){
Interval = window.setInterval('DownTime()',1000);
document.getElementById('TimerText').style.display = 'inline';
}
function DownTime(){
var ss = Seconds % 60;
if (ss<10){
ss='0' + ss + '';
}
var mm = Math.floor(Seconds / 60);
if (document.getElementById('Timer') == null){
return;
}
document.getElementById('TimerText').innerHTML = mm + ':' + ss;
if (Seconds < 1){
window.clearInterval(Interval);
TimeOver = true;
TimesUp();
}
Seconds--;
}