MDL-68093 assign: Restrict group submission to participation groups

This commit is contained in:
Mark Johnson
2023-03-14 08:52:26 +00:00
parent cab6e97c1f
commit 0775756551
3 changed files with 32 additions and 2 deletions
+1 -1
View File
@@ -3345,7 +3345,7 @@ class assign {
}
$grouping = $this->get_instance()->teamsubmissiongroupingid;
$return = groups_get_all_groups($this->get_course()->id, $userid, $grouping);
$return = groups_get_all_groups($this->get_course()->id, $userid, $grouping, 'g.*', false, true);
$this->usergroups[$userid] = $return;
+1 -1
View File
@@ -128,7 +128,7 @@ class assign_override_form extends moodleform {
$groupchoices = array();
foreach ($groups as $group) {
if ($group->visibility != \core_group\visibility::NONE) {
if ($group->visibility != GROUPS_VISIBILITY_NONE) {
$groupchoices[$group->id] = format_string($group->name, true, $this->context);
}
}
@@ -385,3 +385,33 @@ Feature: Group assignment submissions
And I am on the "Assign 2" "assign activity" page logged in as student2
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
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student0@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "groups" exist:
| name | course | idnumber | participation |
| Group 1 | C1 | G1 | 0 |
And the following "group members" exist:
| group | user |
| G1 | student1 |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| name | Test assignment name |
| intro | Test assignment description |
| submissiondrafts | 0 |
| teamsubmission | 1 |
| groupmode | 1 |
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 1"