Merge branch 'MDL-86648-500' of https://github.com/paulholden/moodle into MOODLE_500_STABLE

This commit is contained in:
Andrew Nicols
2025-10-16 13:15:20 +08:00
2 changed files with 28 additions and 2 deletions
+4 -2
View File
@@ -40,7 +40,7 @@ class assign_override_form extends moodleform {
/** @var object course module object. */
protected $cm;
/** @var object the assign settings object. */
/** @var assign the assign settings object. */
protected $assign;
/** @var context the assign context. */
@@ -229,8 +229,10 @@ class assign_override_form extends moodleform {
}
}
// Determine users from which we will calculate maximum extension due date (those from current group plus selected user).
$users = $DB->get_fieldset_select('groups_members', 'userid', 'groupid = ?', array($this->groupid));
array_push($users, $this->userid);
array_push($users, $userid);
$extensionmax = 0;
foreach ($users as $value) {
$extension = $DB->get_record('assign_user_flags', array('assignment' => $assigninstance->id,
@@ -82,6 +82,30 @@ Feature: Assign user override
And I am on the "Test assignment name" Activity page logged in as student1
And the activity date in "Test assignment name" should contain "Due: Wednesday, 1 January 2020, 8:00"
@javascript
Scenario: Ensure an overridden due date is before any extension date
Given I am on the "Test assignment name" Activity page logged in as teacher1
When I navigate to "Settings" in current page administration
And I set the field "Due date" to "##1 Jan 2000 08:00##"
And I press "Save and display"
And I navigate to "Submissions" in current page administration
And I open the action menu in "Student1" "table_row"
And I follow "Grant extension"
And I set the field "Extension due date" to "##3 Jan 2000 08:00##"
And I press "Save changes"
And I navigate to "Overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| Due date | ##4 Jan 2000 08:00## |
And I press "Save"
Then I should see "Extension date must be after the due date"
And I set the field "Due date" to "##2 Jan 2000 08:00##"
And I press "Save"
And the following should exist in the "generaltable" table:
| User | Overrides | -3- |
| Sam1 Student1 | Due date | Sunday, 2 January 2000, 8:00 |
@javascript
Scenario: Allow a user to have a different cut off date
Given I am on the "Test assignment name" Activity page logged in as teacher1