[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/mod/choice/tests/behat/ -> change_response.feature (source)

   1  @mod @mod_choice
   2  Feature: Teacher can choose whether to allow students to change their choice response
   3    In order to allow students to change their choice
   4    As a teacher
   5    I need to enable the option to change the choice
   6  
   7    @javascript
   8    Scenario: Add a choice activity and complete the activity as a student
   9      Given the following "users" exist:
  10        | username | firstname | lastname | email |
  11        | teacher1 | Teacher | 1 | [email protected] |
  12        | student1 | Student | 1 | [email protected] |
  13      And the following "courses" exist:
  14        | fullname | shortname | category |
  15        | Course 1 | C1 | 0 |
  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 "Choice" to section "1" and I fill the form with:
  24        | Choice name | Choice name |
  25        | Description | Choice Description |
  26        | Allow choice to be updated | No |
  27        | option[0] | Option 1 |
  28        | option[1] | Option 2 |
  29      And I log out
  30      When I log in as "student1"
  31      And I follow "Course 1"
  32      And I choose "Option 1" from "Choice name" choice activity
  33      Then I should see "Your selection: Option 1"
  34      And I should see "Your choice has been saved"
  35      And "Save my choice" "button" should not exist
  36      And I log out
  37      And I log in as "teacher1"
  38      And I follow "Course 1"
  39      And I follow "Choice name"
  40      And I follow "Edit settings"
  41      And I set the following fields to these values:
  42        | Allow choice to be updated | Yes |
  43      And I press "Save and display"
  44      And I log out
  45      And I log in as "student1"
  46      And I follow "Course 1"
  47      And I follow "Choice name"
  48      And I should see "Your selection: Option 1"
  49      And "Save my choice" "button" should exist
  50      And "Remove my choice" "link" should exist
  51      And I set the field "Option 2" to "1"
  52      And I press "Save my choice"
  53      And I should see "Your choice has been saved"
  54      And I should see "Your selection: Option 2"


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1