2 // QuizTimer main routines.
3 // This will produce a floating timer that counts
4 // how much time is left to answer the quiz.
6 defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
9 <script language
="javascript" type
="text/javascript">
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
);
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">
22 <td
class="generalboxcontent" bgcolor
="#ffffff" width
="100%">
23 <table
class="generaltable" border
="0" width
="150" cellspacing
="0" cellpadding
="0">
25 <th
class="generaltableheader" width
="100%"><?php
print_string("timeleft","quiz");?
></th
>
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;" />
40 <script language
="javascript" type
="text/javascript">
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');
53 document
.onload
= countdown_clock();