Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / mod / quiz / jstimer.php
blobadc64340256db4e564c32ebe29b4de4f69888bff
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 type="text/javascript">
10 //<![CDATA[
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);
16 // @EC PF : client time when page was opened
17 var ec_page_start = new Date().getTime();
18 // @EC PF : client time when quiz should end
19 var ec_quiz_finish = ec_page_start + <?php echo ($timerstartvalue * 1000); ?>;
21 //]]>
22 </script>
23 <script type="text/javascript" src="timer.js"></script>
24 <div id="timer">
25 <!--EDIT BELOW CODE TO YOUR OWN MENU-->
26 <table class="generalbox" border="0" cellpadding="0" cellspacing="0" style="width:150px;">
27 <tr>
28 <td class="generalboxcontent" bgcolor="#ffffff" width="100%">
29 <table class="generaltable" border="0" width="150" cellspacing="0" cellpadding="0">
30 <tr>
31 <th class="generaltableheader" width="100%" scope="col"><?php print_string("timeleft","quiz");?></th>
32 </tr>
33 <tr>
34 <td id="QuizTimer" class="generaltablecell" align="center" width="100%">
35 <form id="clock"><div><input onfocus="blur()" type="text" id="time"
36 style="background-color: transparent; border: none; width: 70%; font-family: sans-serif; font-size: 14pt; font-weight: bold; text-align: center;" />
37 </div>
38 </form>
39 </td>
40 </tr>
41 </table>
42 </td>
43 </tr>
44 </table>
45 <!--END OF EDIT-->
46 </div>
47 <script type="text/javascript">
48 //<![CDATA[
50 var timerbox = document.getElementById('timer');
51 var theTimer = document.getElementById('QuizTimer');
52 var theTop = 100;
53 var old = theTop;
55 movecounter(timerbox);
57 document.onload = countdown_clock(theTimer);
58 //]]>
59 </script>