| 1 | efrain | 1 | @gradingform @gradingform_rubric
 | 
        
           |  |  | 2 | Feature: Rubrics can be created and edited
 | 
        
           |  |  | 3 |   In order to use and refine rubrics to grade students
 | 
        
           |  |  | 4 |   As a teacher
 | 
        
           |  |  | 5 |   I need to edit previously used rubrics
 | 
        
           |  |  | 6 |   | 
        
           |  |  | 7 |   @javascript
 | 
        
           |  |  | 8 |   Scenario: I can use rubrics to grade and edit them later updating students grades
 | 
        
           |  |  | 9 |     Given the following "users" exist:
 | 
        
           |  |  | 10 |       | username | firstname | lastname | email |
 | 
        
           |  |  | 11 |       | teacher1 | Teacher | 1 | teacher1@example.com |
 | 
        
           |  |  | 12 |       | student1 | Student | 1 | student1@example.com |
 | 
        
           |  |  | 13 |     And the following "courses" exist:
 | 
        
           |  |  | 14 |       | fullname | shortname | format |
 | 
        
           |  |  | 15 |       | Course 1 | C1 | topics |
 | 
        
           |  |  | 16 |     And the following "course enrolments" exist:
 | 
        
           |  |  | 17 |       | user | course | role |
 | 
        
           |  |  | 18 |       | teacher1 | C1 | editingteacher |
 | 
        
           |  |  | 19 |       | student1 | C1 | student |
 | 
        
           |  |  | 20 |     And the following "activity" exists:
 | 
        
           |  |  | 21 |       | activity                          | assign                      |
 | 
        
           |  |  | 22 |       | course                            | C1                          |
 | 
        
           |  |  | 23 |       | section                           | 1                           |
 | 
        
           |  |  | 24 |       | name                              | Test assignment 1 name      |
 | 
        
           |  |  | 25 |       | intro                             | Test assignment description |
 | 
        
           |  |  | 26 |       | assignfeedback_comments_enabled   | 1                           |
 | 
        
           |  |  | 27 |       | assignfeedback_editpdf_enabled    | 1                           |
 | 
        
           |  |  | 28 |       | advancedgradingmethod_submissions | rubric                      |
 | 
        
           |  |  | 29 |     And I log in as "teacher1"
 | 
        
           |  |  | 30 |     And I am on "Course 1" course homepage with editing mode on
 | 
        
           |  |  | 31 |     When I go to "Test assignment 1 name" advanced grading definition page
 | 
        
           |  |  | 32 |     # Defining a rubric.
 | 
        
           |  |  | 33 |     And I set the following fields to these values:
 | 
        
           |  |  | 34 |       | Name | Assignment 1 rubric |
 | 
        
           |  |  | 35 |       | Description | Rubric test description |
 | 
        
           |  |  | 36 |     And I define the following rubric:
 | 
        
           |  |  | 37 |       | TMP Criterion 1 | TMP Level 11 | 11 | TMP Level 12 | 12 |
 | 
        
           |  |  | 38 |       | TMP Criterion 2 | TMP Level 21 | 21 | TMP Level 22 | 22 |
 | 
        
           |  |  | 39 |       | TMP Criterion 3 | TMP Level 31 | 31 | TMP Level 32 | 32 |
 | 
        
           |  |  | 40 |       | TMP Criterion 4 | TMP Level 41 | 41 | TMP Level 42 | 42 |
 | 
        
           |  |  | 41 |     # Checking that only the last ones are saved.
 | 
        
           |  |  | 42 |     And I define the following rubric:
 | 
        
           |  |  | 43 |       | Criterion 1 | Level 11 | 1  | Level 12 | 20 | Level 13 | 40 | Level 14  | 50  |
 | 
        
           |  |  | 44 |       | Criterion 2 | Level 21 | 10 | Level 22 | 20 | Level 23 | 30 |           |     |
 | 
        
           |  |  | 45 |       | Criterion 3 | Level 31 | 5  | Level 32 | 20 |          |    |           |     |
 | 
        
           |  |  | 46 |     And I press "Save as draft"
 | 
        
           |  |  | 47 |     And I go to "Test assignment 1 name" advanced grading definition page
 | 
        
           |  |  | 48 |     And I click on "Move down" "button" in the "Criterion 1" "table_row"
 | 
        
           |  |  | 49 |     And I press "Save rubric and make it ready"
 | 
        
           |  |  | 50 |     Then I should see "Ready for use"
 | 
        
           |  |  | 51 |     # Grading two students.
 | 
        
           |  |  | 52 |     And I navigate to "Assignment" in current page administration
 | 
        
           | 1441 | ariadna | 53 |     And I change window size to "large"
 | 
        
           | 1 | efrain | 54 |     And I go to "Student 1" "Test assignment 1 name" activity advanced grading page
 | 
        
           | 1441 | ariadna | 55 |     And I change window size to "medium"
 | 
        
           | 1 | efrain | 56 |     And I grade by filling the rubric with:
 | 
        
           |  |  | 57 |       | Criterion 1 | 50 | Very good |
 | 
        
           |  |  | 58 |     And I press "Save changes"
 | 
        
           |  |  | 59 |     # Checking that it complains if you don't select a level for each criterion.
 | 
        
           |  |  | 60 |     And I should see "Please choose something for each criterion"
 | 
        
           |  |  | 61 |     And I grade by filling the rubric with:
 | 
        
           |  |  | 62 |       | Criterion 1 | 50 | Very good |
 | 
        
           |  |  | 63 |       | Criterion 2 | 10 | Mmmm, you can do it better |
 | 
        
           |  |  | 64 |       | Criterion 3 | 5 | Not good |
 | 
        
           |  |  | 65 |     And I complete the advanced grading form with these values:
 | 
        
           |  |  | 66 |       | Feedback comments | In general... work harder... |
 | 
        
           |  |  | 67 |     # Checking that the user grade is correct.
 | 
        
           |  |  | 68 |     And I should see "65" in the "Student 1" "table_row"
 | 
        
           |  |  | 69 |     # Updating the user grade.
 | 
        
           |  |  | 70 |     And I am on the "Test assignment 1 name" "assign activity" page
 | 
        
           | 1441 | ariadna | 71 |     And I change window size to "large"
 | 
        
           | 1 | efrain | 72 |     And I go to "Student 1" "Test assignment 1 name" activity advanced grading page
 | 
        
           | 1441 | ariadna | 73 |     And I change window size to "medium"
 | 
        
           | 1 | efrain | 74 |     And I grade by filling the rubric with:
 | 
        
           |  |  | 75 |       | Criterion 1 | 20 | Bad, I changed my mind |
 | 
        
           |  |  | 76 |       | Criterion 2 | 10 | Mmmm, you can do it better |
 | 
        
           |  |  | 77 |       | Criterion 3 | 5 | Not good |
 | 
        
           |  |  | 78 |     #And the level with "50" points was previously selected for the rubric criterion "Criterion 1"
 | 
        
           |  |  | 79 |     #And the level with "20" points is selected for the rubric criterion "Criterion 1"
 | 
        
           |  |  | 80 |     And I save the advanced grading form
 | 
        
           |  |  | 81 |     And I should see "35" in the "Student 1" "table_row"
 | 
        
           |  |  | 82 |     And I log out
 | 
        
           |  |  | 83 |     # Viewing it as a student.
 | 
        
           |  |  | 84 |     And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
 | 
        
           |  |  | 85 |     And I should see "35" in the ".feedback" "css_element"
 | 
        
           |  |  | 86 |     And I should see "Rubric test description" in the ".feedback" "css_element"
 | 
        
           |  |  | 87 |     And I should see "In general... work harder..."
 | 
        
           |  |  | 88 |     And the level with "10" points is selected for the rubric criterion "Criterion 2"
 | 
        
           |  |  | 89 |     And the level with "20" points is selected for the rubric criterion "Criterion 1"
 | 
        
           |  |  | 90 |     And the level with "5" points is selected for the rubric criterion "Criterion 3"
 | 
        
           |  |  | 91 |     And I log out
 | 
        
           |  |  | 92 |     And I am on the "Course 1" course page logged in as teacher1
 | 
        
           |  |  | 93 |     # Editing a rubric definition without regrading students.
 | 
        
           |  |  | 94 |     And I go to "Test assignment 1 name" advanced grading definition page
 | 
        
           |  |  | 95 |     And "Save as draft" "button" should not exist
 | 
        
           |  |  | 96 |     And I click on "Move up" "button" in the "Criterion 1" "table_row"
 | 
        
           |  |  | 97 |     And I replace "Level 11" rubric level with "Level 11 edited" in "Criterion 1" criterion
 | 
        
           |  |  | 98 |     And I press "Save"
 | 
        
           |  |  | 99 |     And I should see "You are about to save changes to a rubric that has already been used for grading."
 | 
        
           |  |  | 100 |     And I set the field "menurubricregrade" to "Do not mark for regrade"
 | 
        
           |  |  | 101 |     And I press "Continue"
 | 
        
           |  |  | 102 |     And I log out
 | 
        
           |  |  | 103 |     # Check that the student still sees the grade.
 | 
        
           |  |  | 104 |     And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
 | 
        
           |  |  | 105 |     And I should see "35" in the ".feedback" "css_element"
 | 
        
           |  |  | 106 |     And the level with "20" points is selected for the rubric criterion "Criterion 1"
 | 
        
           |  |  | 107 |     And I log out
 | 
        
           |  |  | 108 |     # Editing a rubric with significant changes.
 | 
        
           |  |  | 109 |     And I log in as "teacher1"
 | 
        
           |  |  | 110 |     And I am on "Course 1" course homepage
 | 
        
           |  |  | 111 |     And I go to "Test assignment 1 name" advanced grading definition page
 | 
        
           |  |  | 112 |     And I click on "Move down" "button" in the "Criterion 2" "table_row"
 | 
        
           |  |  | 113 |     And I replace "1" rubric level with "60" in "Criterion 1" criterion
 | 
        
           |  |  | 114 |     And I press "Save"
 | 
        
           |  |  | 115 |     And I should see "You are about to save significant changes to a rubric that has already been used for grading. The gradebook value will be unchanged, but the rubric will be hidden from students until their item is regraded."
 | 
        
           |  |  | 116 |     And I press "Continue"
 | 
        
           |  |  | 117 |     And I log out
 | 
        
           |  |  | 118 |     # Check that the student doesn't see the grade.
 | 
        
           |  |  | 119 |     And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
 | 
        
           |  |  | 120 |     And I should see "35" in the ".feedback" "css_element"
 | 
        
           |  |  | 121 |     And the level with "20" points is not selected for the rubric criterion "Criterion 1"
 | 
        
           |  |  | 122 |     And I log out
 | 
        
           |  |  | 123 |     # Regrade student.
 | 
        
           |  |  | 124 |     And I am on the "Test assignment 1 name" "assign activity" page logged in as teacher1
 | 
        
           | 1441 | ariadna | 125 |     And I change window size to "large"
 | 
        
           | 1 | efrain | 126 |     And I go to "Student 1" "Test assignment 1 name" activity advanced grading page
 | 
        
           | 1441 | ariadna | 127 |     And I change window size to "medium"
 | 
        
           | 1 | efrain | 128 |     And I should see "The rubric definition was changed after this student had been graded. The student can not see this rubric until you check the rubric and update the grade."
 | 
        
           |  |  | 129 |     And I save the advanced grading form
 | 
        
           |  |  | 130 |     And I log out
 | 
        
           |  |  | 131 |     # Check that the student sees the grade again.
 | 
        
           |  |  | 132 |     And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
 | 
        
           |  |  | 133 |     And I should see "31.82" in the ".feedback" "css_element"
 | 
        
           |  |  | 134 |     And the level with "20" points is not selected for the rubric criterion "Criterion 1"
 | 
        
           |  |  | 135 |     # Hide all rubric info for students
 | 
        
           |  |  | 136 |     And I log out
 | 
        
           |  |  | 137 |     And I am on the "Course 1" course page logged in as teacher1
 | 
        
           |  |  | 138 |     And I go to "Test assignment 1 name" advanced grading definition page
 | 
        
           |  |  | 139 |     And I set the field "Allow users to preview rubric (otherwise it will only be displayed after grading)" to ""
 | 
        
           |  |  | 140 |     And I set the field "Display rubric description during evaluation" to ""
 | 
        
           |  |  | 141 |     And I set the field "Display rubric description to those being graded" to ""
 | 
        
           |  |  | 142 |     And I set the field "Display points for each level during evaluation" to ""
 | 
        
           |  |  | 143 |     And I set the field "Display points for each level to those being graded" to ""
 | 
        
           |  |  | 144 |     And I press "Save"
 | 
        
           |  |  | 145 |     And I set the field "menurubricregrade" to "Do not mark for regrade"
 | 
        
           |  |  | 146 |     And I press "Continue"
 | 
        
           |  |  | 147 |     And I log out
 | 
        
           |  |  | 148 |     # Students should not see anything.
 | 
        
           |  |  | 149 |     And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
 | 
        
           |  |  | 150 |     And I should not see "Criterion 1" in the ".submissionstatustable" "css_element"
 | 
        
           |  |  | 151 |     And I should not see "Criterion 2" in the ".submissionstatustable" "css_element"
 | 
        
           |  |  | 152 |     And I should not see "Criterion 3" in the ".submissionstatustable" "css_element"
 | 
        
           |  |  | 153 |     And I should not see "Rubric test description" in the ".feedback" "css_element"
 |