| 1 | 
           efrain | 
           1 | 
           @mod @mod_assign
  | 
        
        
            | 
            | 
           2 | 
           Feature: In an assignment, teacher can require submission statements
  | 
        
        
            | 
            | 
           3 | 
             In order to require students to accept an assignment submission statement
  | 
        
        
            | 
            | 
           4 | 
             As a teacher
  | 
        
        
            | 
            | 
           5 | 
             I need to enable "Require that students accept the submission statement"
  | 
        
        
            | 
            | 
           6 | 
              | 
        
        
            | 
            | 
           7 | 
             Background:
  | 
        
        
            | 
            | 
           8 | 
               Given the following "courses" exist:
  | 
        
        
            | 
            | 
           9 | 
                 | fullname | shortname | category |
  | 
        
        
            | 
            | 
           10 | 
                 | Course 1 | C1        | 0        |
  | 
        
        
            | 
            | 
           11 | 
               And the following "users" exist:
  | 
        
        
            | 
            | 
           12 | 
                 | username | firstname | lastname | email                |
  | 
        
        
            | 
            | 
           13 | 
                 | teacher1 | Terry     | Teacher  | teacher1@example.com |
  | 
        
        
            | 
            | 
           14 | 
                 | student1 | Sam       | Student | student1@example.com |
  | 
        
        
            | 
            | 
           15 | 
               And the following "course enrolments" exist:
  | 
        
        
            | 
            | 
           16 | 
                 | user     | course | role           |
  | 
        
        
            | 
            | 
           17 | 
                 | teacher1 | C1     | editingteacher |
  | 
        
        
            | 
            | 
           18 | 
                 | student1 | C1     | student        |
  | 
        
        
            | 
            | 
           19 | 
               And the following "activity" exists:
  | 
        
        
            | 
            | 
           20 | 
                 | activity                            | assign      |
  | 
        
        
            | 
            | 
           21 | 
                 | course                              | C1          |
  | 
        
        
            | 
            | 
           22 | 
                 | name                                | Test assign |
  | 
        
        
            | 
            | 
           23 | 
                 | submissiondrafts                    | 1           |
  | 
        
        
            | 
            | 
           24 | 
                 | requiresubmissionstatement          | 1           |
  | 
        
        
            | 
            | 
           25 | 
                 | assignsubmission_onlinetext_enabled | 1           |
  | 
        
        
            | 
            | 
           26 | 
              | 
        
        
            | 
            | 
           27 | 
             Scenario: Student is required to accept assignment submission statement
  | 
        
        
            | 
            | 
           28 | 
               Given I am on the "Test assign" "assign activity" page logged in as student1
  | 
        
        
            | 
            | 
           29 | 
               And I press "Add submission"
  | 
        
        
            | 
            | 
           30 | 
               And I set the field "Online text" to "My submission text."
  | 
        
        
            | 
            | 
           31 | 
               And I press "Save changes"
  | 
        
        
            | 
            | 
           32 | 
               And I should see "Draft (not submitted)" in the "Submission status" "table_row"
  | 
        
        
            | 
            | 
           33 | 
               When I press "Submit assignment"
  | 
        
        
            | 
            | 
           34 | 
               Then I should see "This submission is my own work, except where I have acknowledged the use of the works of other people."
  | 
        
        
            | 
            | 
           35 | 
               And I press "Continue"
  | 
        
        
            | 
            | 
           36 | 
               And I should see "Confirm submission"
  | 
        
        
            | 
            | 
           37 | 
               And I should see "You are required to agree to this statement before you can submit."
  | 
        
        
            | 
            | 
           38 | 
               And I set the field "submissionstatement" to "1"
  | 
        
        
            | 
            | 
           39 | 
               And I press "Continue"
  | 
        
        
            | 
            | 
           40 | 
               And I should see "Submitted for grading" in the "Submission status" "table_row"
  | 
        
        
            | 
            | 
           41 | 
              | 
        
        
            | 
            | 
           42 | 
             Scenario: Student is not required to accept assignment submission statement when non exists
  | 
        
        
            | 
            | 
           43 | 
               Given the following config values are set as admin:
  | 
        
        
            | 
            | 
           44 | 
                 | config               | value | plugin |
  | 
        
        
            | 
            | 
           45 | 
                 | submissionstatement  |       | assign |
  | 
        
        
            | 
            | 
           46 | 
               And I am on the "Test assign" "assign activity" page logged in as student1
  | 
        
        
            | 
            | 
           47 | 
               When I press "Add submission"
  | 
        
        
            | 
            | 
           48 | 
               And I set the field "Online text" to "My submission text."
  | 
        
        
            | 
            | 
           49 | 
               And I press "Save changes"
  | 
        
        
            | 
            | 
           50 | 
               And I should see "Draft (not submitted)" in the "Submission status" "table_row"
  | 
        
        
            | 
            | 
           51 | 
               And I press "Submit assignment"
  | 
        
        
            | 
            | 
           52 | 
               And I press "Continue"
  | 
        
        
            | 
            | 
           53 | 
               Then I should see "Submitted for grading" in the "Submission status" "table_row"
  | 
        
        
            | 
            | 
           54 | 
              | 
        
        
            | 
            | 
           55 | 
             Scenario: Student is not required to accept assignment submission statement
  | 
        
        
            | 
            | 
           56 | 
               Given I am on the "Test assign" "assign activity editing" page logged in as teacher1
  | 
        
        
            | 
            | 
           57 | 
               And I set the following fields to these values:
  | 
        
        
            | 
            | 
           58 | 
                 | Require that students accept the submission statement | No |
  | 
        
        
            | 
            | 
           59 | 
               And I press "Save and display"
  | 
        
        
            | 
            | 
           60 | 
               And I am on the "Test assign" "assign activity" page logged in as student1
  | 
        
        
            | 
            | 
           61 | 
               And I press "Add submission"
  | 
        
        
            | 
            | 
           62 | 
               And I set the field "Online text" to "My submission text."
  | 
        
        
            | 
            | 
           63 | 
               And I press "Save changes"
  | 
        
        
            | 
            | 
           64 | 
               And I should see "Draft (not submitted)" in the "Submission status" "table_row"
  | 
        
        
            | 
            | 
           65 | 
               When I press "Submit assignment"
  | 
        
        
            | 
            | 
           66 | 
               Then I should not see "This submission is my own work, except where I have acknowledged the use of the works of other people."
  | 
        
        
            | 
            | 
           67 | 
               And I press "Continue"
  | 
        
        
            | 
            | 
           68 | 
               And I should see "Submitted for grading" in the "Submission status" "table_row"
  |