Merge branch 'MDL-32740' of git://github.com/timhunt/moodle
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user