| 1 | efrain | 1 | @mod @mod_lti @core_completion
 | 
        
           |  |  | 2 | Feature: Pass grade activity completion information in the LTI activity
 | 
        
           |  |  | 3 |   | 
        
           |  |  | 4 |   Background:
 | 
        
           |  |  | 5 |     Given the following "users" exist:
 | 
        
           |  |  | 6 |       | username | firstname | lastname | email                |
 | 
        
           |  |  | 7 |       | student1 | Vinnie    | Student1 | student1@example.com |
 | 
        
           |  |  | 8 |       | student2 | Vinnie    | Student2 | student2@example.com |
 | 
        
           |  |  | 9 |       | student3 | Vinnie    | Student3 | student3@example.com |
 | 
        
           |  |  | 10 |       | teacher1 | Darrell   | Teacher1 | teacher1@example.com |
 | 
        
           |  |  | 11 |     And the following "courses" exist:
 | 
        
           |  |  | 12 |       | fullname | shortname | category | enablecompletion | showcompletionconditions |
 | 
        
           |  |  | 13 |       | Course 1 | C1        | 0        | 1                | 1                        |
 | 
        
           |  |  | 14 |     And the following "course enrolments" exist:
 | 
        
           |  |  | 15 |       | user     | course | role           |
 | 
        
           |  |  | 16 |       | student1 | C1     | student        |
 | 
        
           |  |  | 17 |       | student2 | C1     | student        |
 | 
        
           |  |  | 18 |       | student3 | C1     | student        |
 | 
        
           |  |  | 19 |       | teacher1 | C1     | editingteacher |
 | 
        
           |  |  | 20 |     And the following "activities" exist:
 | 
        
           |  |  | 21 |       | activity | name           | course | gradepass | completion | completionview | completionusegrade | completionpassgrade |
 | 
        
           |  |  | 22 |       | lti      | Music history  | C1     | 50        | 2          | 1              | 1                  | 1                   |
 | 
        
           |  |  | 23 |   | 
        
           |  |  | 24 |   Scenario: View automatic completion items as a teacher
 | 
        
           |  |  | 25 |     Given I am on the "Music history" "lti activity" page logged in as teacher1
 | 
        
           |  |  | 26 |     Then "Music history" should have the "View" completion condition
 | 
        
           |  |  | 27 |     And "Music history" should have the "Receive a grade" completion condition
 | 
        
           |  |  | 28 |     And "Music history" should have the "Receive a passing grade" completion condition
 | 
        
           |  |  | 29 |   | 
        
           |  |  | 30 |   @javascript
 | 
        
           |  |  | 31 |   Scenario: View automatic completion items as a student
 | 
        
           |  |  | 32 |     Given I am on the "Music history" "lti activity" page logged in as student1
 | 
        
           |  |  | 33 |     And the "View" completion condition of "Music history" is displayed as "done"
 | 
        
           |  |  | 34 |     And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
 | 
        
           |  |  | 35 |     And the "Receive a passing grade" completion condition of "Music history" is displayed as "todo"
 | 
        
           |  |  | 36 |     And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
 | 
        
           |  |  | 37 |     And I turn editing mode on
 | 
        
           |  |  | 38 |     And I give the grade "90.00" to the user "Vinnie Student1" for the grade item "Music history"
 | 
        
           |  |  | 39 |     And I give the grade "20.00" to the user "Vinnie Student2" for the grade item "Music history"
 | 
        
           |  |  | 40 |     And I press "Save changes"
 | 
        
           |  |  | 41 |     When I am on the "Music history" "lti activity" page logged in as student1
 | 
        
           |  |  | 42 |     Then the "Receive a grade" completion condition of "Music history" is displayed as "done"
 | 
        
           |  |  | 43 |     Then the "Receive a passing grade" completion condition of "Music history" is displayed as "done"
 | 
        
           |  |  | 44 |     And the "View" completion condition of "Music history" is displayed as "done"
 | 
        
           |  |  | 45 |     When I am on the "Music history" "lti activity" page logged in as student2
 | 
        
           |  |  | 46 |     Then the "Receive a grade" completion condition of "Music history" is displayed as "done"
 | 
        
           |  |  | 47 |     Then the "Receive a passing grade" completion condition of "Music history" is displayed as "failed"
 | 
        
           |  |  | 48 |     And the "View" completion condition of "Music history" is displayed as "done"
 | 
        
           |  |  | 49 |     When I am on the "Music history" "lti activity" page logged in as student3
 | 
        
           |  |  | 50 |     Then the "Receive a grade" completion condition of "Music history" is displayed as "todo"
 | 
        
           |  |  | 51 |     Then the "Receive a passing grade" completion condition of "Music history" is displayed as "todo"
 | 
        
           |  |  | 52 |     And the "View" completion condition of "Music history" is displayed as "done"
 | 
        
           |  |  | 53 |     And I am on the "Course 1" course page logged in as teacher1
 | 
        
           |  |  | 54 |     And "Vinnie Student1" user has completed "Music history" activity
 | 
        
           |  |  | 55 |     And "Vinnie Student2" user has completed "Music history" activity
 | 
        
           |  |  | 56 |     And "Vinnie Student3" user has not completed "Music history" activity
 |