Merge branch 'MDL-32740' of git://github.com/timhunt/moodle

This commit is contained in:
Dan Poltawski
2012-05-04 00:58:00 +08:00
2 changed files with 8 additions and 4 deletions
+1
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;
}
+7 -4
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(