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 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
);
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); ?
>;
23 <script type
="text/javascript" src
="timer.js"></script
>
25 <!--EDIT BELOW CODE TO YOUR OWN MENU
-->
26 <table
class="generalbox" border
="0" cellpadding
="0" cellspacing
="0" style
="width:150px;">
28 <td
class="generalboxcontent" bgcolor
="#ffffff" width
="100%">
29 <table
class="generaltable" border
="0" width
="150" cellspacing
="0" cellpadding
="0">
31 <th
class="generaltableheader" width
="100%" scope
="col"><?php
print_string("timeleft","quiz");?
></th
>
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;" />
47 <script type
="text/javascript">
50 var timerbox
= document
.getElementById('timer');
51 var theTimer
= document
.getElementById('QuizTimer');
55 movecounter(timerbox
);
57 document
.onload
= countdown_clock(theTimer
);