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: A teacher can choose one of 4 options for publishing choice results
3
  In order to display choice activities outcomes
4
  As a teacher
5
  I need to publish the choice activity results in different ways
6
 
7
  Background:
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 am on "Course 1" course homepage with editing mode on
21
 
22
  Scenario: Do not publish results to students
23
    Given the following "activity" exists:
24
      | activity | choice               |
25
      | course   | C1                   |
26
      | idnumber | choice1              |
27
      | name     | Choice 1             |
28
      | intro    | Choice Description   |
29
      | section  | 1                    |
30
      | option   | Option 1, Option 2   |
31
    And I am on "Course 1" course homepage
32
    And I follow "Choice 1"
33
    And I navigate to "Settings" in current page administration
34
    And I set the following fields to these values:
35
      | Publish results | Do not publish results to students |
36
    And I press "Save and return to course"
37
    And I log out
38
    And I log in as "student1"
39
    And I am on "Course 1" course homepage
40
    When I choose "Option 1" from "Choice 1" choice activity
41
    Then I should see "Your selection: Option 1"
42
    And I should not see "Responses"
43
    And I should not see "Graph display"
44
 
45
  Scenario: Show results to students after they answer
46
    Given the following "activity" exists:
47
      | activity | choice               |
48
      | course   | C1                   |
49
      | idnumber | choice1              |
50
      | name     | Choice 1             |
51
      | intro    | Choice Description   |
52
      | section  | 1                    |
53
      | option   | Option 1, Option 2   |
54
    And I am on "Course 1" course homepage
55
    And I follow "Choice 1"
56
    And I navigate to "Settings" in current page administration
57
    And I set the following fields to these values:
58
      | Publish results | Show results to students after they answer |
59
    And I press "Save and return to course"
60
    And I log out
61
    And I log in as "student1"
62
    And I am on "Course 1" course homepage
63
    When I follow "Choice 1"
64
    Then I should not see "Responses"
65
    And I am on "Course 1" course homepage
66
    And I choose "Option 1" from "Choice 1" choice activity
67
    And I should see "Your selection: Option 1"
68
    And I should see "Responses"
69
 
70
  Scenario: Show results to students only after the choice is closed
71
    Given the following "activity" exists:
72
      | activity | choice               |
73
      | course   | C1                   |
74
      | idnumber | choice1              |
75
      | name     | Choice 1             |
76
      | intro    | Choice Description   |
77
      | section  | 1                    |
78
      | option   | Option 1, Option 2   |
79
    And I am on "Course 1" course homepage
80
    And I follow "Choice 1"
81
    And I navigate to "Settings" in current page administration
82
    And I set the following fields to these values:
83
      | Publish results | Show results to students only after the choice is closed |
84
    And I press "Save and return to course"
85
    And I log out
86
    And I log in as "student1"
87
    And I am on "Course 1" course homepage
88
    When I follow "Choice 1"
89
    Then I should not see "Responses"
90
    And I choose "Option 1" from "Choice 1" choice activity
91
    And I log out
92
    And I log in as "teacher1"
93
    And I am on "Course 1" course homepage
94
    And I follow "Choice 1"
95
    And I follow "Settings"
96
    And I expand all fieldsets
97
    And I set the following fields to these values:
98
      | timeopen[enabled] | 1 |
99
      | timeopen[day] | 1 |
100
      | timeopen[month] | January |
101
      | timeopen[year] | 2010 |
102
      | timeclose[enabled] | 1 |
103
      | timeclose[day] | 2 |
104
      | timeclose[month] | January |
105
      | timeclose[year] | 2010 |
106
    And I press "Save and return to course"
107
    And I log out
108
    And I log in as "student1"
109
    And I am on "Course 1" course homepage
110
    And I follow "Choice 1"
111
    And I should see "Responses"
112
 
113
  Scenario: Always show results to students
114
    Given the following "activity" exists:
115
      | activity | choice               |
116
      | course   | C1                   |
117
      | idnumber | choice1              |
118
      | name     | Choice 1             |
119
      | intro    | Choice Description   |
120
      | section  | 1                    |
121
      | option   | Option 1, Option 2   |
122
    And I am on "Course 1" course homepage
123
    And I follow "Choice 1"
124
    And I navigate to "Settings" in current page administration
125
    And I set the following fields to these values:
126
      | Publish results | Always show results to students |
127
    And I press "Save and return to course"
128
    And I log out
129
    And I log in as "student1"
130
    And I am on "Course 1" course homepage
131
    When I follow "Choice 1"
132
    And I should see "Responses"