2 Feature: Submit assignment without group
4 I should be able to prevent students submitting team assignments as members of the default group
7 Scenario: Switch between group modes
8 Given the following "courses" exist:
9 | fullname | shortname | category | groupmode |
10 | Course 1 | C1 | 0 | 1 |
11 | Course 2 | C2 | 0 | 1 |
12 And the following "activities" exist:
13 | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | preventsubmissionnotingroup | teamsubmission |
14 | assign | C1 | assign1 | Allow default group | Test assignment description | 1 | 0 | 1 |
15 | assign | C1 | assign2 | Require group membership | Test assignment description | 1 | 1 | 1 |
16 | assign | C2 | assign2 | Require group membership | Test assignment description | 1 | 1 | 1 |
17 And the following "users" exist:
18 | username | firstname | lastname | email |
19 | teacher1 | Teacher | 1 | teacher1@asd.com |
20 | student1 | Student | 1 | student1@asd.com |
21 | student2 | Student | 2 | student2@asd.com |
22 And the following "groups" exist:
23 | name | course | idnumber |
25 And the following "course enrolments" exist:
26 | user | course | role |
27 | teacher1 | C1 | editingteacher |
28 | student1 | C1 | student |
29 | student2 | C1 | student |
30 | teacher1 | C2 | editingteacher |
31 | student1 | C2 | student |
32 | student2 | C2 | student |
34 And I log in as "teacher1"
35 And I follow "Course 2"
36 And I expand "Users" node
38 And I add "Student 1 (student1@asd.com)" user to "Group 1" group members
39 And I add "Student 2 (student2@asd.com)" user to "Group 1" group members
42 When I log in as "student1"
43 And I follow "Course 1"
44 And I follow "Allow default group"
45 Then I should not see "You're not a member of any group, please contact your teacher."
46 And I should see "Nothing has been submitted for this assignment"
47 And I press "Add submission"
48 And I set the following fields to these values:
49 | Online text | I'm the student submission |
50 And I press "Save changes"
51 And I press "Submit assignment"
52 And I press "Continue"
53 Then I should see "Submitted for grading"
55 And I follow "Course 1"
56 And I follow "Require group membership"
57 Then I should see "You're not a member of any group, please contact your teacher."
58 And I should see "Nothing has been submitted for this assignment"
59 And I should not see "Add submission"
62 And I follow "Course 2"
63 And I follow "Require group membership"
64 Then I should not see "You're not a member of any group, please contact your teacher."
65 And I should see "Nothing has been submitted for this assignment"
66 And I press "Add submission"
67 And I set the following fields to these values:
68 | Online text | I'm the student submission |
69 And I press "Save changes"
70 And I press "Submit assignment"
71 And I press "Continue"
72 Then I should see "Submitted for grading"
75 When I log in as "student2"
76 And I follow "Course 1"
77 And I follow "Allow default group"
78 Then I should see "Submitted for grading"
81 And I follow "Course 2"
82 And I follow "Require group membership"
83 Then I should see "Submitted for grading"
86 And I log in as "teacher1"
87 And I follow "Course 1"
89 And I follow "Allow default group"
90 And I should see "1" in the "Groups" "table_row"
91 And I should not see "The setting 'Require group to make submission' is turned on and some users are not allocated to groups, this will prevent them from submitting assignments."
92 And I follow "View/grade all submissions"
93 And I should see "Default group" in the "Student 1" "table_row"
94 And I should see "Default group" in the "Student 2" "table_row"
95 And I should see "Submitted for grading" in the "Student 1" "table_row"
96 And I should see "Submitted for grading" in the "Student 2" "table_row"
99 And I follow "Course 1"
100 And I follow "Require group membership"
101 And I should see "0" in the "Groups" "table_row"
102 And I should see "The setting 'Require group to make submission' is turned on and some users are not allocated to groups, this will prevent them from submitting assignments."
103 And I follow "View/grade all submissions"
104 And I should see "Default group" in the "Student 1" "table_row"
105 And I should see "Default group" in the "Student 2" "table_row"
106 And I should not see "Submitted for grading" in the "Student 1" "table_row"
107 And I should not see "Submitted for grading" in the "Student 2" "table_row"
110 And I follow "Course 2"
112 And I follow "Require group membership"
113 And I should see "1" in the "Groups" "table_row"
114 And I should not see "The setting 'Require group to make submission' is turned on and some users are not allocated to groups, this will prevent them from submitting assignments."
115 And I follow "View/grade all submissions"
116 And I should see "Group 1" in the "Student 1" "table_row"
117 And I should see "Group 1" in the "Student 2" "table_row"
118 And I should see "Submitted for grading" in the "Student 1" "table_row"
119 And I should see "Submitted for grading" in the "Student 2" "table_row"