diff --git a/mod/assign/gradingtable.php b/mod/assign/gradingtable.php index bbb0af951d4a6..1c0581ae9bd31 100644 --- a/mod/assign/gradingtable.php +++ b/mod/assign/gradingtable.php @@ -118,7 +118,7 @@ public function __construct(assign $assignment, $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; diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 88a310be431ce..9b8cc0f58b7ee 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -4567,7 +4567,7 @@ protected function view_grading_table() { $o .= $this->get_renderer()->heading(get_string('gradeitem:submissions', 'mod_assign'), 2); $o .= $this->get_renderer()->render($gradingactions); - $o .= groups_print_activity_menu($this->get_course_module(), $currenturl, true); + $o .= groups_print_activity_menu($this->get_course_module(), $currenturl, true, participationonly: false); // Plagiarism update status apearring in the grading book. if (!empty($CFG->enableplagiarism)) { diff --git a/mod/assign/tests/behat/group_submission.feature b/mod/assign/tests/behat/group_submission.feature index 2376fc0defcfa..8a3517e0c0e35 100644 --- a/mod/assign/tests/behat/group_submission.feature +++ b/mod/assign/tests/behat/group_submission.feature @@ -325,7 +325,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 | @@ -342,3 +342,32 @@ 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 | + | Group 2 | C1 | G2 | 0 | + 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 "View all submissions" + And I set the field "Separate groups" to "Group 2" + Then I should see "Student 1" + And I should see "Student 3" + And I should not see "Student 2"