From 8406ac6e9bb119d0a0d305d6e9dd85885cfa27c1 Mon Sep 17 00:00:00 2001 From: Pavel Sokolov Date: Thu, 30 Mar 2017 11:07:29 +0300 Subject: [PATCH] MDL-58104 mod_assign: Show attempt settings for the latest attempt --- mod/assign/locallib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index aec06e8f61e..8ff2c778cac 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -7191,7 +7191,9 @@ class assign { } // Do not show if we are editing a previous attempt. - if ($attemptnumber == -1 && $this->get_instance()->attemptreopenmethod != ASSIGN_ATTEMPT_REOPEN_METHOD_NONE) { + if (($attemptnumber == -1 || + ($attemptnumber + 1) == count($this->get_all_submissions($userid))) && + $this->get_instance()->attemptreopenmethod != ASSIGN_ATTEMPT_REOPEN_METHOD_NONE) { $mform->addElement('header', 'attemptsettings', get_string('attemptsettings', 'assign')); $attemptreopenmethod = get_string('attemptreopenmethod_' . $this->get_instance()->attemptreopenmethod, 'assign'); $mform->addElement('static', 'attemptreopenmethod', get_string('attemptreopenmethod', 'assign'), $attemptreopenmethod);