Permalink
Browse files

Trying to fix Safari bug (NaN).

  • Loading branch information...
julmis
julmis committed Jun 3, 2004
1 parent 6f4d8ec commit b15f577dad10f8868d338b428cdc59afffa10668
Showing with 6 additions and 2 deletions.
  1. +1 −0 mod/quiz/jstimer.php
  2. +5 −2 mod/quiz/timer.js
View
@@ -10,6 +10,7 @@
var timesup = "<?php print_string("timesup","quiz");?>";
var quizclose = <?php echo ($quiz->timeclose - time()) - $timerstartvalue; ?>; // in seconds
var quizTimerValue = <? echo $timerstartvalue; ?>; // in seconds
+parseInt(quizTimerValue);
// -->
</script>
<script language="javascript" type="text/javascript" src="timer.js"></script>
View
@@ -16,23 +16,26 @@ function countdown_clock() {
now = quizTimerValue;
var hours = Math.floor( now / 3600 );
+ parseInt(hours);
now = now - (hours * 3600);
var minutes = Math.floor(now / 60);
+ parseInt(minutes);
now = now - (minutes * 60);
var seconds = now;
+ parseInt(seconds);
var t = "" + hours;
t += ((minutes < 10) ? ":0" : ":") + minutes;
t += ((seconds < 10) ? ":0" : ":") + seconds;
- window.status = t;
+ window.status = t.toString();
if(hours == 0 && minutes == 0 && seconds <= 15) {
//go from fff0f0 to ffe0e0 to ffd0d0...ff2020, ff1010, ff0000 in 15 steps
var hexascii = "0123456789ABCDEF";
var col = 'ff' + hexascii.charAt(seconds) + '0' + hexascii.charAt(seconds) + 0;
changecolor(col);
}
- document.forms['clock'].time.value = t;
+ document.forms['clock'].time.value = t.toString();
timeout_id = setTimeout("countdown_clock()", 1000);
}

0 comments on commit b15f577

Please sign in to comment.