Skip to content

Commit

Permalink
MDL-81514 assign: Enable filtering by non-participation groups
Browse files Browse the repository at this point in the history
This adds non-participation groups to the group menu on the Submissions
screen, so that submissions can be filtered by these groups.
  • Loading branch information
marxjohnson committed May 21, 2024
1 parent 93aceed commit 7e401d8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mod/assign/gradingtable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion mod/assign/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
31 changes: 30 additions & 1 deletion mod/assign/tests/behat/group_submission.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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"

0 comments on commit 7e401d8

Please sign in to comment.