From 86ccf19cdbaf8e33d4a4e23672a78a15011d11c7 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 11 Apr 2007 20:07:36 +0000 Subject: [PATCH] MDL-9280 - JavaScript countdown timer did not work in 1.8 due to XHTML strict changes. Also, fixing a few more XHTML strrrrict things in attempt.php. Merged from MOODLE_18_STABLE. --- mod/quiz/attempt.php | 15 +++++---------- mod/quiz/jstimer.php | 4 ++-- mod/quiz/timer.js | 37 ++++++++++--------------------------- 3 files changed, 17 insertions(+), 39 deletions(-) diff --git a/mod/quiz/attempt.php b/mod/quiz/attempt.php index b98d0c89a3c..583f0762fc9 100644 --- a/mod/quiz/attempt.php +++ b/mod/quiz/attempt.php @@ -429,14 +429,12 @@ } } - // Start the form + echo "
\n"; if($quiz->timelimit > 0) { // Make sure javascript is enabled for time limited quizzes ?> \n"; } // Add a hidden field with the quiz id @@ -502,7 +498,7 @@ echo "\n"; } echo "\n"; - echo ''; + echo ''; echo ""; @@ -522,11 +518,10 @@ // For teachers ignore the quiz closing time $secondsleft = 999999999999; } + // If time limit is set include floating timer. // MDL-7495, no timer for users with disability - - if ($quiz->timelimit > 0 && !has_capability('mod/quiz:ignoretimelimits', $context)) { - + if ($quiz->timelimit > 0 && !has_capability('mod/quiz:ignoretimelimits', $context, NULL, false)) { $timesincestart = time() - $attempt->timestart; $timerstartvalue = min($quiz->timelimit*60 - $timesincestart, $secondsleft); if ($timerstartvalue <= 0) { diff --git a/mod/quiz/jstimer.php b/mod/quiz/jstimer.php index 2785f35c0e7..adc64340256 100644 --- a/mod/quiz/jstimer.php +++ b/mod/quiz/jstimer.php @@ -47,8 +47,8 @@ var ec_quiz_finish = ec_page_start + ;