Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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 the following "activity" exist:
20
      | activity | name        | intro              | course | idnumber | option                       | allowmultiple |
21
      | choice   | Choice name | Choice description | C1     | 00001    | Option 1, Option 2, Option 3 | 1             |
22
    When I log in as "student1"
23
    And I am on "Course 1" course homepage
24
    And I choose options "Option 1","Option 2" from "Choice name" choice activity
25
    Then I should see "Your selection: Option 1; Option 2"
26
    And I should see "Your choice has been saved"
27
 
28
  Scenario: Complete a choice with multiple options enabled and limited responses set
29
    Given the following "users" exist:
30
      | username | firstname | lastname | email |
31
      | teacher1 | Teacher | 1 | teacher1@example.com |
32
      | student1 | Student | 1 | student1@example.com |
33
      | student2 | Student | 2 | student2@example.com |
34
    And the following "courses" exist:
35
      | fullname | shortname | category |
36
      | Course 1 | C1 | 0 |
37
    And the following "course enrolments" exist:
38
      | user | course | role |
39
      | teacher1 | C1 | editingteacher |
40
      | student1 | C1 | student |
41
      | student2 | C1 | student |
42
    And the following "activity" exist:
43
      | activity | name        | intro              | course | idnumber | option                       | allowmultiple | showavailable | limitanswers |
44
      | choice   | Choice name | Choice description | C1     | choice1  | Option 1, Option 2, Option 3 | 1             | 1             | 1            |
45
    And I log in as "teacher1"
46
    And I am on "Course 1" course homepage with editing mode on
47
    And I follow "Choice name"
48
    And I follow "Settings"
49
    And I set the following fields to these values:
50
      | Limit 1 | 1 |
51
      | Limit 2 | 1 |
52
      | Limit 3 | 1 |
53
    And I press "Save and display"
54
    And I log out
55
    When I log in as "student1"
56
    And I am on "Course 1" course homepage
57
    And I choose options "Option 1","Option 2" from "Choice name" choice activity
58
    Then I should see "Your selection: Option 1; Option 2"
59
    And I should see "Your choice has been saved"
60
    And I log out
61
    And I log in as "student2"
62
    And I am on "Course 1" course homepage
63
    And I follow "Choice name"
64
    And I should see "Option 1 (Full)"
65
    And I should see "Option 2 (Full)"
66
    And I should see "Option 3"
67
    And the "#choice_1" "css_element" should be disabled
68
    And the "#choice_2" "css_element" should be disabled
69
    And the "#choice_3" "css_element" should be enabled
70
    And I log out
71
    And I log in as "teacher1"
72
    And I am on "Course 1" course homepage
73
    And I follow "Choice name"
74
    And I navigate to "Responses" in current page administration
75
    Then I should see "Option 1 (Full)"
76
    And I should see "Limit: 1"
77
    And I am on "Course 1" course homepage with editing mode on
78
    And I follow "Choice name"
79
    And I navigate to "Settings" in current page administration
80
    And I set the following fields to these values:
81
      | Limit the number of responses allowed | No |
82
    And I press "Save and return to course"
83
    And I am on "Course 1" course homepage
84
    And I follow "Choice name"
85
    And I navigate to "Responses" in current page administration
86
    Then I should not see "Limit: 1"
87
    And I log out