file ongoing.html was added on branch MOODLE_15_STABLE on 2005-07-07 16:14:36 +0000
[moodle.git] / mod / quiz / jstimer.php
blob031d38cf7052f0fa59b8cc8a79114533bf84fdb3
1 <?php // $Id$
2 // QuizTimer main routines.
3 // This will produce a floating timer that counts
4 // how much time is left to answer the quiz.
5 //
6 defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
7 ?>
9 <script language="javascript" type="text/javascript">
10 <!--
11 var timesup = "<?php print_string("timesup","quiz");?>";
12 var quizclose = <?php echo ($quiz->timeclose - time()) - $timerstartvalue; ?>; // in seconds
13 var quizTimerValue = <?php echo $timerstartvalue; ?>; // in seconds
14 parseInt(quizTimerValue);
15 // -->
16 </script>
17 <script language="javascript" type="text/javascript" src="timer.js"></script>
18 <div id="timer" style="position: absolute; top: 100; left: 10;">
19 <!--EDIT BELOW CODE TO YOUR OWN MENU-->
20 <table class="generalbox" border="0" cellpadding="0" cellspacing="0" width="150">
21 <tr>
22 <td class="generalboxcontent" bgcolor="#ffffff" width="100%">
23 <table class="generaltable" border="0" width="150" cellspacing="0" cellpadding="0">
24 <tr>
25 <th class="generaltableheader" width="100%"><?php print_string("timeleft","quiz");?></th>
26 </tr>
27 <tr>
28 <td id="QuizTimer" class="generaltablecell" align="center" width="100%">
29 <form name="clock"><input onfocus="blur()" type="text" name="time"
30 style="background-color: transparent; border: none; width: 70%; font-family: sans-serif; font-size: 14pt; font-weight: bold; text-align: center;" />
31 </form>
32 </td>
33 </tr>
34 </table>
35 </td>
36 </tr>
37 </table>
38 <!--END OF EDIT-->
39 </div>
40 <script language="javascript" type="text/javascript">
41 <!--
42 function changecolor(col) {
43 // Changes the timers background color
44 var d = document.getElementById('QuizTimer');
45 d.style.backgroundColor = col;
48 var timerbox = getObjectById('timer');
49 var theTop = 100;
50 var old = theTop;
51 movecounter(this);
53 document.onload = countdown_clock();
54 // -->
55 </script>