mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-32740 / MDL-3030 quiz summary: no Return to attempt for overdue.
This commit is contained in:
parent
1619a38b9b
commit
96e5168c7e
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user