MDL-18521 Countdown timer should be visible on the summary page
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user