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: Add questions to a questionnaire activity
3
  In order to conduct surveys of the users in a course
4
  As a teacher
5
  I need to add a questionnaire activity with questions to a moodle course
6
 
7
  @javascript
8
  Scenario: Add a questionnaire to a course with one of each question type
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 I log in as "teacher1"
24
    And I am on "Course 1" course homepage
25
    And I follow "Test questionnaire"
26
    And I navigate to "Questions" in current page administration
27
    And I add a "Check Boxes" question and I fill the form with:
28
      | Question Name | Q1 |
29
      | Yes | y |
30
      | Min. forced responses | 1 |
31
      | Max. forced responses | 2 |
32
      | Question Text | Select one or two choices only |
33
      | Possible answers | One,Two,Three,Four |
34
    Then I should see "[Check Boxes] (Q1)"
35
    And I should see "Select one or two choices only"
36
    And I add a "Date" question and I fill the form with:
37
      | Question Name | Q2 |
38
      | Yes | y |
39
      | Question Text | Enter today's date |
40
    Then I should see "[Date] (Q2)"
41
    And I should see "Enter today's date"
42
    And I add a "Dropdown Box" question and I fill the form with:
43
      | Question Name | Q3 |
44
      | No | n |
45
      | Question Text | Select one choice |
46
      | Possible answers | One,Two,Three,Four |
47
    Then I should see "[Dropdown Box] (Q3)"
48
    And I should see "Select one choice"
49
    And I add a "Essay Box" question and I fill the form with:
50
      | Question Name | Q4 |
51
      | No | n |
52
      | Response format | 0 |
53
      | Input box size | 10 lines |
54
      | Question Text | Enter your essay |
55
    Then I should see "[Essay Box] (Q4)"
56
    And I should see "Enter your essay"
57
    And I add a "Label" question and I fill the form with:
58
      | Question Text | Section header |
59
    Then I should see "[Label]"
60
    And I should see "Section header"
61
    And I add a "Numeric" question and I fill the form with:
62
      | Question Name | Q5 |
63
      | Yes | y |
64
      | Max. digits allowed | 4 |
65
      | Nb of decimal digits | 1 |
66
      | Question Text | Enter a number with a decimal |
67
    Then I should see "[Numeric] (Q5)"
68
    And I should see "Enter a number with a decimal"
69
    And I add a "Radio Buttons" question and I fill the form with:
70
      | Question Name | Q6 |
71
      | Yes | y |
72
      | Horizontal | Checked |
73
      | Question Text | Select one choice |
74
      | Possible answers | One,Two,Three,Four |
75
    Then I should see "[Radio Buttons] (Q6)"
76
    And I should see "Select one choice"
77
    And I add a "Rate (scale 1..5)" question and I fill the form with:
78
      | Question Name | Q7 |
79
      | Yes | y |
80
      | Nb of scale items | 4 |
81
      | Type of rate scale | N/A column |
82
      | Question Text | Rate these |
83
      | Possible answers | One,Two,Three,Four |
84
    Then I should see "[Rate (scale 1..5)] (Q7)"
85
    And I should see "Rate these"
86
    And I add a "Text Box" question and I fill the form with:
87
      | Question Name | Q8 |
88
      | No | n |
89
      | Input box length | 10 |
90
      | Max. text length | 15 |
91
      | Question Text | Enter some text |
92
    Then I should see "[Text Box] (Q8)"
93
    And I should see "Enter some text"
94
    And I add a "Yes/No" question and I fill the form with:
95
      | Question Name | Q9 |
96
      | Yes | y |
97
      | Question Text | Choose yes or no |
98
    Then I should see "[Yes/No] (Q9)"
99
    And I should see "Choose yes or no"
100
    And I set the field "id_type_id" to "----- Page Break -----"
101
    And I press "Add selected question type"
102
    Then I should see "[----- Page Break -----]"