| 1 | efrain | 1 | @mod @mod_forum @core_grades
 | 
        
           |  |  | 2 | Feature: I can grade a students by group with separate groups
 | 
        
           |  |  | 3 |   In order to assess a student's contributions
 | 
        
           |  |  | 4 |   As a teacher
 | 
        
           |  |  | 5 |   I can assign grades to a student based on their separate groups
 | 
        
           |  |  | 6 |   | 
        
           |  |  | 7 |   Background:
 | 
        
           |  |  | 8 |     Given the following "users" exist:
 | 
        
           |  |  | 9 |       | username | firstname | lastname | email |
 | 
        
           |  |  | 10 |       | teacher1 | Teacher | 1 | teacher1@example.com |
 | 
        
           |  |  | 11 |       | student1 | Student | 1 | student1@example.com |
 | 
        
           |  |  | 12 |       | student2 | Student | 2 | student2@example.com |
 | 
        
           |  |  | 13 |       | student3 | Student | 3 | student3@example.com |
 | 
        
           |  |  | 14 |     And the following "courses" exist:
 | 
        
           |  |  | 15 |       | fullname | shortname | category |
 | 
        
           |  |  | 16 |       | Course 1 | C1 | 0 |
 | 
        
           |  |  | 17 |     And the following "course enrolments" exist:
 | 
        
           |  |  | 18 |       | user | course | role |
 | 
        
           |  |  | 19 |       | teacher1 | C1 | editingteacher |
 | 
        
           |  |  | 20 |       | student1 | C1 | student |
 | 
        
           |  |  | 21 |       | student2 | C1 | student |
 | 
        
           |  |  | 22 |       | student3 | C1 | student |
 | 
        
           |  |  | 23 |     And the following "groups" exist:
 | 
        
           |  |  | 24 |       | name | course | idnumber |
 | 
        
           |  |  | 25 |       | Group A | C1 | G1 |
 | 
        
           |  |  | 26 |       | Group B | C1 | G2 |
 | 
        
           |  |  | 27 |       | Group C | C1 | G3 |
 | 
        
           |  |  | 28 |     And the following "group members" exist:
 | 
        
           |  |  | 29 |       | user | group |
 | 
        
           |  |  | 30 |       | student1 | G1 |
 | 
        
           |  |  | 31 |       | student2 | G2 |
 | 
        
           |  |  | 32 |       | student1 | G3 |
 | 
        
           |  |  | 33 |       | student2 | G3 |
 | 
        
           |  |  | 34 |       | student3 | G3 |
 | 
        
           |  |  | 35 |     And the following "activity" exists:
 | 
        
           |  |  | 36 |       | activity | forum        |
 | 
        
           |  |  | 37 |       | course   | C1           |
 | 
        
           |  |  | 38 |       | name     | Test Forum 1 |
 | 
        
           |  |  | 39 |     And I log in as "teacher1"
 | 
        
           |  |  | 40 |     And I am on "Course 1" course homepage with editing mode on
 | 
        
           |  |  | 41 |     And I am on the "Test Forum 1" "forum activity editing" page
 | 
        
           |  |  | 42 |     And I expand all fieldsets
 | 
        
           |  |  | 43 |     And I set the following fields to these values:
 | 
        
           |  |  | 44 |       | Forum name | Test Forum 1 |
 | 
        
           |  |  | 45 |       | Description | Test |
 | 
        
           |  |  | 46 |     And I set the field "Whole forum grading > Type" to "Point"
 | 
        
           |  |  | 47 |     And I set the field "Common module settings > Group mode" to "Separate groups"
 | 
        
           |  |  | 48 |     And I press "Save and display"
 | 
        
           |  |  | 49 |   | 
        
           |  |  | 50 |   @javascript
 | 
        
           |  |  | 51 |   Scenario: Grade users by group A
 | 
        
           |  |  | 52 |     When I select "Group A" from the "Separate groups" singleselect
 | 
        
           |  |  | 53 |     And I click on "Grade users" "button"
 | 
        
           |  |  | 54 |     Then I should see "1 out of 1"
 | 
        
           |  |  | 55 |     And I should not see "1 out of 2"
 | 
        
           |  |  | 56 |     And I should not see "1 out of 3"
 | 
        
           |  |  | 57 |     And I should see "Student 1"
 | 
        
           |  |  | 58 |     And I should not see "Student 2"
 | 
        
           |  |  | 59 |   | 
        
           |  |  | 60 |   @javascript
 | 
        
           |  |  | 61 |   Scenario: Grade users by group B
 | 
        
           |  |  | 62 |     And I select "Group B" from the "Separate groups" singleselect
 | 
        
           |  |  | 63 |     And I click on "Grade users" "button"
 | 
        
           |  |  | 64 |     Then I should see "1 out of 1"
 | 
        
           |  |  | 65 |     And I should not see "1 out of 2"
 | 
        
           |  |  | 66 |     And I should not see "1 out of 3"
 | 
        
           |  |  | 67 |     And I should not see "Student 1"
 | 
        
           |  |  | 68 |     And I should see "Student 2"
 | 
        
           |  |  | 69 |   | 
        
           |  |  | 70 |   @javascript
 | 
        
           |  |  | 71 |   Scenario: Grade users by group C
 | 
        
           |  |  | 72 |     And I select "Group C" from the "Separate groups" singleselect
 | 
        
           |  |  | 73 |     And I click on "Grade users" "button"
 | 
        
           |  |  | 74 |     Then I should not see "1 out of 1"
 | 
        
           |  |  | 75 |     And I should not see "1 out of 2"
 | 
        
           |  |  | 76 |     And I should see "1 out of 3"
 | 
        
           |  |  | 77 |   | 
        
           |  |  | 78 |   @javascript
 | 
        
           |  |  | 79 |   Scenario: Teacher can see only the discussions which are joined to
 | 
        
           |  |  | 80 |     Given the following "users" exist:
 | 
        
           |  |  | 81 |       | username | firstname | lastname | email |
 | 
        
           |  |  | 82 |       | teacher2 | Teacher | 2 | teacher2@example.com |
 | 
        
           |  |  | 83 |     And the following "course enrolments" exist:
 | 
        
           |  |  | 84 |       | user | course | role |
 | 
        
           |  |  | 85 |       | teacher2 | C1 | teacher |
 | 
        
           |  |  | 86 |     And the following "group members" exist:
 | 
        
           |  |  | 87 |       | user | group |
 | 
        
           |  |  | 88 |       | teacher2 | G2 |
 | 
        
           |  |  | 89 |       | teacher2 | G3 |
 | 
        
           |  |  | 90 |     When I am on the "Test Forum 1" "forum activity" page logged in as student1
 | 
        
           |  |  | 91 |     And I select "Group A" from the "Separate groups" singleselect
 | 
        
           |  |  | 92 |     And I click on "Add discussion topic" "link"
 | 
        
           |  |  | 93 |     And I set the following fields to these values:
 | 
        
           |  |  | 94 |       | Subject  | Discussion subject A |
 | 
        
           |  |  | 95 |       | Message | Discussion message A |
 | 
        
           |  |  | 96 |     And I press "Post to forum"
 | 
        
           |  |  | 97 |     And I select "Group C" from the "Separate groups" singleselect
 | 
        
           |  |  | 98 |     And I click on "Add discussion topic" "link"
 | 
        
           |  |  | 99 |     And I set the following fields to these values:
 | 
        
           |  |  | 100 |       | Subject  | Discussion subject C |
 | 
        
           |  |  | 101 |       | Message | Discussion message C |
 | 
        
           |  |  | 102 |     And I press "Post to forum"
 | 
        
           |  |  | 103 |     Then I am on the "Test Forum 1" "forum activity" page logged in as teacher2
 | 
        
           |  |  | 104 |     And I select "Group C" from the "Separate groups" singleselect
 | 
        
           |  |  | 105 |     And I click on "Grade users" "button"
 | 
        
           |  |  | 106 |     And I should see "Student 1"
 | 
        
           |  |  | 107 |     And I should see "Discussion subject C"
 | 
        
           |  |  | 108 |     And I should not see "Discussion subject A"
 |