[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/assign/tests/behat/ -> allow_another_attempt.feature (source)

   1  @mod @mod_assign
   2  Feature: In an assignment, students start a new attempt based on their previous one
   3    In order to improve my submission
   4    As a student
   5    I need to submit my assignment editing an online form, receive feedback, and then improve my submission.
   6  
   7    @javascript
   8    Scenario: Submit a text online and edit the submission
   9      Given the following "courses" exist:
  10        | fullname | shortname | category | groupmode |
  11        | Course 1 | C1 | 0 | 1 |
  12      And the following "users" exist:
  13        | username | firstname | lastname | email |
  14        | teacher1 | Teacher | 1 | teacher1@example.com |
  15        | student1 | Student | 1 | student1@example.com |
  16      And the following "course enrolments" exist:
  17        | user | course | role |
  18        | teacher1 | C1 | editingteacher |
  19        | student1 | C1 | student |
  20      And I log in as "teacher1"
  21      And I follow "Course 1"
  22      And I turn editing mode on
  23      And I add a "Assignment" to section "1" and I fill the form with:
  24        | Assignment name | Test assignment name |
  25        | Description | Submit your online text |
  26        | assignsubmission_onlinetext_enabled | 1 |
  27        | assignsubmission_file_enabled | 0 |
  28        | Attempts reopened | Manually |
  29      And I log out
  30      And I log in as "student1"
  31      And I follow "Course 1"
  32      And I follow "Test assignment name"
  33      When I press "Add submission"
  34      And I set the following fields to these values:
  35        | Online text | I'm the student first submission |
  36      And I press "Save changes"
  37      And I log out
  38      And I log in as "teacher1"
  39      And I follow "Course 1"
  40      And I follow "Test assignment name"
  41      And I follow "View all submissions"
  42      And I click on "Grade" "link" in the "Student 1" "table_row"
  43      And I set the following fields to these values:
  44        | Allow another attempt | 1 |
  45      And I press "Save changes"
  46      And I press "Ok"
  47      And I click on "Edit settings" "link"
  48      And I log out
  49      And I log in as "student1"
  50      And I follow "Course 1"
  51      And I follow "Test assignment name"
  52      And I press "Add a new attempt based on previous submission"
  53      And I press "Save changes"
  54      Then I log out
  55      And I log in as "teacher1"
  56      And I follow "Course 1"
  57      And I follow "Test assignment name"
  58      And I follow "View all submissions"
  59      And I click on "Grade" "link" in the "Student 1" "table_row"
  60      And I should see "I'm the student first submission"
  61  
  62    @javascript @_alert
  63    Scenario: Allow new attempt does not display incorrect error message on group submission
  64      Given the following "courses" exist:
  65        | fullname | shortname | category | groupmode |
  66        | Course 1 | C1 | 0 | 1 |
  67      And the following "users" exist:
  68        | username | firstname | lastname | email |
  69        | teacher1 | Teacher | 1 | teacher1@example.com |
  70        | student1 | Student | 1 | student1@example.com |
  71        | student2 | Student | 2 | student2@example.com |
  72        | student3 | Student | 3 | student3@example.com |
  73        | student4 | Student | 4 | student4@example.com |
  74      And the following "course enrolments" exist:
  75        | user | course | role |
  76        | teacher1 | C1 | editingteacher |
  77        | student1 | C1 | student |
  78        | student2 | C1 | student |
  79        | student3 | C1 | student |
  80        | student4 | C1 | student |
  81      And the following "groups" exist:
  82        | name | course | idnumber |
  83        | Group 1 | C1 | G1 |
  84        | Group 2 | C1 | G2 |
  85      And the following "group members" exist:
  86        | user | group |
  87        | student1 | G1 |
  88        | student2 | G1 |
  89        | student3 | G2 |
  90        | student4 | G2 |
  91      And I log in as "teacher1"
  92      And I follow "Course 1"
  93      And I turn editing mode on
  94      And I add a "Assignment" to section "1" and I fill the form with:
  95        | Assignment name | Test assignment name |
  96        | Description | Test assignment description |
  97        | assignsubmission_onlinetext_enabled | 1 |
  98        | assignsubmission_file_enabled | 0 |
  99        | Students submit in groups | Yes |
 100        | Attempts reopened | Manually |
 101        | Maximum attempts | 3 |
 102        | Group mode | Separate groups |
 103      And I log out
 104      And I log in as "student1"
 105      And I follow "Course 1"
 106      And I follow "Test assignment name"
 107      And I press "Add submission"
 108      And I set the following fields to these values:
 109        | Online text | I'm the student's first submission |
 110      And I press "Save changes"
 111      And I log out
 112      And I log in as "teacher1"
 113      And I follow "Course 1"
 114      And I follow "Test assignment name"
 115      When I follow "View all submissions"
 116      Then "Student 1" row "Status" column of "generaltable" table should contain "Submitted for grading"
 117      And "Student 2" row "Status" column of "generaltable" table should contain "Submitted for grading"
 118      And "Student 3" row "Status" column of "generaltable" table should contain "No submission"
 119      And "Student 4" row "Status" column of "generaltable" table should contain "No submission"
 120      And I click on "Quick grading" "checkbox"
 121      And I click on "Student 1" "checkbox"
 122      And I set the field "User grade" to "60.0"
 123      And I press "Save all quick grading changes"
 124      And I should see "The grade changes were saved"
 125      And I press "Continue"
 126      And I click on "Student 1" "checkbox"
 127      And I set the following fields to these values:
 128        | operation | Allow another attempt |
 129      And I click on "Go" "button" confirming the dialogue
 130      And I should not see "The grades were not saved because someone has modified one or more records more recently than when you loaded the page."
 131  # Behat tests for the group submission, should be uncommented once the MDL-48216 is fixed.
 132  #    And I log out
 133  #    And I log in as "student3"
 134  #    And I follow "Course 1"
 135  #    And I follow "Test assignment name"
 136  #    #And I should see "This is attempt 1 ( 3 attempts allowed )."
 137  #    And I press "Add submission"
 138  #    And I set the following fields to these values:
 139  #      | Online text | I'm the student's 3 group 2 first attempt |
 140  #    And I press "Save changes"
 141  #    And I log out
 142  #    And I log in as "teacher1"
 143  #    And I follow "Course 1"
 144  #    And I follow "Test assignment name"
 145  #    And I follow "View all submissions"
 146  #    And "Student 1" row "Status" column of "generaltable" table should contain "Reopened"
 147  #    And "Student 2" row "Status" column of "generaltable" table should contain "Reopened"
 148  #    And "Student 3" row "Status" column of "generaltable" table should contain "Submitted for grading"
 149  #    And "Student 4" row "Status" column of "generaltable" table should contain "Submitted for grading"
 150  #    And I click on "Grade " "link" in the "Student 3" "table_row"
 151  #    And I set the following fields to these values:
 152  #      | Allow another attempt | 1 |
 153  #    And I press "Save changes"
 154  #    And I log out
 155  #    And I log in as "student4"
 156  #    And I follow "Course 1"
 157  #    And I follow "Test assignment name"
 158  #    #And I should see "This is attempt 2 ( 3 attempts allowed )."
 159  #    And I press "Add submission"
 160  #    And I set the following fields to these values:
 161  #      | Online text | I'm the student's 4 group 2 second attempt |
 162  #    And I press "Save changes"
 163  #    And I log out
 164  #    And I log in as "teacher1"
 165  #    And I follow "Course 1"
 166  #    And I follow "Test assignment name"
 167  #    And I follow "View all submissions"
 168  #    And I click on "Grade" "link" in the "Student 1" "table_row"
 169      #And I should see "This is attempt 2 (3 attempts allowed)"


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1