mirror of
https://github.com/moodle/moodle.git
synced 2025-02-22 02:49:53 +01:00
34 lines
614 B
Plaintext
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--;
|
|
}
|
|
|