MDL-81514 assign: Enable filtering by non-participation groups

This adds non-participation groups to the group menu on the Submissions
screen, so that submissions can be filtered by these groups.
This commit is contained in:
Mark Johnson
2025-10-15 11:00:56 +08:00
committed by Mihail Geshoski
parent a9ea34dc3f
commit 6cec07a34e
3 changed files with 39 additions and 3 deletions
@@ -146,7 +146,7 @@ class grading_actionmenu implements templatable, renderable {
$data['initialselector'] = $initialselector->export_for_template($output);
if (groups_get_activity_groupmode($cm, $course)) {
$gs = new group_selector($PAGE->context);
$gs = new group_selector($PAGE->context, false);
$data['groupselector'] = $gs->export_for_template($output);
}
+1 -1
View File
@@ -109,7 +109,7 @@ class assign_grading_table extends table_sql implements renderable {
$this->define_baseurl($url);
// Do some business - then set the sql.
$currentgroup = groups_get_activity_group($assignment->get_course_module(), true);
$currentgroup = groups_get_activity_group($assignment->get_course_module(), true, participationonly: false);
if ($rowoffset) {
$this->rownum = $rowoffset - 1;
@@ -369,7 +369,7 @@ Feature: Group assignment submissions
And I should see "Submitted for grading" in the "Submission status" "table_row"
And I should not see "Users who need to submit"
Scenario: Group submission does not use non-participation groups
Scenario: Students cannot make a group submission under a non-participation group
Given the following "groups" exist:
| name | course | idnumber | participation |
| Group A | C1 | CG1 | 0 |
@@ -386,3 +386,39 @@ Feature: Group assignment submissions
When I am on the "Test assignment name" Activity page logged in as student1
Then I should see "Default group"
And I should not see "Group A"
@javascript
Scenario: All groups including non-participation groups can be used for filtering submissions
Given the following "groups" exist:
| name | course | idnumber | participation | visibility |
| Group 2 | C1 | G2 | 0 | 0 |
| Group 3 | C1 | G3 | 0 | 3 |
And the following "group members" exist:
| group | user |
| G1 | student1 |
| G2 | student1 |
| G1 | student2 |
| G2 | student3 |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| name | Test assignment name |
| submissiondrafts | 0 |
| teamsubmission | 1 |
| groupmode | 1 |
And the following "mod_assign > submissions" exist:
| assign | user | onlinetext |
| Test assignment name | student1 | I'm the student's first submission |
| Test assignment name | student3 | I'm the student's first submission |
When I am on the "Test assignment name" Activity page logged in as teacher1
And I follow "Submissions"
And I confirm "Group 1" exists in the "Search groups" search combo box
And I confirm "Group 2" exists in the "Search groups" search combo box
And I confirm "Group 3" exists in the "Search groups" search combo box
And I should not see "Non-participation" in the "Group 1" "list_item"
And I should see "Non-participation" in the "Group 2" "list_item"
And I should see "Non-participation" in the "Group 3" "list_item"
And I click on "Group 2" in the "Search groups" search combo box
Then I should see "Student 1"
And I should see "Student 3"
And I should not see "Student 2"