[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  @mod @mod_choice
   2  Feature: Multiple option choice response
   3    In order to ask questions as a choice of multiple responses
   4    As a teacher
   5    I need to add choice activities to courses with multiple options enabled
   6  
   7    Scenario: Complete a choice with multiple options enabled
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email |
  10        | teacher1 | Teacher | 1 | teacher1@example.com |
  11        | student1 | Student | 1 | student1@example.com |
  12      And the following "courses" exist:
  13        | fullname | shortname | category |
  14        | Course 1 | C1 | 0 |
  15      And the following "course enrolments" exist:
  16        | user | course | role |
  17        | teacher1 | C1 | editingteacher |
  18        | student1 | C1 | student |
  19      And I log in as "teacher1"
  20      And I follow "Course 1"
  21      And I turn editing mode on
  22      And I add a "Choice" to section "1" and I fill the form with:
  23        | Choice name | Choice name |
  24        | Description | Choice Description |
  25        | Allow more than one choice to be selected | Yes |
  26        | option[0] | Option 1 |
  27        | option[1] | Option 2 |
  28      And I log out
  29      When I log in as "student1"
  30      And I follow "Course 1"
  31      And I choose options "Option 1","Option 2" from "Choice name" choice activity
  32      Then I should see "Your selection: Option 1; Option 2"
  33      And I should see "Your choice has been saved"
  34  
  35    Scenario: Complete a choice with multiple options enabled and limited responses set
  36      Given the following "users" exist:
  37        | username | firstname | lastname | email |
  38        | teacher1 | Teacher | 1 | teacher1@example.com |
  39        | student1 | Student | 1 | student1@example.com |
  40        | student2 | Student | 2 | student2@example.com |
  41      And the following "courses" exist:
  42        | fullname | shortname | category |
  43        | Course 1 | C1 | 0 |
  44      And the following "course enrolments" exist:
  45        | user | course | role |
  46        | teacher1 | C1 | editingteacher |
  47        | student1 | C1 | student |
  48        | student2 | C1 | student |
  49      And I log in as "teacher1"
  50      And I follow "Course 1"
  51      And I turn editing mode on
  52      And I add a "Choice" to section "1" and I fill the form with:
  53        | Choice name | Choice name |
  54        | Description | Choice Description |
  55        | Allow more than one choice to be selected | Yes |
  56        | Limit the number of responses allowed | 1 |
  57        | option[0] | Option 1 |
  58        | limit[0] | 1 |
  59        | option[1] | Option 2 |
  60        | limit[1] | 1 |
  61        | option[2] | Option 3 |
  62        | limit[2] | 1 |
  63      And I log out
  64      When I log in as "student1"
  65      And I follow "Course 1"
  66      And I choose options "Option 1","Option 2" from "Choice name" choice activity
  67      Then I should see "Your selection: Option 1; Option 2"
  68      And I should see "Your choice has been saved"
  69      And I log out
  70      And I log in as "student2"
  71      And I follow "Course 1"
  72      And I follow "Choice name"
  73      And I should see "Option 1 (Full)"
  74      And I should see "Option 2 (Full)"
  75      And I should see "Option 3"
  76      And the "#choice_1" "css_element" should be disabled
  77      And the "#choice_2" "css_element" should be disabled
  78      And the "#choice_3" "css_element" should be enabled


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