MDL-32740 / MDL-3030 quiz summary: no Return to attempt for overdue.

This commit is contained in:
Tim Hunt 2012-05-03 12:16:43 +01:00
parent 1619a38b9b
commit 96e5168c7e
2 changed files with 8 additions and 4 deletions

View File

@ -646,6 +646,7 @@ class quiz_attempt {
return $this->attempt->attempt;
}
/** @return string one of the quiz_attempt::IN_PROGRESS, FINISHED, OVERDUE or ABANDONED constants. */
public function get_state() {
return $this->attempt->state;
}

View File

@ -615,10 +615,13 @@ class mod_quiz_renderer extends plugin_renderer_base {
$output = '';
// Return to place button
$button = new single_button(
new moodle_url($attemptobj->attempt_url(null, $attemptobj->get_currentpage())), get_string('returnattempt', 'quiz'));
$output .= $this->container($this->container($this->render($button),
'controls'), 'submitbtns mdl-align');
if ($attemptobj->get_state() == quiz_attempt::IN_PROGRESS) {
$button = new single_button(
new moodle_url($attemptobj->attempt_url(null, $attemptobj->get_currentpage())),
get_string('returnattempt', 'quiz'));
$output .= $this->container($this->container($this->render($button),
'controls'), 'submitbtns mdl-align');
}
// Finish attempt button.
$options = array(