Merge branch 'MDL-78984' of https://github.com/paulholden/moodle
This commit is contained in:
@@ -131,7 +131,8 @@ class user_submission_actionmenu implements templatable, renderable {
|
||||
}
|
||||
if ($status === ASSIGN_SUBMISSION_STATUS_NEW) {
|
||||
|
||||
if ($this->timelimit && empty($this->submission->timestarted)) {
|
||||
$timelimitenabled = get_config('assign', 'enabletimelimit');
|
||||
if ($timelimitenabled && $this->timelimit && empty($this->submission->timestarted)) {
|
||||
$confirmation = new \confirm_action(
|
||||
get_string('confirmstart', 'assign', format_time($this->timelimit)),
|
||||
null,
|
||||
|
||||
@@ -263,9 +263,12 @@ class assign_override_form extends moodleform {
|
||||
}
|
||||
|
||||
// Time limit.
|
||||
$mform->addElement('duration', 'timelimit',
|
||||
get_string('timelimit', 'assign'), array('optional' => true));
|
||||
$mform->setDefault('timelimit', $assigninstance->timelimit);
|
||||
$timelimitenabled = get_config('assign', 'enabletimelimit');
|
||||
if ($timelimitenabled) {
|
||||
$mform->addElement('duration', 'timelimit',
|
||||
get_string('timelimit', 'assign'), array('optional' => true));
|
||||
$mform->setDefault('timelimit', $assigninstance->timelimit);
|
||||
}
|
||||
|
||||
// Submit buttons.
|
||||
$mform->addElement('submit', 'resetbutton',
|
||||
@@ -344,7 +347,7 @@ class assign_override_form extends moodleform {
|
||||
$changed = false;
|
||||
$keys = array('duedate', 'cutoffdate', 'allowsubmissionsfromdate', 'timelimit');
|
||||
foreach ($keys as $key) {
|
||||
if ($data[$key] != $assigninstance->{$key}) {
|
||||
if (isset($data[$key]) && $data[$key] != $assigninstance->{$key}) {
|
||||
$changed = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ if ($mform->is_cancelled()) {
|
||||
|
||||
// Replace unchanged values with null.
|
||||
foreach ($keys as $key) {
|
||||
if (($fromform->{$key} == $assigninstance->{$key})) {
|
||||
if (!isset($fromform->{$key}) || $fromform->{$key} == $assigninstance->{$key}) {
|
||||
$fromform->{$key} = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,7 +211,8 @@ foreach ($overrides as $override) {
|
||||
}
|
||||
|
||||
// Format timelimit.
|
||||
if (isset($override->timelimit)) {
|
||||
$timelimitenabled = get_config('assign', 'enabletimelimit');
|
||||
if ($timelimitenabled && isset($override->timelimit)) {
|
||||
$fields[] = get_string('timelimit', 'assign');
|
||||
$values[] = $override->timelimit > 0 ? format_time($override->timelimit) : get_string('none', 'assign');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user