]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18521 Countdown timer should be visible on the summary page
authortjhunt <tjhunt>
Wed, 11 Mar 2009 07:10:57 +0000 (07:10 +0000)
committertjhunt <tjhunt>
Wed, 11 Mar 2009 07:10:57 +0000 (07:10 +0000)
mod/quiz/attemptlib.php
mod/quiz/quiz.js
mod/quiz/summary.php
theme/standard/styles_layout.css

index 4348c4175209ba931baa7a5859d0b0396fa8cfc4..e2de8346b96c2cdc958edd9c3c997ca5c5c202ef 100644 (file)
@@ -675,6 +675,11 @@ class quiz_attempt extends quiz {
         echo '</div>';
     }
 
+    public function get_timer_html() {
+        return '<div id="quiz-timer">' . get_string('timeleft', 'quiz') .
+                ' <span id="quiz-time-left"></span></div>';
+    }
+
     /**
      * Wrapper round print_question from lib/questionlib.php.
      *
@@ -968,8 +973,7 @@ class quiz_attempt_nav_panel extends quiz_nav_panel_base {
         $output = '';
         $output .= '<input type="submit" name="gotosummary" value="' .
                 get_string('endtest', 'quiz') . '" class="endtestlink" />';
-        $output .= '<div id="quiz-timer">' . get_string('timeleft', 'quiz') .
-                ' <span id="quiz-time-left"></span></div>';
+        $output .= $this->attemptobj->get_timer_html();
         return $output;
     }
 }
index adb3a074a223b5c6daa46d852640da2f18529f19..8d45dddb6b6ab22fe5dd118f69fc97efc0c461e0 100644 (file)
@@ -121,7 +121,7 @@ quiz_timer = {
         if (secondsleft < 0) {
             quiz_timer.stop();
             quiz_timer.set_displayed_time(quiz_timer.strtimeup);
-            document.getElementById('timeup').value = 1;
+            quiz_timer.quizform.elements.timeup.value = 1;
             if (quiz_timer.quizform.onsubmit) {
                 quiz_timer.quizform.onsubmit();
             }
index 0c30313ef62f7030ff33bcd98b77fe4a073874ba..e9e67e24e09e7da0018636a6aaf4adf1196ac8c5 100644 (file)
@@ -102,6 +102,9 @@ foreach ($attemptobj->get_question_iterator() as $number => $question) {
 /// Print the summary table.
 print_table($table);
 
+/// countdown timer
+echo $attemptobj->get_timer_html();
+
 /// Finish attempt button.
 echo "<div class=\"submitbtns mdl-align\">\n";
 $options = array(
@@ -112,7 +115,7 @@ $options = array(
     'sesskey' => sesskey(),
 );
 print_single_button($attemptobj->processattempt_url(), $options, get_string('finishattempt', 'quiz'),
-        'post', '', false, '', false, get_string('confirmclose', 'quiz'));
+        'post', '', false, '', false, get_string('confirmclose', 'quiz'), 'responseform');
 echo "</div>\n";
 
 /// Finish the page
index 333c39ecc0631b766cc07565ee13e0e4b6185448..306943a7ecb3f980ff579bb41e1f7689347832b4 100644 (file)
@@ -4333,6 +4333,7 @@ body#mod-forum-search .introcontent {
   text-align: left;
   margin-top: 1.5em;
 }
+#mod-quiz-summary #quiz-timer,
 #mod-quiz-summary .submitbtns {
   margin-top: 1.5em;
 }
@@ -4344,10 +4345,11 @@ body#mod-forum-search .introcontent {
   height: 16px;
   vertical-align: middle;
 }
+#mod-quiz-summary #quiz-timer,
 #mod-quiz-attempt #quiz-timer {
-  display: none;
+    display: none;
 }
-#mod-quiz-attempt #quiz-time-left {
+#quiz-timer #quiz-time-left {
   font-weight: bold;
 }