Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_questionnaire
2
Feature: Review responses
3
  In order to review and manage questionnaire responses
4
  As a teacher
5
  I need to access the view responses features
6
 
7
  @javascript
8
  Scenario: Add a questionnaire to a course without questions
9
    Given the following "users" exist:
10
      | username | firstname | lastname | email |
11
      | teacher1 | Teacher | 1 | teacher1@example.com |
12
      | student1 | Student | 1 | student1@example.com |
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 the following "activities" exist:
21
      | activity | name | description | course | idnumber |
22
      | questionnaire | Test questionnaire | Test questionnaire description | C1 | questionnaire0 |
23
    And "Test questionnaire" has questions and responses
24
    And I log in as "admin"
25
    And I navigate to "Location > Location settings" in site administration
26
    And I set the field "Default timezone" to "Europe/London"
27
    And I set the field "Force timezone" to "Europe/London"
28
    And I press "Save changes"
29
    And I navigate to "Language > Language settings" in site administration
30
    And I set the field "Language autodetect" to "0"
31
    And I log out
32
    And I log in as "teacher1"
33
    And I am on "Course 1" course homepage
34
    And I follow "Test questionnaire"
35
    Then I should see "View all responses"
36
    And I navigate to "View all responses" in current page administration
37
    Then I should see "View all responses."
38
    And I should see "All participants."
39
    And I should see "View Default order"
40
    And I should see "Responses: 6"
41
    And I follow "Ascending order"
42
    Then I should see "View all responses."
43
    And I should see "All participants."
44
    And I should see "Ascending order"
45
    And I should see "Responses: 6"
46
    And I follow "Descending order"
47
    Then I should see "View all responses."
48
    And I should see "All participants."
49
    And I should see "Descending order"
50
    And I should see "Responses: 6"
51
    And I follow "List of responses"
52
    Then I should see "Individual responses  : All participants"
53
    And I follow "Admin User"
54
    Then I should see "1 / 6"
55
    And I should see "Respondent:"
56
    And I should see "Admin User"
57
    And I should see "Submitted on:"
58
#    And I should see "Thursday, 14 January 2016, 9:22 pm"
59
    And I should see "Test questionnaire"
60
    And I follow "Next"
61
    Then I should see "2 / 6"
62
#    And I should see "Thursday, 14 January 2016, 8:53 pm"
63
    And I follow "Last Respondent"
64
    Then I should see "6 / 6"
65
#    And I should see "Friday, 19 December 2014, 5:58 pm"
66
    And I follow "Delete this Response"
67
    Then I should see "Are you sure you want to delete the response"
68
#    And I should see "Friday, 19 December 2014, 5:58 pm"
69
    And I press "Delete"
70
    Then I should see "Individual responses  : All participants"
71
    And I follow "Admin User"
72
    Then I should see "1 / 5"
73
    And I follow "Summary"
74
    Then I should see "View all responses."
75
    And I should see "All participants."
76
    And I should see "View Default order"
77
    And I should see "Responses: 5"
78
    And I follow "Delete ALL Responses"
79
    Then I should see "Are you sure you want to delete ALL the responses in this questionnaire?"
80
    And I press "Delete"
81
    Then I should see "You are not eligible to take this questionnaire."
82
    And I should not see "View all responses"
83
 
84
  @javascript
85
  Scenario: Choices with HTML should display filtered HTML in the responses on the response page
86
    Given the following "users" exist:
87
      | username | firstname | lastname | email |
88
      | teacher1 | Teacher | 1 | teacher1@example.com |
89
      | student1 | Student | 1 | student1@example.com |
90
    And the following "courses" exist:
91
      | fullname | shortname | category |
92
      | Course 1 | C1 | 0 |
93
    And the following "course enrolments" exist:
94
      | user | course | role |
95
      | teacher1 | C1 | editingteacher |
96
      | student1 | C1 | student |
97
    And the following "activities" exist:
98
      | activity | name | description | course | idnumber |
99
      | questionnaire | Test questionnaire | Test questionnaire description | C1 | questionnaire0 |
100
    And I log in as "teacher1"
101
    And I am on "Course 1" course homepage
102
    And I follow "Test questionnaire"
103
    And I navigate to "Questions" in current page administration
104
    And I add a "Check Boxes" question and I fill the form with:
105
      | Question Name | Q1 |
106
      | Yes | y |
107
      | Min. forced responses | 1 |
108
      | Max. forced responses | 2 |
109
      | Question Text | Select one or two choices only |
110
      | Possible answers | <b>One</b>,Two,Three,Four |
111
    And I log in as "student1"
112
    And I am on "Course 1" course homepage
113
    And I follow "Test questionnaire"
114
    And I navigate to "Answer the questions..." in current page administration
115
    Then I should see "Select one or two choices only"
116
    # And I set the field "Do you own a car?" to "y"
117
    And I set the field "One" to "checked"
118
    And I press "Submit questionnaire"
119
    And I log in as "teacher1"
120
    And I am on "Course 1" course homepage
121
    And I follow "Test questionnaire"
122
    And I navigate to "View all responses" in current page administration
123
    Then "//b[text()='One']" "xpath_element" should exist